{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1a608370-405e-4601-b65d-7a336fa0ae82",
      "name": "Generate Report",
      "type": "n8n-nodes-base.function",
      "position": [
        -16,
        320
      ],
      "parameters": {
        "functionCode": "const duplicates = [];\nconst lowQuality = [];\n\nfor (const item of $input.all()) {\n  if (item.json.leadScore <= 50) {\n    lowQuality.push(item.json.businessName);\n  }\n}\n\nreturn [{\n  json: {\n    totalProcessed: $input.all().length,\n    lowQualityLeads: lowQuality.length,\n    lowQualityNames: lowQuality,\n    timestamp: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 1
    },
    {
      "id": "07cff94f-48fb-4667-abf9-3e7c929508a5",
      "name": "Error Logging",
      "type": "n8n-nodes-base.function",
      "position": [
        -48,
        512
      ],
      "parameters": {
        "functionCode": "// Error log for debugging\nconst errorLog = {\n  workflow: 'Google Maps Lead Generator',\n  timestamp: new Date().toISOString(),\n  error: 'Low quality or invalid lead detected',\n  data: $json\n};\n\nconsole.log('Error Log:', errorLog);\n\nreturn [{ json: errorLog }];"
      },
      "typeVersion": 1
    },
    {
      "id": "af642ea6-17a4-4fd2-a6e7-b26f9bdff825",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        128
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3ecdbef5-6df9-4f62-a9f9-44fa94ad32bc",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1152,
        128
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"contact\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"E-posta ve telefon numaralar\u0131 gibi ileti\u015fim bilgilerini i\u00e7erir.\",\n\t\t\t\"properties\": {\n\t\t\t\t\"emails\": {\n\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"description\": \"Bulunan t\u00fcm e-posta adreslerinin listesi.\"\n\t\t\t\t},\n\t\t\t\t\"phones\": {\n\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"description\": \"Bulunan t\u00fcm telefon numaralar\u0131n\u0131n listesi.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"social\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"Sabit sosyal medya platformlar\u0131n\u0131n URL'lerini i\u00e7erir. Bulunamayan linkler i\u00e7in alan bo\u015f bir metin olarak b\u0131rak\u0131lmal\u0131d\u0131r.\",\n\t\t\t\"properties\": {\n\t\t\t\t\"facebook\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Facebook sayfas\u0131n\u0131n tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"instagram\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Instagram profilinin tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"linkedin\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"LinkedIn profilinin tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"youtube\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"YouTube kanal\u0131n\u0131n tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"pinterest\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Pinterest profilinin tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"twitter\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Twitter (X) profilinin tam URL'si.\"\n\t\t\t\t},\n\t\t\t\t\"whatsapp\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"WhatsApp ileti\u015fim linki (\u00f6rn: wa.me/...).\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"location\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"description\": \"\u015eirketin yap\u0131land\u0131r\u0131lm\u0131\u015f fiziksel adresi.\",\n\t\t\t\"properties\": {\n\t\t\t\t\"full_address\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Adresin ham ve tam metin hali.\"\n\t\t\t\t},\n\t\t\t\t\"city\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Adresten \u00e7\u0131kar\u0131lan \u015fehir bilgisi.\"\n\t\t\t\t},\n\t\t\t\t\"country\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"description\": \"Adresten \u00e7\u0131kar\u0131lan \u00fclke bilgisi.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"other_contact_methods\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"description\": \"\u0130leti\u015fim formu veya WhatsApp butonu gibi di\u011fer ileti\u015fim y\u00f6ntemleri.\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"\u0130leti\u015fim y\u00f6nteminin t\u00fcr\u00fc (\u00d6rn: Contact Form, WhatsApp Chat).\"\n\t\t\t\t\t},\n\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"\u0130lgili sayfan\u0131n veya \u00f6zelli\u011fin linki.\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "944898a5-6bed-408a-ac9b-b62101132f51",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1024,
        -64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2f801af9-c230-4910-97db-8adf7a8ac650",
      "name": "1. Set Search Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -800,
        -64
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "searchCategory",
              "value": "dentist"
            },
            {
              "name": "locationName",
              "value": "Istanbul, Turkey"
            },
            {
              "name": "latitude",
              "value": "41.0082"
            },
            {
              "name": "longitude",
              "value": "28.9784"
            },
            {
              "name": "radius",
              "value": "5000"
            },
            {
              "name": "maxResults",
              "value": "20"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "3a046790-67dd-4db5-9254-25e2c5b30027",
      "name": "2. Find Businesses (Google Places)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        -64
      ],
      "parameters": {
        "url": "https://places.googleapis.com/v1/places:searchNearby",
        "method": "POST",
        "options": {
          "timeout": 30000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={\"includedTypes\":[\"{{$json[\"searchCategory\"]}}\"],\"maxResultCount\":{{$json[\"maxResults\"]}},\"locationRestriction\":{\"circle\":{\"center\":{\"latitude\":{{$json[\"latitude\"]}},\"longitude\":{{$json[\"longitude\"]}}},\"radius\":{{$json[\"radius\"]}}}}}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Goog-FieldMask",
              "value": "places.id,places.displayName,places.formattedAddress,places.nationalPhoneNumber,places.websiteUri,places.rating,places.businessStatus,places.primaryType,places.location"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "93842018-1c3a-465c-b7a9-d90af939323e",
      "name": "3. Parse & Score Leads",
      "type": "n8n-nodes-base.function",
      "position": [
        -400,
        -64
      ],
      "parameters": {
        "functionCode": "const items = [];\nconst places = $input.first().json.places || [];\nconst searchParams = $node[\"1. Set Search Parameters\"].json;\n\nfor (const place of places) {\n  const item = {\n    id: place.id || '',\n    businessName: place.displayName?.text || 'N/A',\n    address: place.formattedAddress || 'N/A',\n    phone: place.nationalPhoneNumber || 'N/A',\n    website: place.websiteUri || 'N/A',\n    rating: place.rating || 0,\n    businessStatus: place.businessStatus || 'UNKNOWN',\n    primaryType: place.primaryType || searchParams.searchCategory,\n    latitude: place.location?.latitude || 0,\n    longitude: place.location?.longitude || 0,\n    searchLocation: searchParams.locationName,\n    searchCategory: searchParams.searchCategory,\n    createdAt: new Date().toISOString(),\n    leadScore: 0,\n    status: 'New Lead'\n  };\n  \n  // Calculate lead score\n  let score = 0;\n  if (item.rating >= 4.5) score += 30;\n  else if (item.rating >= 4.0) score += 20;\n  else if (item.rating >= 3.5) score += 10;\n  \n  if (item.website !== 'N/A') score += 25;\n  if (item.phone !== 'N/A') score += 20;\n  if (item.businessStatus === 'OPERATIONAL') score += 25;\n  \n  item.leadScore = score;\n  \n  items.push({ json: item });\n}\n\nreturn items;"
      },
      "typeVersion": 1
    },
    {
      "id": "f946456d-53fa-4b03-8521-406b2b6b14ca",
      "name": "4. Filter High-Quality Leads",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -64
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json[\"leadScore\"]}}",
              "value2": 50,
              "operation": "larger"
            }
          ],
          "string": [
            {
              "value1": "={{$json[\"businessName\"]}}",
              "value2": "N/A",
              "operation": "notEqual"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1121701f-c2f7-43d1-af89-1a75b9159ce5",
      "name": "5. Loop Through Each Lead",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        64,
        -96
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "58958e08-90c8-4f7d-8922-21dd84b80406",
      "name": "6a. Scrape Website with Scrape.do",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "url": "http://api.scrape.do/",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.website }}"
            },
            {
              "name": "token",
              "value": "{{$env[\"SCRAPE_DO_API_KEY\"]}}"
            }
          ]
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "d4a3c983-fa0c-4afc-86ba-d47543202e1a",
      "name": "6b. Check if Scrape Was Successful",
      "type": "n8n-nodes-base.if",
      "position": [
        528,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "076a0652-9f88-4992-b111-791aa327e571",
              "operator": {
                "type": "number",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.error.status }}",
              "rightValue": 400
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "012b5b66-460f-4efb-a960-7df911ce05cc",
      "name": "6c. Extract Footer from HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        784,
        -80
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "footer",
              "cssSelector": "footer"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b28b0efc-e480-4629-9b39-e649c23b2531",
      "name": "6d. Extract Contact Info with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        -80
      ],
      "parameters": {
        "text": "=Analyze the following HTML snippet, which comes from a website's footer section. Your task is to extract all available contact information and populate the structured format as requested.\n\n1.  **Extract Social Media URLs:** Scan the HTML for links to specific social media platforms. Find the unique URL for each platform and place it in the corresponding field within the `social` object (e.g., the Facebook URL goes into `social.facebook`). If a link for a platform is not found, leave its field as an empty string.\n\n2.  **Extract Contact Info:** Find all email addresses (`mailto:` links) for `contact.emails`. Find all phone numbers (`tel:` links) for `contact.phones`.\n\n3.  **Extract Location:** Find the physical address and populate `location.full_address`, `location.city`, and `location.country`.\n\n4.  **Extract Other Methods:** Find links to contact forms or WhatsApp (`wa.me/`) and add them to the `other_contact_methods` array.\n\nHTML Content:\n{{ $json.footer }}",
        "options": {
          "systemMessage": "You are a highly efficient and accurate data extraction AI. Your sole purpose is to parse raw HTML content and extract specific information into a structured JSON format as requested. You must only respond with the structured data. Do not add any extra text, comments, or explanations."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "3cc6fa78-f210-49e8-a49a-b5735ef7c262",
      "name": "7. Save Enriched Lead to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1616,
        128
      ],
      "parameters": {
        "options": {},
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "BusinessName",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.businessName }}"
            },
            {
              "fieldId": "Address",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.address }}"
            },
            {
              "fieldId": "Phone",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.phone }}"
            },
            {
              "fieldId": "website",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.website }}"
            },
            {
              "fieldId": "emails",
              "fieldValue": "={{ $json.output.contact.emails[0] }}"
            },
            {
              "fieldId": "Facebook",
              "fieldValue": "={{ $json.output.social.facebook }}"
            },
            {
              "fieldId": "Instagram",
              "fieldValue": "={{ $json.output.social.instagram }}"
            },
            {
              "fieldId": "Youtube",
              "fieldValue": "={{ $json.output.social.youtube }}"
            },
            {
              "fieldId": "Linkedin",
              "fieldValue": "={{ $json.output.social.linkedin }}"
            },
            {
              "fieldId": "Pinterest",
              "fieldValue": "={{ $json.output.social.pinterest }}"
            },
            {
              "fieldId": "Other",
              "fieldValue": "={{ $json.output.other_contact_methods[0].url }}"
            },
            {
              "fieldId": "rating",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.rating }}"
            },
            {
              "fieldId": "businessStatus",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.businessStatus }}"
            },
            {
              "fieldId": "primaryType",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.primaryType }}"
            },
            {
              "fieldId": "Lantitude",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.latitude }}"
            },
            {
              "fieldId": "Longitude",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.longitude }}"
            },
            {
              "fieldId": "searchLocation",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.searchLocation }}"
            },
            {
              "fieldId": "SearchCategory",
              "fieldValue": "={{ $('5. Loop Through Each Lead').item.json.searchCategory }}"
            }
          ]
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9uFYn0q-yBmaGwmN24w6L_1-qjqEVaQj0FwN5RfoFY/edit#gid=0",
          "cachedResultName": "Table"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1I9uFYn0q-yBmaGwmN24w6L_1-qjqEVaQj0FwN5RfoFY",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1I9uFYn0q-yBmaGwmN24w6L_1-qjqEVaQj0FwN5RfoFY/edit?usp=drivesdk",
          "cachedResultName": "Lead Generator"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "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, social media) using AI, and saves the enriched data to Google Sheets.\n\n### Quick Setup Guide\n\n1.  **Configure Credentials:**\n    *   `2. Find Businesses`: Set up your Google Places API credentials (Header Auth).\n    *   `6a. Scrape Website`: Set up your Scrape.do (or other scraping service) credentials.\n    *   `6d. AI Agent`: Configure your OpenAI credentials.\n    *   `7. Save to Google Sheets`: Configure your Google Sheets OAuth2 credentials.\n2.  **Set Your Search:** In the `1. Set Search Parameters` node, define your target business category and location.\n3.  **Configure Google Sheet:** In the `7. Save to Google Sheets` node, select your spreadsheet and sheet. Make sure the column names match.\n4.  **Activate Workflow:** Turn the workflow on. It will run based on the schedule you set in the `Schedule Trigger`."
      },
      "typeVersion": 1
    },
    {
      "id": "54e30c62-7eee-496e-9bb4-3f90bbda77d0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -400
      ],
      "parameters": {
        "color": 2,
        "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 their rating, website, phone, and operational status.\n\n*   **1. Set Search Parameters:** **THIS IS THE MAIN NODE TO CONFIGURE.** Change `searchCategory` and `locationName` to define your target audience.\n*   **4. Filter High-Quality Leads:** Only leads with a score greater than 50 are processed further. You can adjust this threshold in the IF node's settings."
      },
      "typeVersion": 1
    },
    {
      "id": "57a2105c-67c2-4f4d-a7ec-7f29bac341e2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -448
      ],
      "parameters": {
        "color": 4,
        "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 website (if one exists) via a scraping service to get the raw HTML content.\n*   **6c. Extract Footer:** It specifically isolates the `<footer>` section of the website, as this area most commonly contains contact information.\n*   **6d. Extract Contact Info with AI:** It uses an OpenAI model to analyze the footer HTML and intelligently extract structured data like emails, social media links, and phone numbers."
      },
      "typeVersion": 1
    },
    {
      "id": "4ef856f2-b46d-4243-a001-4f0c4ab32019",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        48
      ],
      "parameters": {
        "color": 6,
        "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 initial Google Places data and saved.\n*   **Configuration:** You must select your credentials, spreadsheet, and sheet name here. Ensure your sheet has columns matching the fields defined in this node."
      },
      "typeVersion": 1
    }
  ],
  "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 \u2018Execute workflow\u2019": {
      "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
          }
        ]
      ]
    }
  }
}