{
  "name": "Weekly competitor Google Ads digest",
  "nodes": [
    {
      "parameters": {
        "content": "## Weekly competitor ads digest \u2192 email\n1. Open **Run monitor** \u2192 Credential \u2192 *Header Auth*: Name `Authorization`, Value `Bearer YOUR_APIFY_TOKEN` (Apify Console \u2192 Settings \u2192 API & Integrations).\n2. Edit the JSON body: competitor names, advertiser IDs or domains, and the region.\n3. Set SMTP credentials and addresses in **Email digest**.\n\nRuns every Monday 09:00. With `outputMode: new`, each run returns only ads you haven't received yet (the first run is a baseline).",
        "height": 300,
        "width": 420
      },
      "id": "926448d3-6afb-4df8-84c6-1812e3221c54",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -460,
        -120
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "id": "20a40b10-452e-48d2-b244-76fafac466e1",
      "name": "Every Monday 09:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/kirozhang~google-ads-competitor-monitor/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "timeout",
              "value": "300"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"competitors\": [\n    \"pipedrive.com\",\n    \"hubspot.com\"\n  ],\n  \"region\": \"us\",\n  \"lookbackDays\": 7,\n  \"outputMode\": \"new\",\n  \"maxAdsPerCompetitor\": 100,\n  \"trackingId\": \"crm-competitors-us\"\n}",
        "options": {
          "timeout": 310000
        }
      },
      "id": "f21ce7b6-ac35-4658-be7d-f004b4685fa6",
      "name": "Run ads monitor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "df892da9-59a6-40be-9f0a-ad8b0df32ece",
              "leftValue": "={{ $json.isBaseline }}",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "rightValue": ""
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "1fd14828-38b1-4e23-aacb-90c81ea9464d",
      "name": "Skip baseline",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "id": "d0f56e66-df23-4732-9edd-25b5885c1e8c",
      "name": "Collect",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        660,
        0
      ]
    },
    {
      "parameters": {
        "fromEmail": "alerts@example.com",
        "toEmail": "you@example.com",
        "subject": "={{ $json.data.length }} new competitor ads this week",
        "emailFormat": "text",
        "text": "={{ $json.data.map(a => `${a.competitor} | ${a.format} | ${(a.headlines || [])[0] || ''} | ${a.destinationUrl || a.landingDomain || ''}\\n  ${a.transparencyUrl}`).join('\\n\\n') }}",
        "options": {}
      },
      "id": "b13407d7-6543-44f2-839e-3bcf97ba8068",
      "name": "Email digest",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        880,
        0
      ]
    }
  ],
  "connections": {
    "Every Monday 09:00": {
      "main": [
        [
          {
            "node": "Run ads monitor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run ads monitor": {
      "main": [
        [
          {
            "node": "Skip baseline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip baseline": {
      "main": [
        [
          {
            "node": "Collect",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect": {
      "main": [
        [
          {
            "node": "Email digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}