Created
January 25, 2026 16:12
-
-
Save shraey96/e2be503184b78262bd35000e0d282da3 to your computer and use it in GitHub Desktop.
Scrape & Analyze Meta Ad Library Image Ads with OpenAI and store results in Google Sheets - Meta Image Ads AnalyzerThis n8n template builds an automated system to scrape, analyze, and extract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "id": "ERIlxRN2QNARj3RZ", | |
| "meta": { | |
| "instanceId": "0aee4372a556f3e4774323f4ed89755880cea473443f0948966509bbf55dec04", | |
| "templateCredsSetupCompleted": true | |
| }, | |
| "name": "Scrape & Analyze Meta Ad Library Image Ads with OpenAI and store results in Google Sheets", | |
| "tags": [], | |
| "nodes": [ | |
| { | |
| "id": "0d98546f-9c0b-475d-81d3-d63c5dd18bc4", | |
| "name": "When clicking ‘Test workflow’", | |
| "type": "n8n-nodes-base.manualTrigger", | |
| "position": [ | |
| -120, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 1 | |
| }, | |
| { | |
| "id": "54f05394-221a-4e50-b4f5-50e4b7b4cc8a", | |
| "name": "Settings", | |
| "type": "n8n-nodes-base.set", | |
| "position": [ | |
| 80, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 3.4 | |
| }, | |
| { | |
| "id": "3cac5c6a-bd72-4c39-9232-5926e4ef1cd0", | |
| "name": "Clean Prompt", | |
| "type": "n8n-nodes-base.code", | |
| "position": [ | |
| 280, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 2 | |
| }, | |
| { | |
| "id": "a6418f56-233c-410e-8186-ff40a993c980", | |
| "name": "Scrape Meta Ad Library with Apify", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "position": [ | |
| 480, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 4.2 | |
| }, | |
| { | |
| "id": "a5502f95-ecc4-47d9-a6ef-0d17257f8255", | |
| "name": "Pass relevant Fields", | |
| "type": "n8n-nodes-base.set", | |
| "position": [ | |
| 1700, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 3.4 | |
| }, | |
| { | |
| "id": "32a72f8f-ae54-4c3c-8d1a-5859a5360275", | |
| "name": "Calculate Runtime in Days", | |
| "type": "n8n-nodes-base.set", | |
| "position": [ | |
| 720, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 3.4 | |
| }, | |
| { | |
| "id": "4e8f97f3-b65b-4bf3-ab30-8572af490dda", | |
| "name": "Sort by Reach or Days Running", | |
| "type": "n8n-nodes-base.sort", | |
| "position": [ | |
| 940, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 1 | |
| }, | |
| { | |
| "id": "b709b632-647c-4ff8-8f0a-f1f7163841ef", | |
| "name": "Filter only Image Ads", | |
| "type": "n8n-nodes-base.filter", | |
| "position": [ | |
| 1180, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 2.2 | |
| }, | |
| { | |
| "id": "20255e0f-f34c-4499-b2e4-c19330047998", | |
| "name": "Limit Images to Analyze", | |
| "type": "n8n-nodes-base.limit", | |
| "position": [ | |
| 1440, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 1 | |
| }, | |
| { | |
| "id": "4ccd7e75-f124-481f-be20-2d2dd7b811f9", | |
| "name": "OpenAI Chat Model", | |
| "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | |
| "position": [ | |
| 2380, | |
| 320 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 1.2 | |
| }, | |
| { | |
| "id": "66e268d4-5db5-485d-ba63-f48af4557429", | |
| "name": "Structured Output Parser", | |
| "type": "@n8n/n8n-nodes-langchain.outputParserStructured", | |
| "position": [ | |
| 2560, | |
| 320 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 1.2 | |
| }, | |
| { | |
| "id": "8edfd824-8571-4cc7-b1f4-2172e3d0ad47", | |
| "name": "Download Image", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "position": [ | |
| 1960, | |
| 380 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 4.2 | |
| }, | |
| { | |
| "id": "dcc7f234-14f8-4e71-8c2f-2f6611b1126d", | |
| "name": "Analyze Image Contents", | |
| "type": "@n8n/n8n-nodes-langchain.agent", | |
| "maxTries": 2, | |
| "position": [ | |
| 2380, | |
| 80 | |
| ], | |
| "parameters": {}, | |
| "retryOnFail": true, | |
| "typeVersion": 1.8 | |
| }, | |
| { | |
| "id": "2b3dbff9-da61-4f94-a77a-0728456e5c4e", | |
| "name": "Save Image to Google Drive", | |
| "type": "n8n-nodes-base.googleDrive", | |
| "position": [ | |
| 2440, | |
| 580 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 3 | |
| }, | |
| { | |
| "id": "34c28c32-a4d2-49da-a2e9-f97bbb131031", | |
| "name": "Merge Data", | |
| "type": "n8n-nodes-base.merge", | |
| "position": [ | |
| 2820, | |
| 360 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 3.1 | |
| }, | |
| { | |
| "id": "7e2af3a6-2129-4dc0-a88a-92672191b66b", | |
| "name": "Store Data in Google Sheets", | |
| "type": "n8n-nodes-base.googleSheets", | |
| "position": [ | |
| 3120, | |
| 360 | |
| ], | |
| "parameters": {}, | |
| "typeVersion": 4.5 | |
| }, | |
| { | |
| "id": "0ba0d9b7-2b83-4131-87d1-66c68c8c776b", | |
| "name": "Sticky Note", | |
| "type": "n8n-nodes-base.stickyNote", | |
| "position": [ | |
| 20, | |
| 260 | |
| ], | |
| "parameters": { | |
| "content": "" | |
| }, | |
| "typeVersion": 1 | |
| }, | |
| { | |
| "id": "69c089a0-df87-4723-8362-fb8c198fc130", | |
| "name": "Sticky Note1", | |
| "type": "n8n-nodes-base.stickyNote", | |
| "position": [ | |
| 2360, | |
| 780 | |
| ], | |
| "parameters": { | |
| "content": "" | |
| }, | |
| "typeVersion": 1 | |
| } | |
| ], | |
| "active": false, | |
| "pinData": {}, | |
| "settings": { | |
| "executionOrder": "v1" | |
| }, | |
| "versionId": "30c23991-ebad-444e-a9da-7fc782c99739", | |
| "connections": { | |
| "Settings": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Clean Prompt", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Merge Data": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Store Data in Google Sheets", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Clean Prompt": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Scrape Meta Ad Library with Apify", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Download Image": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Save Image to Google Drive", | |
| "type": "main", | |
| "index": 0 | |
| }, | |
| { | |
| "node": "Analyze Image Contents", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "OpenAI Chat Model": { | |
| "ai_languageModel": [ | |
| [ | |
| { | |
| "node": "Analyze Image Contents", | |
| "type": "ai_languageModel", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Pass relevant Fields": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Download Image", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Filter only Image Ads": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Limit Images to Analyze", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Analyze Image Contents": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Merge Data", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Limit Images to Analyze": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Pass relevant Fields", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Structured Output Parser": { | |
| "ai_outputParser": [ | |
| [ | |
| { | |
| "node": "Analyze Image Contents", | |
| "type": "ai_outputParser", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Calculate Runtime in Days": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Sort by Reach or Days Running", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Save Image to Google Drive": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Merge Data", | |
| "type": "main", | |
| "index": 1 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Store Data in Google Sheets": { | |
| "main": [ | |
| [] | |
| ] | |
| }, | |
| "Sort by Reach or Days Running": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Filter only Image Ads", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Scrape Meta Ad Library with Apify": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Calculate Runtime in Days", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "When clicking ‘Test workflow’": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Settings", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment