{
  "name": "Extract Google Ads creatives by domain with SerpAPI and export to CSV",
  "nodes": [
    {
      "id": "65aafe70-bcfb-4c28-96dd-17d9dd2f4203",
      "name": "Get Ads Page 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -380,
        580
      ]
    },
    {
      "id": "6158066c-e944-42cf-9a40-5c2c309a8567",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1260,
        580
      ]
    },
    {
      "id": "15dea6e9-0a6a-4ba1-ae36-7234f5f3ff13",
      "name": "Set Domain & Region",
      "type": "n8n-nodes-base.set",
      "position": [
        -820,
        580
      ]
    },
    {
      "id": "8b768e62-6697-491e-89d6-6fa40aa36619",
      "name": "Extract Ad Creatives",
      "type": "n8n-nodes-base.function",
      "position": [
        60,
        580
      ]
    },
    {
      "id": "50bcee68-570e-4b2f-bc14-3e5148f63ed6",
      "name": "Split by Format1",
      "type": "n8n-nodes-base.switch",
      "position": [
        500,
        560
      ]
    },
    {
      "id": "5a385bb4-a7eb-4327-8719-311ba61fe82a",
      "name": "Convert Text Ads to CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        220
      ]
    },
    {
      "id": "2860d7c8-8c45-4d13-964d-40d6565e7a18",
      "name": "Convert Image Ads to CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        680
      ]
    },
    {
      "id": "2240db0a-0cb3-4449-a187-6daa52bca0fd",
      "name": "Convert Video Ads to CSV1",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        1120
      ]
    },
    {
      "id": "bc86000d-ed7b-4690-a19e-3b9819024c8b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1380,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# Node Annotations\n\n✅ When clicking 'Test workflow'\nTrigger the workflow manually during testing or development.\n\n📌 Note:\nUsed for debugging or one-time executions. No configuration needed."
      }
    },
    {
      "id": "431fdfd5-9550-4eca-8489-26fb126e828e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# ✏️ Set Domain & Region\n\nDefine which domain and region you want to extract ads for.\n\n📌 Note:\n\nSet the domain (e.g., example.com)\n\nSet the region using the numeric SerpApi region code\n\n🔗 https://serp"
      }
    },
    {
      "id": "245857fd-4405-4f75-95d1-41d7374b770a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# 🌐 Get Ads Page 1\n\nCalls SerpApi to fetch Google Ads Transparency data based on the domain and region.\n\n📌 Note:\n\nUses the SerpApi google_ads_transparency_center engine\n\nRequires a SerpApi API Key\n\nMa"
      }
    },
    {
      "id": "59c2eab0-ce67-463b-aaea-bf5c69fcb15e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# 🧠 Extract Ad Creatives\n\nFilters only the ad creatives where target_domain exactly matches your input.\n\n📌 Note:\n\nThis avoids pulling unrelated advertiser ads\n\nMakes sure only relevant ads for your do"
      }
    },
    {
      "id": "e87811c5-2f2a-4bd4-828b-ec4333393839",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# 🔀 Split by Format\n\nSorts the ads by their format into separate branches: text, image, or video.\n\n📌 Note:\n\nBased on format field of each ad\n\nEnsures clean CSV outputs for each type"
      }
    },
    {
      "id": "f18950f7-9c67-4ffb-8c89-b2b70287db05",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        120
      ],
      "parameters": {
        "width": 500,
        "height": 300,
        "content": "# 📄 Convert Text Ads to CSV\n\nSaves text ads in a CSV file named: text_{domain}_ads.csv\n\n📌 Note:\n\nUse this for text-only creatives\n\nFile will be saved in your /files/ directory"
      }
    },
    {
      "id": "25d6d14b-e4c7-40e4-97be-b422871cc756",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        580
      ],
      "parameters": {
        "width": 500,
        "height": 300,
        "content": "# 🖼️ Convert Image Ads to CSV\nSaves image-based ads to: image_{domain}_ads.csv\n\n📌 Note:\n\nContains ad dimensions and image URLs\n\n"
      }
    },
    {
      "id": "7d05ce27-42ee-4799-807a-eeb204b05553",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        1040
      ],
      "parameters": {
        "width": 500,
        "height": 300,
        "content": "# 🎞️ Convert Video Ads to CSV\nExports video ads into: video_{domain}_ads.csv\n\n📌 Note:\n\nContains video links (HTML preview links or embedded content)"
      }
    }
  ],
  "connections": {
    "Get Ads Page 1": {
      "main": [
        [
          {
            "node": "Extract Ad Creatives",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split by Format1": {
      "main": [
        [
          {
            "node": "Convert Text Ads to CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Image Ads to CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Video Ads to CSV1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Domain & Region": {
      "main": [
        [
          {
            "node": "Get Ads Page 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Ad Creatives": {
      "main": [
        [
          {
            "node": "Split by Format1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set Domain & Region",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}