AutomationFlowsAI & RAG › Create Ai-generated Meta Ad Campaigns From Product Urls with Openai & Firecrawl

Create Ai-generated Meta Ad Campaigns From Product Urls with Openai & Firecrawl

ByAbdellah Homrani @adamcrafts on n8n.io

Turn any product page into ready-to-run Meta ads—fast, consistent, and client-friendly.

Event trigger★★★★★ complexityAI-powered40 nodesForm TriggerHTTP RequestOpenAI@Mendable/N8N Nodes FirecrawlOpenAI ChatOutput Parser StructuredChain LlmAgent
AI & RAG Trigger: Event Nodes: 40 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Agent → Chainllm 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7fe8fca7-cfaa-4d8d-9d5b-e7a8e288ea21",
      "name": "Split",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1504,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c2d0dc8d-4f93-4879-a8e8-90893a866627",
      "name": "Platform Adapter",
      "type": "n8n-nodes-base.code",
      "position": [
        1728,
        400
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5d1715b4-9077-4193-a62a-6e01ec9197fb",
      "name": "Batch",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1952,
        400
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "9c4f6edb-e4ed-4ad4-9353-c4bb6a4d333d",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2176,
        400
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "e782f17b-56eb-4b06-8019-42bcc10985dc",
      "name": "AI Ad Form Submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -640,
        400
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "09ebd976-f855-46b2-9f33-343811c7117c",
      "name": "Open AI Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2400,
        400
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ff2bdaaf-b7e0-4480-a72c-0d002df0c0d8",
      "name": "B64 String to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2608,
        400
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "335aa491-31e3-451e-9f8c-b4ebf5db0337",
      "name": "Creative Brief",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        704,
        400
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.8
    },
    {
      "id": "4d2625d2-937d-4ae8-8364-ed11e4b35eba",
      "name": "Scrape a url and get its content",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "position": [
        -416,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "31186bf1-30aa-4f06-bd38-0e3e0ac14244",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -128,
        624
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "5bf6f5c1-ced8-43e0-a594-b6224923dbba",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -112,
        416
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "7e523dfe-1b4d-487f-840f-7b59c7b2624f",
      "name": "OpenAI extraction with JSON Schema",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -192,
        192
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "9934ff53-b1df-4a6d-af05-8c5cdf66cdd4",
      "name": "Analyze Product1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        256,
        336
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.8
    },
    {
      "id": "73772c53-591a-4077-ae95-a9de6c11a292",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        480,
        400
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b43d3e4c-18ef-4ab1-ae56-ae7d86407b7d",
      "name": "Upload Video to FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2640,
        -48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "14bc464d-fbe0-40f6-93d0-db5cc93d2dea",
      "name": "Create Video Creative",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3088,
        -48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "6347fd71-1c54-45ca-aca1-9808e83957c6",
      "name": "Is it a Video?",
      "type": "n8n-nodes-base.if",
      "onError": "continueRegularOutput",
      "position": [
        2416,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "12701458-ef9c-49ab-9693-58e5bc5deb64",
      "name": "Upload Image to FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2640,
        144
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "dbb427ce-086c-49e9-af06-3fe6945a5548",
      "name": "Create Image Creative",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3088,
        144
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "b448342b-c28e-4f08-9b7f-c94db3819007",
      "name": "Merge Creatives",
      "type": "n8n-nodes-base.merge",
      "position": [
        3536,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "903c7389-6ccf-40a2-a00a-f07332c461d0",
      "name": "Create Campaign",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3984,
        128
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "07b32a52-221e-46c1-96c2-c98d290e23a2",
      "name": "Run Once",
      "type": "n8n-nodes-base.function",
      "position": [
        3760,
        128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "85eb6948-f9bf-462e-9eab-771e3388a896",
      "name": "Create Ad Set",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4208,
        128
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "13831042-6416-47cb-943d-1e8277772842",
      "name": "Create Ad",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4880,
        48
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "8c4e43cc-51d0-4cd8-a119-671c83bdcd72",
      "name": "Set Video ID",
      "type": "n8n-nodes-base.set",
      "position": [
        2864,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "90fd180b-c721-45c6-aa7a-04699324406f",
      "name": "Set Image Hash",
      "type": "n8n-nodes-base.set",
      "position": [
        2864,
        144
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "b163005b-df59-454b-9bca-468ffaee37f8",
      "name": "Set Image Packet",
      "type": "n8n-nodes-base.set",
      "position": [
        3312,
        144
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "cc88d7b9-a422-45f7-bc56-ae22fa5d49e9",
      "name": "Set Video Packet",
      "type": "n8n-nodes-base.set",
      "position": [
        3312,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ccbf6a4d-d8b3-4e22-8cfb-c2ffd99633a2",
      "name": "Save Adset Id",
      "type": "n8n-nodes-base.set",
      "position": [
        4432,
        128
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "006ac537-2bfe-449a-838d-2fa5d0d2b9f2",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        4656,
        48
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "ebb8027e-8121-4b6c-a355-c1de7dc2e3f4",
      "name": "Configuration Meta Ads",
      "type": "n8n-nodes-base.set",
      "position": [
        2192,
        48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "92aab71c-b361-4afd-b7c5-d46d46a8b196",
      "name": "GPT-4 Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1136,
        624
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "487deec6-6e2f-4b9d-bfc4-061e62cdcbf9",
      "name": "Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1136,
        416
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "3e904ef5-1f95-49a3-b3e4-48fa426bbd2d",
      "name": "Generate Ad Camp",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1056,
        192
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "4fc5d55c-45fc-4521-9f57-e7e5ba977e9d",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        2832,
        400
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "f8308103-624c-47f2-94d0-8fbc9d222189",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1e46640c-a9e9-479c-b0e2-6e480a4ccd5f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        784
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1140b891-81dd-4e51-b2b7-00b8843e87be",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d5ae1462-dd0e-4fbd-9dac-edbacfa8ba8a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1984,
        656
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "31de7168-a3f9-4036-b28a-9c9d32c3fc0b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        -352
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Open AI Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch": {
      "main": [
        [
          {
            "node": "Configuration Meta Ads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split": {
      "main": [
        [
          {
            "node": "Platform Adapter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Creative Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Create Ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Once": {
      "main": [
        [
          {
            "node": "Create Campaign",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Ad": {
      "main": [
        []
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Batch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Ad Camp",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Output Parser1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Video ID": {
      "main": [
        [
          {
            "node": "Create Video Creative",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Ad Set": {
      "main": [
        [
          {
            "node": "Save Adset Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Adset Id": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Creative Brief": {
      "main": [
        [
          {
            "node": "Generate Ad Camp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is it a Video?": {
      "main": [
        [
          {
            "node": "Upload Video to FB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload Image to FB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Ad Camp",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Set Image Hash": {
      "main": [
        [
          {
            "node": "Create Image Creative",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Campaign": {
      "main": [
        [
          {
            "node": "Create Ad Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Creatives": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Run Once",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Product1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Ad Camp": {
      "main": [
        [
          {
            "node": "Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Platform Adapter": {
      "main": [
        [
          {
            "node": "Batch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image Packet": {
      "main": [
        [
          {
            "node": "Merge Creatives",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Video Packet": {
      "main": [
        [
          {
            "node": "Merge Creatives",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "B64 String to File": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Structured Output Parser1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image to FB": {
      "main": [
        [
          {
            "node": "Set Image Hash",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to FB": {
      "main": [
        [
          {
            "node": "Set Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Ad Form Submission": {
      "main": [
        [
          {
            "node": "Scrape a url and get its content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Image Creative": {
      "main": [
        [
          {
            "node": "Set Image Packet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video Creative": {
      "main": [
        [
          {
            "node": "Set Video Packet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration Meta Ads": {
      "main": [
        [
          {
            "node": "Is it a Video?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Open AI Generate Image": {
      "main": [
        [
          {
            "node": "B64 String to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Scrape a url and get its content": {
      "main": [
        [
          {
            "node": "OpenAI extraction with JSON Schema",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI extraction with JSON Schema": {
      "main": [
        [
          {
            "node": "Analyze Product1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

Turn any product page into ready-to-run Meta ads—fast, consistent, and client-friendly.

Source: https://n8n.io/workflows/8681/ — 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

🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.

OpenAI, HTTP Request, Form Trigger +7
AI & RAG

The best content automation template in the market is now even better—with “deep research” on time-sensitive topics\! Unlike most n8n content automation templates that are mainly for “demo purposes,”

OpenAI, HTTP Request, XML +11
AI & RAG

PixelSensei(ZH). Uses agent, outputParserStructured, formTrigger, lmChatOpenAi. Event-driven trigger; 55 nodes.

Agent, Output Parser Structured, Form Trigger +4
AI & RAG

🧠 Automate end-to-end SEO blog creation and WordPress publishing using a GPT-5 multi-agent workflow with real-time research, metadata generation, and optional featured images.

Output Parser Structured, HTTP Request, OpenAI +10
AI & RAG

This is an automated blog post generation system that: Researches topics using AI agents and web search tools Writes complete blog posts with proper SEO structure Generates custom images for each post

Output Parser Structured, Google Gemini Chat, HTTP Request Tool +11