{
  "name": "Automated B2B lead generation: Google Places, Scrape.do & AI enrichment",
  "nodes": [
    {
      "id": "1a608370-405e-4601-b65d-7a336fa0ae82",
      "name": "Generate Report",
      "type": "n8n-nodes-base.function",
      "position": [
        -16,
        320
      ]
    },
    {
      "id": "07cff94f-48fb-4667-abf9-3e7c929508a5",
      "name": "Error Logging",
      "type": "n8n-nodes-base.function",
      "position": [
        -48,
        512
      ]
    },
    {
      "id": "af642ea6-17a4-4fd2-a6e7-b26f9bdff825",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        128
      ]
    },
    {
      "id": "3ecdbef5-6df9-4f62-a9f9-44fa94ad32bc",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1152,
        128
      ]
    },
    {
      "id": "944898a5-6bed-408a-ac9b-b62101132f51",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1024,
        -64
      ]
    },
    {
      "id": "2f801af9-c230-4910-97db-8adf7a8ac650",
      "name": "1. Set Search Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -800,
        -64
      ]
    },
    {
      "id": "3a046790-67dd-4db5-9254-25e2c5b30027",
      "name": "2. Find Businesses (Google Places)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        -64
      ]
    },
    {
      "id": "93842018-1c3a-465c-b7a9-d90af939323e",
      "name": "3. Parse & Score Leads",
      "type": "n8n-nodes-base.function",
      "position": [
        -400,
        -64
      ]
    },
    {
      "id": "f946456d-53fa-4b03-8521-406b2b6b14ca",
      "name": "4. Filter High-Quality Leads",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -64
      ]
    },
    {
      "id": "1121701f-c2f7-43d1-af89-1a75b9159ce5",
      "name": "5. Loop Through Each Lead",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        64,
        -96
      ]
    },
    {
      "id": "58958e08-90c8-4f7d-8922-21dd84b80406",
      "name": "6a. Scrape Website with Scrape.do",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        -80
      ]
    },
    {
      "id": "d4a3c983-fa0c-4afc-86ba-d47543202e1a",
      "name": "6b. Check if Scrape Was Successful",
      "type": "n8n-nodes-base.if",
      "position": [
        528,
        -80
      ]
    },
    {
      "id": "012b5b66-460f-4efb-a960-7df911ce05cc",
      "name": "6c. Extract Footer from HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        784,
        -80
      ]
    },
    {
      "id": "b28b0efc-e480-4629-9b39-e649c23b2531",
      "name": "6d. Extract Contact Info with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        -80
      ]
    },
    {
      "id": "3cc6fa78-f210-49e8-a49a-b5735ef7c262",
      "name": "7. Save Enriched Lead to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1616,
        128
      ]
    },
    {
      "id": "7981793a-4b97-4f32-91eb-52fafc237aa5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -208
      ],
      "parameters": {
        "width": 560,
        "height": 576,
        "content": "# Lead Generation Bot: Google Places & AI Enrichment\n\n**Purpose:** This workflow finds businesses on Google Maps, scores them as potential leads, scrapes their websites to find contact details (email,"
      }
    },
    {
      "id": "54e30c62-7eee-496e-9bb4-3f90bbda77d0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -400
      ],
      "parameters": {
        "width": 512,
        "height": 288,
        "content": "### 1. Find, Parse & Score Leads\n\n**Purpose:** This section queries the Google Places API for businesses matching your criteria, formats the data, and calculates a `leadScore` for each one based on th"
      }
    },
    {
      "id": "57a2105c-67c2-4f4d-a7ec-7f29bac341e2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -448
      ],
      "parameters": {
        "width": 656,
        "height": 304,
        "content": "### 2. Data Enrichment Loop\n\n**Purpose:** This is the core enrichment part. The workflow iterates through each high-quality lead one by one.\n\n*   **6a. Scrape Website HTML:** It visits the business's "
      }
    },
    {
      "id": "4ef856f2-b46d-4243-a001-4f0c4ab32019",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        48
      ],
      "parameters": {
        "width": 464,
        "height": 240,
        "content": "### 3. Save to Google Sheets\n\n**Purpose:** Appends the final, enriched lead data to your specified Google Sheet.\n\n*   **Action:** If the AI successfully extracts contact info, it's combined with the i"
      }
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "6d. Extract Contact Info with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "3. Parse & Score Leads": {
      "main": [
        [
          {
            "node": "4. Filter High-Quality Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Set Search Parameters": {
      "main": [
        [
          {
            "node": "2. Find Businesses (Google Places)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "6d. Extract Contact Info with AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "5. Loop Through Each Lead": {
      "main": [
        [],
        [
          {
            "node": "6a. Scrape Website with Scrape.do",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. Filter High-Quality Leads": {
      "main": [
        [
          {
            "node": "5. Loop Through Each Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Report",
            "type": "main",
            "index": 0
          },
          {
            "node": "Error Logging",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6c. Extract Footer from HTML": {
      "main": [
        [
          {
            "node": "6d. Extract Contact Info with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6d. Extract Contact Info with AI": {
      "main": [
        [
          {
            "node": "7. Save Enriched Lead to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6a. Scrape Website with Scrape.do": {
      "main": [
        [
          {
            "node": "6b. Check if Scrape Was Successful",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Find Businesses (Google Places)": {
      "main": [
        [
          {
            "node": "3. Parse & Score Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6b. Check if Scrape Was Successful": {
      "main": [
        [
          {
            "node": "6c. Extract Footer from HTML",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "1. Set Search Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7. Save Enriched Lead to Google Sheets": {
      "main": [
        [
          {
            "node": "5. Loop Through Each Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}