{
  "name": "Analyze competitor Facebook ads with AI (GPT-4 & Gemini) & email reports",
  "nodes": [
    {
      "id": "284c0970-9c29-43f2-bd45-dc76aef8b878",
      "name": "Scrape ads",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -520,
        1600
      ]
    },
    {
      "id": "5a26c1ee-39be-4945-9b55-8ce58e511f10",
      "name": "Merge Media Result",
      "type": "n8n-nodes-base.merge",
      "position": [
        800,
        1620
      ]
    },
    {
      "id": "db54ffff-9cf0-4be5-9878-53a94de3eefc",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        860,
        2140
      ]
    },
    {
      "id": "2e34008c-7747-4319-99a2-9c1fec5b550d",
      "name": "Auto-fixing Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1020,
        1980
      ]
    },
    {
      "id": "def3f940-0bb3-45f8-972b-20f1a42796b4",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1120,
        2140
      ]
    },
    {
      "id": "dfe34ace-d0ce-4c38-99c0-b21bc461dc35",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1020,
        1620
      ]
    },
    {
      "id": "6a633e25-6e39-4635-a1b6-c4ffcc6e7c5a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        800,
        1820
      ]
    },
    {
      "id": "7e747366-0aeb-4ae4-9bae-f3cb1a5ebac5",
      "name": "Email the top job recommendations",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1660,
        1820
      ]
    },
    {
      "id": "5609c7c3-40cb-4901-bc57-11674ea7dccb",
      "name": "Select Image Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        460,
        1440
      ]
    },
    {
      "id": "8823029c-e4a5-419a-8dbe-7bf2d5b9c9cb",
      "name": "Split Image Ads & Video Ads",
      "type": "n8n-nodes-base.switch",
      "position": [
        -300,
        1600
      ]
    },
    {
      "id": "d3eccca1-e388-4801-838a-7ca6ba0cf860",
      "name": "Select Video Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        2360
      ]
    },
    {
      "id": "85daf48d-8600-4a76-8743-c792d6bcec92",
      "name": "Download video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        40,
        2160
      ]
    },
    {
      "id": "310162af-350d-4331-8792-ae4d051bb141",
      "name": "Upload video Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        2160
      ]
    },
    {
      "id": "d4b8f151-1348-48d7-9f44-c6c38e84ffa2",
      "name": "Analyze video Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        2360
      ]
    },
    {
      "id": "bb529f0b-045c-4bec-b9f7-2b9e80e0a6cf",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        40,
        2360
      ]
    },
    {
      "id": "687f49c8-7207-4d3d-bcdd-bc04f4f98cae",
      "name": "Analyze Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        40,
        1440
      ]
    },
    {
      "id": "38243724-cd80-49cd-a246-72f68723ec7c",
      "name": "Combine all Ads information into a single text string",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        1620
      ]
    },
    {
      "id": "55ebf877-d6df-4479-bdbf-8c59386f4aaa",
      "name": "Image duplicate key",
      "type": "n8n-nodes-base.set",
      "position": [
        40,
        1240
      ]
    },
    {
      "id": "a0b081dd-8b88-468f-b3c5-fb5a46476839",
      "name": "Image Duplicate Key",
      "type": "n8n-nodes-base.set",
      "position": [
        40,
        1940
      ]
    },
    {
      "id": "f80191b8-45f9-4949-8779-14815de6ed0c",
      "name": "Image Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        240,
        1240
      ]
    },
    {
      "id": "67d1dab8-9d8c-410e-985b-b9138c4db165",
      "name": "Video Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        260,
        1940
      ]
    },
    {
      "id": "e6e78040-8197-4520-988c-77dd5061c29c",
      "name": "Image Limit 5",
      "type": "n8n-nodes-base.limit",
      "position": [
        460,
        1240
      ]
    },
    {
      "id": "6b75b522-e4c6-420b-ad14-198a5917a8f1",
      "name": "Video Limit 5",
      "type": "n8n-nodes-base.limit",
      "position": [
        480,
        1940
      ]
    },
    {
      "id": "5cc72130-31cf-4ca4-875b-62ccc276ca09",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -860,
        1600
      ]
    },
    {
      "id": "82e0ad0c-f768-4034-bde6-0ec7e7fe0392",
      "name": "Introduction Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8a9daffb-8bd0-4e85-a0e5-9ef15fa57108",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        1360
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "fe330620-4cbf-461d-a998-c221c2b05403",
      "name": "Data Collection Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        1360
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "dd192f4e-e972-4db1-babe-db900fc29438",
      "name": "Image Analysis Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        960
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "47a1e7ef-7e02-44d6-bf12-98203b54d8c8",
      "name": "Video Analysis Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        1640
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "46173dd0-fc02-4064-a90d-791f44741f56",
      "name": "Analysis Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        1400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "1676be5e-15c5-456f-b0a4-bac9ea6ed65b",
      "name": "Report Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        1520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Analyze video Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Email the top job recommendations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Combine all Ads information into a single text string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape ads": {
      "main": [
        [
          {
            "node": "Split Image Ads & Video Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Select Image Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Limit 5": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Limit 5": {
      "main": [
        [
          {
            "node": "Download video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download video": {
      "main": [
        [
          {
            "node": "Upload video Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge Media Result": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Scrape ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Duplicate Key": {
      "main": [
        [
          {
            "node": "Video Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image duplicate key": {
      "main": [
        [
          {
            "node": "Image Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Image Fields": {
      "main": [
        [
          {
            "node": "Merge Media Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Video Fields": {
      "main": [
        [
          {
            "node": "Merge Media Result",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload video Gemini": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze video Gemini": {
      "main": [
        [
          {
            "node": "Select Video Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Remove Duplicates": {
      "main": [
        [
          {
            "node": "Image Limit 5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Remove Duplicates": {
      "main": [
        [
          {
            "node": "Video Limit 5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Split Image Ads & Video Ads": {
      "main": [
        [
          {
            "node": "Image duplicate key",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Image Duplicate Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine all Ads information into a single text string": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}