{
  "name": "Scrape business leads from Google Maps using OpenAI and Google Sheets",
  "nodes": [
    {
      "id": "c5d63d91-ffcc-4c05-a1ee-d78ca955fc85",
      "name": "Trigger - When User Sends Message",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -400,
        -60
      ]
    },
    {
      "id": "e422761f-a662-4fef-81fe-de42cdb350fc",
      "name": "AI Agent - Lead Collection",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -160,
        -60
      ]
    },
    {
      "id": "8469f6f8-e56e-433f-8439-ac0f568b01b1",
      "name": "GPT-4o - Generate & Process Requests",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -360,
        160
      ]
    },
    {
      "id": "8f89996c-f5d1-48e3-8023-9c5d4c8db12a",
      "name": "Memory - Track Recent Context",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -180,
        160
      ]
    },
    {
      "id": "ef32b577-47a2-489f-8b5a-3640126a0ff9",
      "name": "Tool - Scrape Google Maps Business Data",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        160,
        160
      ]
    },
    {
      "id": "86a6eafe-9ffc-4d58-85f7-eef7171eeb8e",
      "name": "Fallback - Enrich with Google Search",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        -20,
        160
      ]
    },
    {
      "id": "37409653-0409-4f2d-8105-9216f974f6a8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        -200
      ],
      "parameters": {
        "width": 1300,
        "height": 540,
        "content": "# AI-Powered Lead Generation Workflow\n\nThis workflow extracts business data from Google Maps and associated websites using an AI agent.\n\n## Dependencies\n- **OpenAI API**\n- **Google Sheets API**\n- **Ap"
      }
    },
    {
      "id": "0b42dfae-49e6-4117-8a5d-d1f396f22dcb",
      "name": "Tool - Crawl Business Website",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        340,
        160
      ]
    },
    {
      "id": "8a713b20-99e6-4df1-88ce-698ffc3c1e31",
      "name": "Trigger - On Subworkflow Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -460,
        520
      ]
    },
    {
      "id": "59af012d-de3f-4a44-b3ad-e587857b554d",
      "name": "Scrape Google Maps (via Apify)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -240,
        520
      ]
    },
    {
      "id": "b1c40871-aa57-4b15-9f19-34a07dc6c45f",
      "name": "Save Extracted Data to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -20,
        520
      ]
    },
    {
      "id": "679f2af5-0024-4a71-8c04-dcbccc8f00c8",
      "name": "Aggregate Business Listings",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        200,
        520
      ]
    },
    {
      "id": "dff1191a-b9f4-4ba6-ba42-a479fab76a5b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        380
      ],
      "parameters": {
        "width": 1300,
        "height": 440,
        "content": "# 📍 Google Maps Extractor Subworkflow\n\nThis subworkflow handles business data extraction from Google Maps using the Apify Google Maps Scraper.\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Purpose\n- Automates the collection of bus"
      }
    },
    {
      "id": "dd691f9c-15e2-4b4a-a6eb-8765905a2cb4",
      "name": "Scrape Website Content (via Apify)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        1000
      ]
    },
    {
      "id": "7cc813a7-e1a5-40fe-a76a-3e52438cf2f4",
      "name": "Save Website Data to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -100,
        1000
      ]
    },
    {
      "id": "6c20b427-48e8-4ba1-885e-7db71406a0db",
      "name": "Aggregate Website Content",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        120,
        1000
      ]
    },
    {
      "id": "7b1ff556-f212-4ab5-9995-deeb83f68da4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        860
      ],
      "parameters": {
        "width": 1300,
        "height": 400,
        "content": "# 🌐 Website Content Crawler Subworkflow\n\nThis subworkflow processes URLs to extract readable website content using Apify's Website Content Crawler.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Purpose\n- Extracts detailed and str"
      }
    }
  ],
  "connections": {
    "Memory - Track Recent Context": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Tool - Crawl Business Website": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Google Maps (via Apify)": {
      "main": [
        [
          {
            "node": "Save Extracted Data to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger - On Subworkflow Start": {
      "main": [
        [
          {
            "node": "Scrape Google Maps (via Apify)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger - When User Sends Message": {
      "main": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Website Data to Google Sheets": {
      "main": [
        [
          {
            "node": "Aggregate Website Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Website Content (via Apify)": {
      "main": [
        [
          {
            "node": "Save Website Data to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fallback - Enrich with Google Search": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4o - Generate & Process Requests": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save Extracted Data to Google Sheets": {
      "main": [
        [
          {
            "node": "Aggregate Business Listings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tool - Scrape Google Maps Business Data": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Lead Collection",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}