AutomationFlowsAI & RAG › Monitor and Analyze Competitor Facebook Ads with Apify, Gpt-4o, Gemini, and…

Monitor and Analyze Competitor Facebook Ads with Apify, Gpt-4o, Gemini, and…

Original n8n title: Monitor and Analyze Competitor Facebook Ads with Apify, Gpt-4o, Gemini, and Google Sheets

ByAhmed Salama @ahmedsalama on n8n.io

Categories Marketing Intelligence, Ad Operations, Competitive Research, Creative Analysis

Event trigger★★★★☆ complexityAI-powered28 nodesHTTP RequestGoogle SheetsOpenAI@Apify/N8N Nodes ApifyDropboxGoogle Gemini
AI & RAG Trigger: Event Nodes: 28 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13096 — we link there as the canonical source.

This workflow follows the Apifyn8N Nodes Apify → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "3P_6u6SX2W-TVF5uekiZB",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Monitor & reverse-engineer competitor Facebook ads using Apify, AI, and G-Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "718a079d-caa2-4f80-952f-c5c2e52702af",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        4816,
        4512
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "81959cf5-ae9b-4f29-9f98-5d4c394e6e94",
      "name": "Download Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6320,
        3904
      ],
      "parameters": {
        "url": "={{ $json.snapshot.cards[0].video_hd_url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "ce2f0f3a-d61c-40cb-9c90-a1813e156492",
      "name": "Loop Over Image Ads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6128,
        4544
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ad2bd2d6-30a5-4911-83c2-1c5c1a6c4212",
      "name": "Loop Over Text Ads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6272,
        5184
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "9ec28eeb-5727-47c5-a29f-74e83704abc3",
      "name": "Loop Over Video Ads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6080,
        4080
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "a767c8b9-0246-4de5-966a-03816a1a03c2",
      "name": "Add as Type = Video",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7408,
        3904
      ],
      "parameters": {
        "columns": {
          "value": {
            "type": "video",
            "page_id": "={{ $('Loop Over Video Ads').item.json.page_id }}",
            "summary": "={{ $json.content.parts[0].text }}",
            "page_url": "={{ $('Loop Over Video Ads').item.json.snapshot.page_profile_uri }}",
            "page_name": "={{ $('Loop Over Video Ads').item.json.snapshot.page_name }}",
            "date_added": "={{ $now }}",
            "image_prompt": "=",
            "video_prompt": "={{ $json.content.parts[0].text }}",
            "ad_archive_id": "={{ $('Loop Over Video Ads').item.json.ad_archive_id }}"
          },
          "schema": [
            {
              "id": "ad_archive_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_archive_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_added",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_added",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rewritten_ad_copy",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "rewritten_ad_copy",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "image_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "image_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ad_archive_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo/edit#gid=0",
          "cachedResultName": "Ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "7ef1dff2-166a-4dc2-b393-112bc468c7b7",
      "name": "Analyze Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6704,
        4464
      ],
      "parameters": {
        "text": "What's in this image? Be extremely comprehensive.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a27aff52-131d-46a5-8ab2-3dea7c1aae64",
      "name": "Output Image Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6928,
        4464
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You're a helpful, intelligent advertisement analysis bot. You analyze advertisements."
            },
            {
              "content": "Your task is to take as input a scraped javascript object from an advertisement in the FB ad library, and then summarize it + spin (repurpose, rewrite) the ad copy. \n\nYou're doing this for strategic intelligence. We run an advertising agency and we're always looking at what our competitor advertisers are doing.\n\nOutput your results in this JSON format:\n\n{\"summary\":\"\",\"rewrittenAdCopy\":\"\"}\n\nRules:\n- The intended style and attitude is generally analytical, inquisitive, and precise, despite exploring complex topics, in the \u201cclassic style\u201d of Western writing.\nthe level of formality should be inverse to the topic\u2019s novelty: the weirder something is, the more formal. For \u2018safer\u2019 topics, one should cut loose with the humor, epigraphs, typographical stunts and experiments, etc.\n- Avoid hedging and qualifying, even at the risk of making overly-strong claims. It is a slippery slope.\n- Use casual abbreviations (like San Francisco -> SF, thanks -> thx, question -> q ), casual contractions (like \"I've\"), shortened forms of common nouns (like \"info\", \"vid\", \"app\") as this signals more human written speech. Do not use em dashes (eliminate \u2014 from your vocabulary completely!\n- No rhetorical questions.\n- Make your summary extremely comprehensive and analytical."
            },
            {
              "content": "=JSON scrape:\n\n{{ $('Loop Over Image Ads').item.json.toJsonString() }}\n\nImage description:\n\n{{ $json.content }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a00dc480-7dd1-452c-8163-6030b4478a28",
      "name": "Output Text Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6496,
        5104
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {
          "temperature": 0.7
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You're a helpful, intelligent advertisement analysis bot. You analyze advertisements."
            },
            {
              "content": "Your task is to take as input a scraped javascript object from an advertisement in the FB ad library, and then summarize it + spin (repurpose, rewrite) the ad copy. \n\nYou're doing this for strategic intelligence. We run an advertising agency and we're always looking at what our competitor advertisers are doing.\n\nOutput your results in this JSON format:\n\n{\"summary\":\"\",\"rewrittenAdCopy\":\"\"}\n\nRules:\n- The intended style and attitude is generally analytical, inquisitive, and precise, despite exploring complex topics, in the \u201cclassic style\u201d of Western writing.\nthe level of formality should be inverse to the topic\u2019s novelty: the weirder something is, the more formal. For \u2018safer\u2019 topics, one should cut loose with the humor, epigraphs, typographical stunts and experiments, etc.\n- Avoid hedging and qualifying, even at the risk of making overly-strong claims. It is a slippery slope.\n- Use casual abbreviations (like San Francisco -> SF, thanks -> thx, question -> q ), casual contractions (like \"I've\"), shortened forms of common nouns (like \"info\", \"vid\", \"app\") as this signals more human written speech. Do not use em dashes (eliminate \u2014 from your vocabulary completely!\n- No rhetorical questions.\n- Make your summary extremely comprehensive and analytical."
            },
            {
              "content": "={{ $json.toJsonString() }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "c113cce1-6349-4bdb-a950-f66c3387192a",
      "name": "Add as Type = Text",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6848,
        5104
      ],
      "parameters": {
        "columns": {
          "value": {
            "type": "text",
            "page_id": "={{ $('Loop Over Text Ads').item.json.page_id }}",
            "summary": "={{ $json.message.content.summary }}",
            "page_url": "={{ $('Loop Over Text Ads').item.json.snapshot.page_profile_uri }}",
            "page_name": "={{ $('Loop Over Text Ads').item.json.snapshot.page_name }}",
            "date_added": "={{ $now }}",
            "ad_archive_id": "={{ $('Loop Over Text Ads').item.json.ad_archive_id }}",
            "rewritten_ad_copy": "={{ $json.message.content.rewrittenAdCopy }}"
          },
          "schema": [
            {
              "id": "ad_archive_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_archive_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_added",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_added",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rewritten_ad_copy",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "rewritten_ad_copy",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "image_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "image_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo/edit#gid=0",
          "cachedResultName": "Ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo/edit?usp=drivesdk",
          "cachedResultName": "Facebook Ad Library Analyzer DB"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "1702af77-33b1-4b04-b88b-af06b4ad3d3c",
      "name": "Run an Actor and get dataset",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        5040,
        4512
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "id",
          "value": "XtaWFhbtfxyzqrFmd"
        },
        "timeout": {},
        "operation": "Run actor and get dataset",
        "customBody": "{\n    \"count\": 100,\n    \"scrapeAdDetails\": false,\n    \"scrapePageAds.activeStatus\": \"all\",\n    \"scrapePageAds.countryCode\": \"ALL\",\n    \"urls\": [\n        {\n            \"url\": \"https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=IN&q=linkedin&search_type=keyword_unordered&media_type=all\"\n        },\n        {\n            \"url\": \"https://www.facebook.com/ZapierApp\"\n        }\n    ]\n}",
        "actorSource": "store",
        "authentication": "apifyOAuth2Api"
      },
      "credentials": {
        "apifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c1cf9053-c28a-46a3-9841-cda316dba8cb",
      "name": "Upload a file",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        6608,
        3904
      ],
      "parameters": {
        "path": "/home/Camera",
        "binaryData": true,
        "authentication": "oAuth2"
      },
      "credentials": {
        "dropboxOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "899c875b-7eae-48df-a27c-ce4c278b4ade",
      "name": "Add as Type = Image",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7280,
        4464
      ],
      "parameters": {
        "columns": {
          "value": {
            "type": "image",
            "page_id": "={{ $('Loop Over Image Ads').item.json.page_id }}",
            "summary": "={{ $json.message.content.summary }}",
            "page_url": "={{ $('Loop Over Image Ads').item.json.snapshot.page_profile_uri }}",
            "page_name": "={{ $('Loop Over Image Ads').item.json.snapshot.page_name }}",
            "date_added": "={{ $now }}",
            "image_prompt": "={{ $('Analyze Image').item.json.content }}",
            "ad_archive_id": "={{ $('Loop Over Image Ads').item.json.ad_archive_id }}",
            "rewritten_ad_copy": "={{ $json.message.content.rewrittenAdCopy }}"
          },
          "schema": [
            {
              "id": "ad_archive_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ad_archive_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date_added",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date_added",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rewritten_ad_copy",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "rewritten_ad_copy",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "image_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "image_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video_prompt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video_prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo/edit#gid=0",
          "cachedResultName": "Ads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Cgm0DfKQxgtsjdw6h2LFVBtZnLAioTntzdXgfJCJIqo/edit?usp=drivesdk",
          "cachedResultName": "Facebook Ad Library Analyzer DB"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4d7a17da-7839-4946-9562-9dda4c0f9dea",
      "name": "Analyze video",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        7184,
        3904
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "resource": "video",
        "inputType": "binary",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "add6d12b-a255-4219-81d2-67b134caadcf",
      "name": "Download a file",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        6896,
        3904
      ],
      "parameters": {
        "path": "={{ $json.path_lower }}",
        "operation": "download",
        "authentication": "oAuth2"
      },
      "credentials": {
        "dropboxOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ea5eb0e4-0dca-4e4f-a90f-db50f9c879b7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4192,
        4320
      ],
      "parameters": {
        "width": 544,
        "height": 480,
        "content": "## How it works\n\nScrapes live ads from Facebook Ad Library via Apify\n\nFilters for proven advertisers using page-like thresholds\n\nDetects creative type (video, image, text) automatically\n\nApplies AI analysis per format to extract strategy, angles, and reuse prompts\n\nStores structured intelligence in Google Sheets, deduped by ad ID\n\n## Setup steps\n\nConnect Apify, OpenAI, Gemini, Google Sheets credentials\n\nConfirm Google Sheet headers match workflow fields\n\nAdjust like threshold if needed\n\nRun manually or schedule"
      },
      "typeVersion": 1
    },
    {
      "id": "6d8e85dd-8118-4c35-991b-74e18053cc4e",
      "name": "Detect Ad Creative Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        5584,
        4496
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Video",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9dbbe6e7-fd80-44ab-88f0-ab438cfd997e",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.snapshot.cards[0].video_sd_url }}",
                    "rightValue": "=https://video-"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0b7cee75-ca57-4946-971e-1f526b49324f",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.snapshot.cards[0].original_image_url }}",
                    "rightValue": "https://scontent-ho"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Text"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "26d70958-270e-47c3-8032-539528e72566",
      "name": "Filter High-Signal Pages (>5k Likes)",
      "type": "n8n-nodes-base.filter",
      "position": [
        5264,
        4512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1d74591-13e8-4c79-9a34-117cc6816dfb",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.snapshot.page_like_count }}",
              "rightValue": 5000
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "76e6bac0-2296-434f-8b69-7a95f3ef412e",
      "name": "Rate Limit Guard (Video)",
      "type": "n8n-nodes-base.wait",
      "position": [
        7632,
        4064
      ],
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "0782b855-f64e-4ebd-8708-8bb48100a8a9",
      "name": "Rate Limit Guard (Image)",
      "type": "n8n-nodes-base.wait",
      "position": [
        7504,
        4544
      ],
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "7e5e5138-9771-433e-b260-ad853c3a8a54",
      "name": "Rate Limit Guard (Text)",
      "type": "n8n-nodes-base.wait",
      "position": [
        7136,
        5184
      ],
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "0c5d13bb-396b-46f1-b881-3997f6e92982",
      "name": "Scrape Facebook Ad Library (Apify)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6416,
        4464
      ],
      "parameters": {
        "url": "={{ $json.snapshot.page_profile_picture_url }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "34d691c5-a629-437a-93b9-2ce0d49d8a4c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4992,
        4336
      ],
      "parameters": {
        "color": 7,
        "width": 182,
        "content": "## Data Ingestion\nApify scrape and raw ad snapshot retrieval"
      },
      "typeVersion": 1
    },
    {
      "id": "896c3a18-990f-41cc-97d2-cbeaa551aa56",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5216,
        4336
      ],
      "parameters": {
        "color": 7,
        "width": 176,
        "content": "## Signal Filtering\nRemove low-quality advertisers early"
      },
      "typeVersion": 1
    },
    {
      "id": "e415354c-e591-4e26-8314-61cc0cfb3966",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6032,
        3776
      ],
      "parameters": {
        "color": 7,
        "width": 1750,
        "height": 464,
        "content": "## AI Video Analysis\nFormat-specific analysis and rewriting"
      },
      "typeVersion": 1
    },
    {
      "id": "d2507035-a17d-4a59-aaf0-6ab22199d06c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6080,
        4320
      ],
      "parameters": {
        "color": 7,
        "width": 1574,
        "height": 400,
        "content": "## AI Image Analysis\nFormat-specific analysis and rewriting"
      },
      "typeVersion": 1
    },
    {
      "id": "4baaf765-4cb7-4d3e-ad15-513be7e3c473",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6224,
        4992
      ],
      "parameters": {
        "color": 7,
        "width": 1062,
        "height": 368,
        "content": "## AI Text Analysis\nFormat-specific analysis and rewriting"
      },
      "typeVersion": 1
    },
    {
      "id": "128c3032-49dc-442b-a60e-0fe08d77704c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5536,
        4336
      ],
      "parameters": {
        "color": 7,
        "width": 176,
        "content": "## Creative Routing\nSplit ads into video, image, text pipelines"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "dd5d11fc-c419-4e96-900f-7fcce36156b5",
  "connections": {
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Output Image Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze video": {
      "main": [
        [
          {
            "node": "Add as Type = Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload a file": {
      "main": [
        [
          {
            "node": "Download a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Upload a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download a file": {
      "main": [
        [
          {
            "node": "Analyze video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add as Type = Text": {
      "main": [
        [
          {
            "node": "Rate Limit Guard (Text)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Text Ads": {
      "main": [
        [],
        [
          {
            "node": "Output Text Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add as Type = Image": {
      "main": [
        [
          {
            "node": "Rate Limit Guard (Image)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add as Type = Video": {
      "main": [
        [
          {
            "node": "Rate Limit Guard (Video)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Image Ads": {
      "main": [
        [],
        [
          {
            "node": "Scrape Facebook Ad Library (Apify)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Video Ads": {
      "main": [
        [],
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Text Summary": {
      "main": [
        [
          {
            "node": "Add as Type = Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Image Summary": {
      "main": [
        [
          {
            "node": "Add as Type = Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Ad Creative Type": {
      "main": [
        [
          {
            "node": "Loop Over Video Ads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Image Ads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Text Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Guard (Text)": {
      "main": [
        [
          {
            "node": "Loop Over Text Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Guard (Image)": {
      "main": [
        [
          {
            "node": "Loop Over Image Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Guard (Video)": {
      "main": [
        [
          {
            "node": "Loop Over Video Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run an Actor and get dataset": {
      "main": [
        [
          {
            "node": "Filter High-Signal Pages (>5k Likes)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Facebook Ad Library (Apify)": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter High-Signal Pages (>5k Likes)": {
      "main": [
        [
          {
            "node": "Detect Ad Creative Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Run an Actor and get dataset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Categories Marketing Intelligence, Ad Operations, Competitive Research, Creative Analysis

Source: https://n8n.io/workflows/13096/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Automatically turn top performing Instagram reels into 7 new ready to use content scripts. This workflow scrapes high performing posts from a chosen Instagram profile, downloads and transcribes the re

OpenAI, HTTP Request, @Apify/N8N Nodes Apify +2
AI & RAG

Ask questions like “How much did I spend on food last month?” and get instant answers from your financial data — directly in Telegram.

Telegram Trigger, OpenAI, Google Sheets +2
AI & RAG

AI Institutional Stock Valuation Engine with Risk Scoring & Scenario Targets

Google Sheets, XML, HTTP Request +3
AI & RAG

Overview This is a production-grade, fully automated stock analysis system built entirely in n8n. It combines institutional-level financial analysis, dual AI model consensus, and a self-improving back

Google Sheets, XML, HTTP Request +3
AI & RAG

The Problem That it Solves

Google Drive Trigger, OpenAI, Google Drive +5