{
  "name": "Generate Google Maps leads with AI enrichment, social discovery and Google Sheets",
  "nodes": [
    {
      "id": "a498ba50-4265-4fe0-8bba-c4ed4d53e57d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        2576
      ],
      "parameters": {
        "width": 704,
        "height": 512,
        "content": "## AI Lead Generation & Social Discovery Automation\n\nInstead of spending hours researching businesses manually, this workflow \ndoes it all automatically. Give it a search query and it finds businesses"
      }
    },
    {
      "id": "a24df743-e934-498b-b057-38725f0f20c6",
      "name": "Start Lead Generation",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        3968,
        3696
      ]
    },
    {
      "id": "902a7fb0-320c-4aec-934a-e20113c61d75",
      "name": "Split Search Queries",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4192,
        3696
      ]
    },
    {
      "id": "18d7d04b-aa4a-40b4-984a-0f7db85401da",
      "name": "Process Each Query",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4416,
        3696
      ]
    },
    {
      "id": "6ff40d64-ca53-4db6-8f50-e96fca8b6689",
      "name": "Rate Limit Protection",
      "type": "n8n-nodes-base.wait",
      "position": [
        4640,
        3744
      ]
    },
    {
      "id": "11340894-ebf8-4ba8-92f2-396cc0645d5c",
      "name": "Fetch Maps Results (Page 1)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4640,
        3552
      ]
    },
    {
      "id": "c6b2ac66-8f27-49cf-9a30-5662cd74fd59",
      "name": "Fetch Maps Results (Pages 2–12)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5088,
        3552
      ]
    },
    {
      "id": "064b2527-ef68-4e60-a2dd-1cc4a71394a4",
      "name": "Extract Businesses From Maps",
      "type": "n8n-nodes-base.code",
      "position": [
        5312,
        3552
      ]
    },
    {
      "id": "7f5f717e-ab1a-4f06-92f2-aac13ca72e33",
      "name": "Process Businesses in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        5536,
        3552
      ]
    },
    {
      "id": "c57c2dd2-b415-4088-9eb8-07b25d10736b",
      "name": "Scrape Business Website",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5760,
        3504
      ]
    },
    {
      "id": "c1a67e75-d5e1-4e86-944b-6dc0e24647cb",
      "name": "Extract Socials & Email",
      "type": "n8n-nodes-base.code",
      "position": [
        5984,
        3504
      ]
    },
    {
      "id": "5bffb9ef-99c4-4adf-a72f-6f788ffa7345",
      "name": "Build Social Search Query",
      "type": "n8n-nodes-base.code",
      "position": [
        6208,
        3568
      ]
    },
    {
      "id": "e126ee9c-24fe-430b-80f8-b9d747caf613",
      "name": "Search Social Profiles (Serper)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6432,
        3568
      ]
    },
    {
      "id": "3bee6f31-5e02-4b3d-b2b9-8c87598e46f1",
      "name": "Combine Website + Serper Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        6880,
        3504
      ]
    },
    {
      "id": "92f1e3c5-374d-413a-a25f-72344f013438",
      "name": "Resolve & Score Social Profiles",
      "type": "n8n-nodes-base.code",
      "position": [
        7104,
        3504
      ]
    },
    {
      "id": "0e5af8e1-4520-42a6-918b-56496fc45042",
      "name": "Normalize Social Data",
      "type": "n8n-nodes-base.code",
      "position": [
        7328,
        3616
      ]
    },
    {
      "id": "f027a103-359c-411d-98cc-d95c40a340c2",
      "name": "Check Email Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        5760,
        3184
      ]
    },
    {
      "id": "33f27175-50c5-4de4-bae2-105d959137e1",
      "name": "Validate Email Address",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5984,
        3088
      ]
    },
    {
      "id": "44f062c2-40c2-41fb-aea9-70d67deca377",
      "name": "Prepare Valid Leads",
      "type": "n8n-nodes-base.code",
      "position": [
        6208,
        3088
      ]
    },
    {
      "id": "13adae03-f43a-46dc-a1f9-acf459a9c83a",
      "name": "Prepare Leads Without Email",
      "type": "n8n-nodes-base.code",
      "position": [
        6208,
        3280
      ]
    },
    {
      "id": "c35b21a1-368a-4995-83c4-6b053dfcae17",
      "name": "Merge Lead Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        6432,
        3184
      ]
    },
    {
      "id": "0aca8824-eb80-4016-921b-1b4cc182a514",
      "name": "Clean Lead Data",
      "type": "n8n-nodes-base.code",
      "position": [
        6656,
        3184
      ]
    },
    {
      "id": "8dfe38e9-e49b-47aa-9458-977624a42c66",
      "name": "Remove Duplicate Leads",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        7104,
        3184
      ]
    },
    {
      "id": "8d64b028-d665-47aa-8c81-e6875057c7f8",
      "name": "Process Leads for AI Enrichment",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        7328,
        3184
      ]
    },
    {
      "id": "eca95d2d-b2f1-4db3-9fc5-da4d3ab419cd",
      "name": "AI Rate Limit Buffer",
      "type": "n8n-nodes-base.wait",
      "position": [
        7552,
        3280
      ]
    },
    {
      "id": "285efe24-63a7-4171-bcae-c56cd996e076",
      "name": "Analyze Business (AI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7776,
        3360
      ]
    },
    {
      "id": "0f9d44a1-c641-407f-927d-07a38d44dd95",
      "name": "Extract AI Insights",
      "type": "n8n-nodes-base.code",
      "position": [
        7552,
        3088
      ]
    },
    {
      "id": "7b60da04-555b-4a0a-a4c3-d403cb2790e7",
      "name": "AI Processing Buffer",
      "type": "n8n-nodes-base.wait",
      "position": [
        7776,
        3088
      ]
    },
    {
      "id": "f8a55c25-8130-4be0-9bb7-1e1e96b3e9d5",
      "name": "Message Rate Limit Buffer",
      "type": "n8n-nodes-base.wait",
      "position": [
        8224,
        3184
      ]
    },
    {
      "id": "3f824c01-673c-42c8-86b8-c23b7cdd6f27",
      "name": "Process Outreach Message",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        8000,
        3088
      ]
    },
    {
      "id": "b75c29df-2a74-4ab1-8486-4525dd809616",
      "name": "Create Outreach Message",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8448,
        3264
      ]
    },
    {
      "id": "03ddeb4d-9d21-401e-8978-e0371e66bd35",
      "name": "Clean Outreach Message",
      "type": "n8n-nodes-base.code",
      "position": [
        8224,
        2992
      ]
    },
    {
      "id": "891b1d6d-3178-41c9-99b0-9d29f35f70ce",
      "name": "Calculate Lead Score",
      "type": "n8n-nodes-base.code",
      "position": [
        6880,
        3184
      ]
    },
    {
      "id": "5f656814-7906-4382-9b85-6fe8b49121d8",
      "name": "Save Leads to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        8448,
        2992
      ]
    },
    {
      "id": "86d72dd9-c732-49fd-9c2c-05b4eb0f9673",
      "name": "Parse Social Results",
      "type": "n8n-nodes-base.code",
      "position": [
        6656,
        3568
      ]
    },
    {
      "id": "cd98522f-0ff0-4960-aa54-7a7bbc773f2b",
      "name": "Delay Between Requests",
      "type": "n8n-nodes-base.wait",
      "position": [
        4864,
        3552
      ]
    },
    {
      "id": "46cefa60-90ba-4903-b747-13093cc56cbf",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4784,
        3328
      ],
      "parameters": {
        "width": 256,
        "height": null,
        "content": "## Maps section:\nSearches Google Maps using your queries and pulls business name, \nwebsite, phone number, rating and category for each result.\n"
      }
    },
    {
      "id": "cb596e41-46da-4a1a-a808-63bb875537ba",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5728,
        3840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "## Scraping section:\nVisits each business website and looks for emails and social media \nlinks. Handles broken pages and redirects automatically."
      }
    },
    {
      "id": "e2535f29-7adf-4642-b594-151ec0301eda",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6896,
        3840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "## Social section:\nIf social profiles are not found on the website, it runs a \nseparate search to find Instagram, Facebook, LinkedIn, Twitter, \nTikTok and YouTube with a confidence score for each."
      }
    },
    {
      "id": "87c135e6-22c9-496b-8272-1ce9e1426df2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5968,
        2864
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "## Email validation section:\nChecks every email found and removes ones that are invalid \nor likely to bounce before saving to your sheet."
      }
    },
    {
      "id": "af6033e0-05c6-42e2-861c-42cf014a40a6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8624,
        3376
      ],
      "parameters": {
        "width": 304,
        "height": 176,
        "content": "## AI section:\nSends each business to an AI model which reads the data and \nwrites a short summary, lists their services, and creates a \npersonalized outreach message based on what the business actual"
      }
    },
    {
      "id": "48cb72c9-c11b-485f-a93b-81f8d1f7b47d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8240,
        2752
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "## Export section:\nScores each lead from 0 to 10 based on their digital presence, \nremoves duplicates, and saves everything clean to Google Sheets \nready for outreach."
      }
    },
    {
      "id": "d4891001-b869-4e93-bf9a-56a58a0b4ed3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7808,
        3600
      ],
      "parameters": {
        "width": 560,
        "height": 432,
        "content": "## Ollama Setup\n\nIf you are using Ollama as your AI model, replace the endpoint URL \nin the AI nodes with your own based on your setup:\n\nMac (Docker): http://docker.for.mac.host.internal:11434/api/gen"
      }
    }
  ],
  "connections": {
    "Clean Lead Data": {
      "main": [
        [
          {
            "node": "Calculate Lead Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Email Exists": {
      "main": [
        [
          {
            "node": "Validate Email Address",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Leads Without Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Lead Results": {
      "main": [
        [
          {
            "node": "Clean Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Query": {
      "main": [
        [
          {
            "node": "Fetch Maps Results (Page 1)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Rate Limit Protection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract AI Insights": {
      "main": [
        [
          {
            "node": "AI Processing Buffer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Valid Leads": {
      "main": [
        [
          {
            "node": "Merge Lead Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Processing Buffer": {
      "main": [
        [
          {
            "node": "Process Outreach Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Rate Limit Buffer": {
      "main": [
        [
          {
            "node": "Analyze Business (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Lead Score": {
      "main": [
        [
          {
            "node": "Remove Duplicate Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Social Results": {
      "main": [
        [
          {
            "node": "Combine Website + Serper Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Search Queries": {
      "main": [
        [
          {
            "node": "Process Each Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Business (AI)": {
      "main": [
        [
          {
            "node": "Process Leads for AI Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Social Data": {
      "main": [
        [
          {
            "node": "Process Businesses in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Protection": {
      "main": [
        [
          {
            "node": "Process Each Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Lead Generation": {
      "main": [
        [
          {
            "node": "Split Search Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Outreach Message": {
      "main": [
        [
          {
            "node": "Save Leads to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delay Between Requests": {
      "main": [
        [
          {
            "node": "Fetch Maps Results (Pages 2–12)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate Leads": {
      "main": [
        [
          {
            "node": "Process Leads for AI Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Email Address": {
      "main": [
        [
          {
            "node": "Prepare Valid Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Outreach Message": {
      "main": [
        [
          {
            "node": "Process Outreach Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Socials & Email": {
      "main": [
        [
          {
            "node": "Combine Website + Serper Results",
            "type": "main",
            "index": 0
          },
          {
            "node": "Build Social Search Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Business Website": {
      "main": [
        [
          {
            "node": "Extract Socials & Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Outreach Message": {
      "main": [
        [
          {
            "node": "Clean Outreach Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Message Rate Limit Buffer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Social Search Query": {
      "main": [
        [
          {
            "node": "Search Social Profiles (Serper)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Rate Limit Buffer": {
      "main": [
        [
          {
            "node": "Create Outreach Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Maps Results (Page 1)": {
      "main": [
        [
          {
            "node": "Delay Between Requests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Leads Without Email": {
      "main": [
        [
          {
            "node": "Merge Lead Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Businesses From Maps": {
      "main": [
        [
          {
            "node": "Process Businesses in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Businesses in Batches": {
      "main": [
        [
          {
            "node": "Check Email Exists",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Scrape Business Website",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Leads for AI Enrichment": {
      "main": [
        [
          {
            "node": "Extract AI Insights",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Rate Limit Buffer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resolve & Score Social Profiles": {
      "main": [
        [
          {
            "node": "Normalize Social Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Social Profiles (Serper)": {
      "main": [
        [
          {
            "node": "Parse Social Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Website + Serper Results": {
      "main": [
        [
          {
            "node": "Resolve & Score Social Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Maps Results (Pages 2–12)": {
      "main": [
        [
          {
            "node": "Extract Businesses From Maps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}