{
  "id": "ciXByLAoC3BjDjxx",
  "name": "Facebook Ads Monitoring Loop 1.1",
  "tags": [
    {
      "id": "3Kr9akgvGQXhCtQJ",
      "name": "ForPublishing",
      "createdAt": "2025-08-13T13:36:55.022Z",
      "updatedAt": "2025-08-13T13:36:55.022Z"
    },
    {
      "id": "8ZOxg8cY0fPL8g0s",
      "name": "ReadyToUse",
      "createdAt": "2025-07-10T04:08:19.089Z",
      "updatedAt": "2025-07-10T04:08:19.089Z"
    },
    {
      "id": "tITAFvUSOpVVIBvI",
      "name": "MetaAds",
      "createdAt": "2025-07-05T02:24:26.705Z",
      "updatedAt": "2025-07-05T02:24:26.705Z"
    }
  ],
  "nodes": [
    {
      "id": "16560a38-f690-40ed-b0fc-fba0b4ed29c4",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        736,
        560
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "60f62f1d-3fb3-40b2-99b6-72ef5f609604",
      "name": "Facebook Ads API by page",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1408,
        320
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v22.0/ads_archive?ad_active_status={{ $json.ad_active_status }}&search_page_ids={{ $json.search_page_ids }}&ad_reached_countries={{ $json.ad_reached_countries }}&fields=ad_creation_time,ad_creative_bodies,ad_creative_link_captions, ad_creative_link_descriptions,ad_creative_link_titles,ad_delivery_start_time, ad_snapshot_url, languages, page_name,publisher_platforms&limit=50&access_token={{ $json.access_token }}\n",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "dc2c92f4-1cee-42ac-b9b0-8b1e74207beb",
      "name": "Facebook Ads API by keywords",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1408,
        544
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v22.0/ads_archive?ad_active_status={{ $json.ad_active_status }}&search_page_ids={{ $json.search_page_ids }}&ad_reached_countries=US,CA&fields=ad_creation_time,ad_creative_bodies,ad_creative_link_captions, ad_creative_link_descriptions,ad_creative_link_titles,ad_delivery_start_time, ad_snapshot_url, languages, page_name,publisher_platforms&access_token={{ $json.access_token }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "1d6fc965-d79a-4c3a-a83d-945a86132221",
      "name": "Page or keywords",
      "type": "n8n-nodes-base.switch",
      "position": [
        1184,
        448
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "pages",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "67a5d3dc-6358-4952-bc53-55f43662e5fb",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.search_page_ids }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "keywords",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "02cce3fa-c330-4f82-87b7-3cef8c79f5e6",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "keyword",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "79a0967c-9142-4bf1-bb77-bf51ca8ade1b",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1856,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5317a106-7d69-472b-b180-3e0264d4b90f",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.next_url }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c5eb2ebe-b084-455b-bfbf-fe06eaf9b011",
      "name": "Check the pagination",
      "type": "n8n-nodes-base.code",
      "position": [
        1632,
        448
      ],
      "parameters": {
        "jsCode": "// Separate response data and pagination information\nconst response = $input.first().json;\n\n// Prepare data array for downstream processing (for example, Google Sheets)\nconst ads = response.data || [];\n\n// Check if there is a link to the next page\nconst nextUrl = response.paging && response.paging.next ? response.paging.next : null;\n\n// Return a normalized object with data and next_url\nreturn {\n  json: {\n    data: ads,\n    next_url: nextUrl\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "059d0482-120e-45d0-bf9d-aea6be556238",
      "name": "Facebook Ads API pagination",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2304,
        304
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "3e6a3417-1a1a-4cec-be7a-739e3ac9e26e",
      "name": "Set Next URL",
      "type": "n8n-nodes-base.set",
      "position": [
        2096,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "update_url",
              "name": "url",
              "type": "string",
              "value": "={{ $json.next_url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "379a41c7-e5f2-48ad-904b-d915623548e4",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3216,
        848
      ],
      "parameters": {
        "text": "=Hello!\n{{$json.newCount}}  of ads were found today!\nYou can see full list here \u2014\u00a0https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit?usp=sharing",
        "chatId": "6666666",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "019d19d7-fd49-4171-9734-4245f856ebfb",
      "name": "Collect ID list",
      "type": "n8n-nodes-base.code",
      "position": [
        1632,
        736
      ],
      "parameters": {
        "jsCode": "const ids = items\n  .map(item => item.json.id)\n  // Cast all values to strings to avoid mismatches like \"123\" vs 123\n  .map(id => id != null ? String(id) : undefined)\n  .filter((id, index, arr) => id && arr.indexOf(id) === index);\n\nreturn [{ json: { existingIds: ids } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "613bbf11-7bc3-4084-a059-c539268f4aca",
      "name": "Read existing IDs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1408,
        736
      ],
      "parameters": {
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "range": "J:J",
              "rangeDefinition": "specifyRangeA1"
            }
          }
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit#gid=0",
          "cachedResultName": "ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit?usp=drivesdk",
          "cachedResultName": "Facebook Ads library research"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "0e2989d9-0a65-43c3-9216-c32306486060",
      "name": "Attach existing ids",
      "type": "n8n-nodes-base.merge",
      "position": [
        1984,
        640
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "8ea49309-a9d6-4bcc-8db3-cf8287769063",
      "name": "Filter new creatives",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        640
      ],
      "parameters": {
        "jsCode": "const ads = $json.data || [];\n// existingIds may be numbers or strings \u2014 normalize everything to strings\nconst existingIds = ($json.existingIds || []).map(id => id != null ? String(id) : undefined).filter(Boolean);\nconst seen = new Set(existingIds);\nconst newAds = [];\n\nfor (const ad of ads) {\n  if (!ad?.id) continue;\n  const adId = String(ad.id);\n  if (!seen.has(adId)) {\n    newAds.push(ad);\n    seen.add(adId); // protect against duplicates within a single run and across runs\n  }\n}\n\nreturn {\n  json: {\n    data: newAds\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "974773be-971d-4657-b633-7de87d77db03",
      "name": "Count new ads",
      "type": "n8n-nodes-base.code",
      "position": [
        2736,
        832
      ],
      "parameters": {
        "jsCode": "     return [{\n       json: {\n         newCount: items.length\n       }\n     }];"
      },
      "typeVersion": 2
    },
    {
      "id": "77bbeeb9-89e4-44f7-bf2c-71839df06fb4",
      "name": "Any new ads?",
      "type": "n8n-nodes-base.if",
      "position": [
        2960,
        832
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7a168687-e3bb-4fb8-8992-c9416dca850e",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.newCount }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "dbdb161a-136e-4b14-ba48-23e660348ae3",
      "name": "Add parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9204adee-0f3d-471c-95ab-f2ff1081a36d",
              "name": "ad_active_status",
              "type": "string",
              "value": "active"
            },
            {
              "id": "2c0dbe9c-84ff-43bc-be11-91cb59462b6f",
              "name": "search_page_ids",
              "type": "string",
              "value": "114099778241791,101962412753276"
            },
            {
              "id": "fbb5d2af-d430-4836-bc7f-50791a29c155",
              "name": "ad_reached_countries",
              "type": "string",
              "value": "US,AU,NZ,CA"
            },
            {
              "id": "cb87fedd-a2ef-4631-89cc-04259609d67b",
              "name": "keywords",
              "type": "string",
              "value": ""
            },
            {
              "id": "1d393b38-79e9-4a44-ba64-540d64e3bda4",
              "name": "access_token",
              "type": "string",
              "value": "put_your_token_here"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6869dc52-80cb-41f5-8781-612207f4b256",
      "name": "Add to sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2624,
        640
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $json.data.id }}",
            "link": "={{ $json.data.ad_creative_link_captions }}",
            "page": "={{ $json.data.page_name }}",
            "title": "={{ $json.data.ad_creative_link_titles }}",
            "snapshot": "={{ $json.data.ad_snapshot_url }}",
            "languages": "={{ $json.data.languages }}",
            "platforms": "={{ $json.data.publisher_platforms }}",
            "description": "={{ $json.data.ad_creative_bodies }}",
            "creation time": "={{ $json.data.ad_creation_time }}",
            "delivery_start_time": "={{ $json.data.ad_delivery_start_time }}"
          },
          "schema": [
            {
              "id": "creation time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "creation time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "page",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "delivery_start_time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "delivery_start_time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "snapshot",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "snapshot",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "languages",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "languages",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "platforms",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "platforms",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit?usp=drivesdk",
          "cachedResultName": "Facebook Ads Private Jets"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "8780c8f2-6b2e-4579-bff8-1bcc14181241",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2400,
        640
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "bc7416f7-c1f6-40d3-aee0-da79dadacbdb",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 652,
        "height": 592,
        "content": "# Facebook Ads Monitoring Loop\n\n## How it works\n\nAutomatically monitors Meta Ads creatives from specific Facebook Pages or keyword searches, saves them to Google Sheets, and sends notifications to Telegram or Slack every time it finds new creatives.\n\n**Setup**\n- Create an app on [Facebook Developers](https://developers.facebook.com/apps/), get access to the Marketing API, and generate a token\n- Connect Google Sheets, Slack, or Telegram\n- Add page IDs of your competitors or keywords, and choose the countries you want to monitor\n- Update spreadsheet IDs, the Slack channel, or the Telegram chat ID\n\n**Benefits**\n- Never miss new creatives from your competitors\n- Collect a creative dataset for competitors or relevant keywords\n- See the timeline of how creatives change over time\n\n\nBuilt by Kirill Khatkevich\n[Connect on LinkedIn](https://www.linkedin.com/in/kirill-khatkevich/)"
      },
      "typeVersion": 1
    },
    {
      "id": "124baa9a-cbb8-4163-80f3-351610af7d52",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        704
      ],
      "parameters": {
        "color": 5,
        "width": 304,
        "height": 240,
        "content": "## Add your parameters\n- Creative status (you can choose ALL, but be careful \u2014 it could be a lot)\n- Page IDs (you can add one or a few, separated by commas)\n- Countries\n- Keywords (you can add one or a few, separated by commas)\n- Access token from the app"
      },
      "typeVersion": 1
    },
    {
      "id": "8348debf-41b3-4390-9520-baa0b8fd5bba",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        352
      ],
      "parameters": {
        "color": 5,
        "width": 176,
        "content": "This node decides whether to check pages or keywords"
      },
      "typeVersion": 1
    },
    {
      "id": "a17a01ae-1446-45f7-b27e-b57e2e1a3d5b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        208
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 512,
        "content": "These nodes make API requests to the Meta Ads Library API"
      },
      "typeVersion": 1
    },
    {
      "id": "81125051-dcff-4cac-a6b2-df79437347b5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 944,
        "height": 416,
        "content": "The Meta Ads Library API returns only 25 results per page. Here we check if there are more than 25 results and loop, fetching each next page of 25 results until it finishes."
      },
      "typeVersion": 1
    },
    {
      "id": "5e419028-c945-48b8-aaca-b1572c71f0e6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        816
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 208,
        "content": "\n\n\n\n\n\nCheck which creative IDs already exist in Google Sheets so we only send a notification when new ones are found"
      },
      "typeVersion": 1
    },
    {
      "id": "6329c97a-0ee5-4e4a-88cd-420b44089cbc",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        784
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\n\n\nCollect IDs for future matching"
      },
      "typeVersion": 1
    },
    {
      "id": "2033c733-3e9e-4ffc-8c8c-828cd2ff8efa",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\n\n\nMatch creatives from the API response with those already stored in Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "839b219e-4565-4ce6-9bf0-78c098f2593c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\n\n\nMatch creatives from the API response with those already stored in Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "22b7837a-7d4a-4402-8b31-b4869a437c71",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2352,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\n\n\nSplit out array data into individual items"
      },
      "typeVersion": 1
    },
    {
      "id": "642640af-c936-47aa-91ad-2cde3c137e3f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2608,
        480
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\nAdd creatives to Google Sheets. Be careful to keep the column order and names in sync."
      },
      "typeVersion": 1
    },
    {
      "id": "c88132d3-b099-41fb-b4ed-6bdb06d46bc4",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2688,
        912
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 192,
        "content": "\n\n\n\nCount how many new creatives were found for a more compact message. Use {{$json.newCount}} in the Slack or Telegram message."
      },
      "typeVersion": 1
    },
    {
      "id": "c5e904df-9aed-4dac-86bd-38c000ce138f",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        3216,
        704
      ],
      "parameters": {
        "text": "=Hello!\n{{$json.newCount}}  of ads were found today!\nYou can see full list here \u2014\u00a0https://docs.google.com/spreadsheets/d/1sLKktslKS1QyC6Hc8amb2d1HBgCUAi_z01YQ_u0Na8Q/edit?usp=sharing",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "otherOptions": {}
      },
      "typeVersion": 2.3
    },
    {
      "id": "5e864ad2-8d00-46ac-b052-4e1dfddbff1b",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2928,
        912
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\nCheck if there are any new ads before sending notifications"
      },
      "typeVersion": 1
    },
    {
      "id": "a4961b4e-53e3-40f4-856b-f7465c859062",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3168,
        576
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\nSend Slack notification about new creatives"
      },
      "typeVersion": 1
    },
    {
      "id": "85f96cc2-8fa2-459c-85e8-315592d3486b",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3184,
        944
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "content": "\n\n\n\nSend Telegram notification about new creatives"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5aa1a5f5-6e02-4ee9-81f4-f14d5135e084",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Set Next URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Add to sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Count new ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Any new ads?": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Next URL": {
      "main": [
        [
          {
            "node": "Facebook Ads API pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Count new ads": {
      "main": [
        [
          {
            "node": "Any new ads?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add parameters": {
      "main": [
        [
          {
            "node": "Read existing IDs",
            "type": "main",
            "index": 0
          },
          {
            "node": "Page or keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect ID list": {
      "main": [
        [
          {
            "node": "Attach existing ids",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Page or keywords": {
      "main": [
        [
          {
            "node": "Facebook Ads API by page",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Facebook Ads API by keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Add parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read existing IDs": {
      "main": [
        [
          {
            "node": "Collect ID list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attach existing ids": {
      "main": [
        [
          {
            "node": "Filter new creatives",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the pagination": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          },
          {
            "node": "Attach existing ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter new creatives": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Ads API by page": {
      "main": [
        [
          {
            "node": "Check the pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Ads API pagination": {
      "main": [
        [
          {
            "node": "Check the pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Ads API by keywords": {
      "main": [
        [
          {
            "node": "Check the pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}