{
  "name": "Google Maps business scraper with contact extraction via Apify and Firecrawl",
  "nodes": [
    {
      "id": "17ab0386-4f7f-4f72-ab28-399febe4bf84",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -125
      ]
    },
    {
      "id": "2e7080b6-a5a4-4571-933f-3a33979037e8",
      "name": "Loop Until Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        1100,
        -125
      ]
    },
    {
      "id": "3e062954-93b9-48d7-b5dc-29ff579793af",
      "name": "Read Pending Queries",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        -125
      ]
    },
    {
      "id": "63d7b375-c4a6-42ae-b9ef-51f963edaa72",
      "name": "Start Apify Scraping Job",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        -125
      ]
    },
    {
      "id": "958eb9fc-14f5-41f1-9055-10e0f889c039",
      "name": "Wait for Job Succeed",
      "type": "n8n-nodes-base.wait",
      "position": [
        660,
        -125
      ]
    },
    {
      "id": "32fa03e3-a5ac-4ae3-b03a-2d99cb5d3079",
      "name": "Check Scraping Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        -200
      ]
    },
    {
      "id": "97c84abb-c21e-497c-a2eb-1bf4b01db0ca",
      "name": "Fetch Scraped Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1320,
        -125
      ]
    },
    {
      "id": "383d8508-54ba-4fbf-9d4b-f13487d1ff25",
      "name": "Save Business Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1540,
        -125
      ]
    },
    {
      "id": "cd083a40-2270-44e2-8683-ae3b4d5b85a8",
      "name": "Filter Businesses with Websites",
      "type": "n8n-nodes-base.filter",
      "position": [
        1760,
        -125
      ]
    },
    {
      "id": "234a63b0-3741-43d2-8a8b-ac29d6137ddb",
      "name": "Batch Processing Logic",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1980,
        -125
      ]
    },
    {
      "id": "63e8e91a-6012-4073-b03d-2158672288ee",
      "name": "Scrape Website Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2260,
        -220
      ]
    },
    {
      "id": "d9c1b4dc-c741-4dff-a9cd-0dd6527d514a",
      "name": "Extract Contact Information",
      "type": "n8n-nodes-base.code",
      "position": [
        2480,
        -220
      ]
    },
    {
      "id": "32ef5f5d-6457-4edc-9299-afea61af4784",
      "name": "Save Contact Details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2700,
        -220
      ]
    },
    {
      "id": "374d7e2f-6e14-4dd1-a51a-f0cce37945d8",
      "name": "Mark as Processed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2920,
        -160
      ]
    },
    {
      "id": "52c246a4-c483-4539-b22d-f4b046c16724",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -360
      ],
      "parameters": {
        "width": 640,
        "height": 180,
        "content": "## 🚀 INITIALIZATION PHASE\n- Triggers every 30 minutes\n- Reads unprocessed records from [Google Sheet](https://docs.google.com/spreadsheets/d/1DHezdcetT0c3Ie1xB3z3jDc5WElsLN87K4J9EQDef9g/edit?usp=shari"
      }
    },
    {
      "id": "2983ac2d-5627-4ab1-9fbf-c09ed8886bf6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -420
      ],
      "parameters": {
        "width": 660,
        "height": 180,
        "content": "## 📊 DATA COLLECTION PHASE\n- Monitors scraper job status\n- Loops until job completes\n- Fetches scraped restaurant data\n- Saves to \"Data\" sheet in [Google Sheets](https://docs.google.com/spreadsheets/d"
      }
    },
    {
      "id": "dc13180b-cf28-44a1-b6e7-c4f0c00f57c2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1940,
        -460
      ],
      "parameters": {
        "width": 740,
        "height": 200,
        "content": "## 🌐 WEBSITE PROCESSING PHASE\n- Filters restaurants with valid websites\n- Loops through each website\n- Scrapes website content with Firecrawl\n- Extracts contact information (emails, social media)\n- Sa"
      }
    },
    {
      "id": "7a23b11a-22ce-4816-a336-6cd28a90aa49",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2260,
        80
      ],
      "parameters": {
        "width": 580,
        "height": 120,
        "content": "## 🔄 LOOPS\n**Status Check Loop**: Continues until scraper job is complete\n**Website Processing Loop**: Processes each restaurant website individually"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read Pending Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Processed": {
      "main": [
        [
          {
            "node": "Batch Processing Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Business Data": {
      "main": [
        [
          {
            "node": "Filter Businesses with Websites",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Until Complete": {
      "main": [
        [
          {
            "node": "Wait for Job Succeed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Scraped Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Pending Queries": {
      "main": [
        [
          {
            "node": "Start Apify Scraping Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Contact Details": {
      "main": [
        [
          {
            "node": "Mark as Processed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Job Succeed": {
      "main": [
        [
          {
            "node": "Check Scraping Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Scraping Status": {
      "main": [
        [
          {
            "node": "Loop Until Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Scraped Results": {
      "main": [
        [
          {
            "node": "Save Business Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Processing Logic": {
      "main": [
        [],
        [
          {
            "node": "Scrape Website Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Website Content": {
      "main": [
        [
          {
            "node": "Extract Contact Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Apify Scraping Job": {
      "main": [
        [
          {
            "node": "Wait for Job Succeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contact Information": {
      "main": [
        [
          {
            "node": "Save Contact Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Businesses with Websites": {
      "main": [
        [
          {
            "node": "Batch Processing Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}