{
  "name": "Daily competitor research automation using SerpAPI, Google Sheets & Airtable",
  "nodes": [
    {
      "id": "1be5e364-b985-4ce4-bb52-5f4d4afc8481",
      "name": "🕒 Auto Run (Scheduled)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2040,
        0
      ]
    },
    {
      "id": "7e5d5597-0e13-477d-af55-2847cdd4b89c",
      "name": "📄 Read Companies Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1820,
        0
      ]
    },
    {
      "id": "0942f8f7-220c-48fc-bda0-43b250981475",
      "name": "🧹 Clean & Format Company List",
      "type": "n8n-nodes-base.code",
      "position": [
        -1600,
        0
      ]
    },
    {
      "id": "dd0127ef-28ef-4928-8cdc-6cf0627ac365",
      "name": "🔁 Loop Over Companies",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1380,
        0
      ]
    },
    {
      "id": "ee903349-6643-4c97-862c-bd50d2abcd8d",
      "name": "🌍 Search Company Competitors (SerpAPI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1160,
        0
      ]
    },
    {
      "id": "a5f9d7d7-a7b2-4325-bbe9-c2feb053f98a",
      "name": "🧠 Extract Competitor Data from Search",
      "type": "n8n-nodes-base.code",
      "position": [
        -940,
        0
      ]
    },
    {
      "id": "20193daa-c689-4311-ad39-9f696794712d",
      "name": "🧐 Has Competitors?",
      "type": "n8n-nodes-base.if",
      "position": [
        -720,
        0
      ]
    },
    {
      "id": "1f513736-3963-4045-9eaa-4df3cebfc0e3",
      "name": "📊 Log to Result Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -500,
        -100
      ]
    },
    {
      "id": "d39b91c7-a3c0-45eb-b926-2d668262a899",
      "name": "❌ Log Companies Without Results",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -500,
        100
      ]
    },
    {
      "id": "7910cb3e-88e7-4716-82ad-89bec10409a8",
      "name": "🗃️ Sync to Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -280,
        0
      ]
    },
    {
      "id": "b299cf8f-6b5e-48f2-adb4-2794ad4220aa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2140,
        -340
      ],
      "parameters": {
        "width": 280,
        "height": 640,
        "content": "## Auto Run (Scheduled)\n\n**Description:**\n\n⏰ This is the starting point of the workflow. It runs automatically based on your configured schedule—no manual trigger needed."
      }
    },
    {
      "id": "e21ba623-5589-4781-a131-31afbee80431",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -340
      ],
      "parameters": {
        "width": 600,
        "height": 640,
        "content": "## Loop Over Companies\n\n**Description:**\n\n📋 Fetch companies from a Google Sheet (List column).\n\n🧹 Clean and format data, removing empty entries and attaching row numbers.\n\n🔁 Send companies into the fl"
      }
    },
    {
      "id": "38ce6a00-5b57-47a2-9cce-e2deaa67e285",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -340
      ],
      "parameters": {
        "width": 220,
        "height": 640,
        "content": "## Search Company Competitors (SerpAPI)\n\n**Description:**\n\n🔍 For each company, this node sends a GET request to SerpAPI with the query {company} competitors, returning structured search result JSON fo"
      }
    },
    {
      "id": "78b206db-221d-426c-aa15-1115c2266cc8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        -340
      ],
      "parameters": {
        "width": 420,
        "height": 640,
        "content": "## Extract & Check Competitors\n\n**Description:**\n\nExtracts the company name, up to 10 competitors, and top source from SerpAPI results.\nThen checks if any competitors were found:\n\n✅ Yes → Send to Goog"
      }
    },
    {
      "id": "6ef49329-b2a7-44ad-9226-d2c61dc996e7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -340
      ],
      "parameters": {
        "width": 460,
        "height": 640,
        "content": "## Log Results to Sheets & Airtable\n\n**Description:**\n\nLogs successful competitor data to Google Sheets ✅\n\nLogs failed searches separately ❌\n\nBoth flows sync to Airtable for unified storage 📥"
      }
    }
  ],
  "connections": {
    "🧐 Has Competitors?": {
      "main": [
        [
          {
            "node": "📊 Log to Result Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "❌ Log Companies Without Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Log to Result Sheet": {
      "main": [
        [
          {
            "node": "🗃️ Sync to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔁 Loop Over Companies": {
      "main": [
        [],
        [
          {
            "node": "🌍 Search Company Competitors (SerpAPI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Read Companies Sheet": {
      "main": [
        [
          {
            "node": "🧹 Clean & Format Company List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🕒 Auto Run (Scheduled)": {
      "main": [
        [
          {
            "node": "📄 Read Companies Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧹 Clean & Format Company List": {
      "main": [
        [
          {
            "node": "🔁 Loop Over Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "❌ Log Companies Without Results": {
      "main": [
        [
          {
            "node": "🗃️ Sync to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧠 Extract Competitor Data from Search": {
      "main": [
        [
          {
            "node": "🧐 Has Competitors?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🌍 Search Company Competitors (SerpAPI)": {
      "main": [
        [
          {
            "node": "🧠 Extract Competitor Data from Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}