{
  "id": "TWLpjJnA5sRx8Vi7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Enrich Google Maps business leads using Apify, GPT-5.2 and Jina",
  "tags": [],
  "nodes": [
    {
      "id": "ce6973bd-86ea-487a-8fed-741afe33750a",
      "name": "Fetch Dataset Items",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -1472,
        4304
      ],
      "parameters": {
        "limit": {},
        "offset": {},
        "resource": "Datasets",
        "datasetId": "={{ $json.defaultDatasetId }}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6401cae6-82d2-4f0d-8e12-af3ee4e8a960",
      "name": "Deduplicate Places",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -1248,
        4304
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "title"
      },
      "typeVersion": 2
    },
    {
      "id": "0e24c5fc-5a1d-4536-8769-c305559be0a2",
      "name": "Run Maps Scraper",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -1696,
        4304
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "nwua9Gu5YrADL7ZDj"
        },
        "customBody": "={\n    \"includeWebResults\": false,\n    \"language\": \"fr\",\n    \"locationQuery\": \"\",\n    \"maxCrawledPlacesPerSearch\": {{ $('Parse Input Parameters').item.json.limit }},\n    \"maxImages\": 0,\n    \"maximumLeadsEnrichmentRecords\": 0,\n    \"scrapeContacts\": false,\n    \"scrapeDirectories\": false,\n    \"scrapeImageAuthors\": false,\n    \"scrapePlaceDetailPage\": false,\n    \"scrapeReviewsPersonalData\": true,\n    \"scrapeTableReservationProvider\": false,\n    \"searchStringsArray\": [\n        \"{{ $('Parse Input Parameters').item.json.sector }}\"\n    ],\n    \"skipClosedPlaces\": false,\n    \"startUrls\": [\n        {\n            \"url\": \"{{ $('Parse Input Parameters').item.json.mapsUrl }}\"\n        }\n    ]\n}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f681e51a-2785-4a6d-896e-b05f861ae849",
      "name": "Process Each Place",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1024,
        4304
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "89a9bd41-d463-41ca-8171-dcca67b1d387",
      "name": "Upsert Places to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -448,
        4128
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $('Process Each Place').item.json.url }}",
            "city": "={{ $('Process Each Place').item.json.city }}",
            "rank": "={{ $('Process Each Place').item.json.rank }}",
            "phone": "={{ $('Process Each Place').item.json.phone }}",
            "title": "={{ $('Process Each Place').item.json.title }}",
            "street": "={{ $('Process Each Place').item.json.street }}",
            "address": "={{ $('Process Each Place').item.json.address }}",
            "website": "={{ $('Process Each Place').item.json.website.split('?')[0] }}",
            "imageUrl": "={{ $('Process Each Place').item.json.imageUrl }}",
            "scrapedAt": "={{ ($('Process Each Place').item.json.scrapedAt || '').substring(0, 16).replace('T', ' ') }}",
            "categories": "={{ $('Process Each Place').item.json.categories.slice(0, 3).join(', ') }}",
            "postalcode": "={{ $('Process Each Place').item.json.postalCode }}",
            "totalScore": "={{ $('Process Each Place').item.json.totalScore }}",
            "countryCode": "={{ $('Process Each Place').item.json.countryCode }}",
            "categoryName": "={{ $('Process Each Place').item.json.categoryName }}",
            "isAdvertisement": "={{ $('Process Each Place').item.json.isAdvertisement }}",
            "companySummaryIn": "={{ $json.message && $json.message.content && ($json.message.content.companySummary || $json.message.content) || '' }}",
            "phoneUnformatted": "={{ $('Process Each Place').item.json.phoneUnformatted }}"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categoryName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categoryName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "street",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "street",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "city",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postalcode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "postalcode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "countryCode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "countryCode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phoneUnformatted",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phoneUnformatted",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "totalScore",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "totalScore",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categories",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categories",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scrapedAt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "scrapedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "isAdvertisement",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "isAdvertisement",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imageUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companySummaryIn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "companySummaryIn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "title"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE/edit#gid=0",
          "cachedResultName": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE/edit?usp=drivesdk",
          "cachedResultName": "Google Maps Leads Enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1b7ee0e9-6557-43a1-b53b-27c84f9842e4",
      "name": "Wait Rate Limit",
      "type": "n8n-nodes-base.wait",
      "position": [
        336,
        4416
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "bc356503-7be0-4f24-9712-bf4a8334d2ac",
      "name": "Receive Telegram Input",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2144,
        4304
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "35458641-119b-4696-a817-d07631823496",
      "name": "Parse Input Parameters",
      "type": "n8n-nodes-base.code",
      "position": [
        -1920,
        4304
      ],
      "parameters": {
        "jsCode": "// Parse the Telegram message and extract three comma-separated values\nconst messageText = $input.first().json.message.text;\n\n// Split by commas and trim whitespace\nconst parts = messageText.split(';').map(part => part.trim());\n\n// Extract the three values\nconst sector = parts[0] || '';\nconst limit = parseInt(parts[1]) || 0;\nconst mapsUrl = parts[2] || '';\n\n// Return the parsed data as a JSON object\nreturn [\n  {\n    json: {\n      sector: sector,\n      limit: limit,\n      mapsUrl: mapsUrl\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "8af998d9-1b9c-4ed9-912e-a84a9bb95385",
      "name": "Send Done Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        80,
        4416
      ],
      "parameters": {
        "text": "DONE",
        "chatId": "={{ $('Receive Telegram Input').first().json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5cf8301b-57ec-4e9f-a5b5-ed25b73fc1cc",
      "name": "Select Website URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -224,
        4128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ccc11066-fad4-4931-acf6-6c45e5e7b117",
              "name": "Site internet",
              "type": "string",
              "value": "={{ (($('Process Each Place').item.json.website || '') + '').trim() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6cd5c525-c1ad-47fb-baba-c511b05ae138",
      "name": "Extract Website Email",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        448,
        4048
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5.2",
          "cachedResultName": "GPT-5.2"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are analyzing the Markdown content of a business website to extract the most relevant contact email address.\n\nYour task:\n\nExtract only one email address, ideally belonging to the business owner, manager, or main contact person.\n\nIf multiple emails appear, choose the most authoritative or professional one (e.g., not \u201cinfo@\u201d or \u201csupport@\u201d unless it\u2019s the only option).\n\nIf no valid email is found, return exactly:\nNull\n\nOutput rules:\n\nOutput only the email address (no explanation, no JSON, no punctuation, no quotes).\n\nThe result must be a clean, valid email format (e.g., contact@company.com).\n\nWebsite HTML content:\n{{ $json.content }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e3d10c54-cecd-40f0-a414-d9fce4d259f8",
      "name": "Update Email in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        4048
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $json.message && $json.message.content ? $json.message.content : '' }}",
            "title": "={{ $('Process Each Place').item.json.title }}"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categoryName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categoryName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "street",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "street",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "city",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postalcode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "postalcode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "countryCode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "countryCode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phoneUnformatted",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phoneUnformatted",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "totalScore",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "totalScore",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categories",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categories",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scrapedAt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "scrapedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "isAdvertisement",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "isAdvertisement",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imageUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companySummaryIn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "companySummaryIn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "title"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE/edit#gid=0",
          "cachedResultName": "Leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HgIpzjI2B3l-2G11G-ZsHh3fORazJIB8DKYykLVm1DE/edit?usp=drivesdk",
          "cachedResultName": "Google Maps Leads Enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "4f2a6687-f1ff-4706-a24d-594f86d3dd4a",
      "name": "Generate Company Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -800,
        4128
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5.1",
          "cachedResultName": "GPT-5.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=You are an AI assistant specialized in generating professional, concise, and natural company summaries from structured data scraped from Google Maps.\n\nYour goal is to transform the provided company information into a fluent, human-like paragraph suitable for business directories or lead databases.\n\nFollow these principles:\n\nMaintain a professional and informative tone.\n\nWrite in one coherent paragraph (no lists or bullet points).\n\nSmoothly omit any fields that are missing without mentioning it.\n\nThe final text must sound natural and ready for direct publication.\n\nOutput only the final summary paragraph \u2014 no explanations, notes, or JSON."
            },
            {
              "content": "=Generate a clear and concise summary of the following company based on its Google Maps data:\n\nCompany Name: {{ $json.title }}\nCategory: {{ $json.categoryName }}\nAddress: {{ $json.address }}\nCity: {{ $json.city }}\nCountry: {{ $json.countryCode }}\nPhone: {{ $json.phones }}\nGoogle Maps URL: {{ $json.url }}\n\nWrite a natural paragraph like this example (without quotes):\n\nThe company name is [Name]. It is a [category] located at [address] in [city, country]. You can contact them at [phone]. For more details, visit their Google Maps page: [URL].\n\nEnsure the output flows naturally and excludes any missing information.\n\n"
            },
            {
              "content": "Output the result in the JSON format companySummary"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "5888cda2-33a0-4b45-a338-ee109ae7c05e",
      "name": "Website URL Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        0,
        4128
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "31d1e4da-dfaf-4ae7-9bae-c73bc8af56c1",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json['Site internet'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "30580685-8f56-428f-a991-cea75d33f7ba",
      "name": "Fetch Website Content",
      "type": "n8n-nodes-base.jinaAi",
      "position": [
        224,
        4048
      ],
      "parameters": {
        "url": "={{ $json['Site internet'] }}",
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "jinaAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "48b3cd88-e71f-4cf2-9cda-ad958d892db9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        3488
      ],
      "parameters": {
        "width": 500,
        "height": 622,
        "content": "## Google Maps Leads Enrichment via Telegram\n\n### How it works\n1. Receive a Telegram message with three values (sector; limit; mapsUrl) to trigger a run.\n2. Run a Google Maps scraper (Apify) using the provided URL and sector, fetch results and remove duplicate places.\n3. Process each place: generate a human-ready company summary with the AI model and append or update rows in your Google Sheet.\n4. If a place has a website, fetch its HTML, call the AI to extract a primary contact email, and update the sheet row.\n5. Respect rate limits between requests and send a DONE message back to the original Telegram chat when processing finishes.\n\n### Setup\n- [ ] Connect the Telegram bot and confirm it can send messages to the workflow.\n- [ ] Add Apify API credentials and configure the Maps scraper actor.\n- [ ] Authorize Google Sheets and set the spreadsheet ID and sheet name.\n- [ ] Add OpenAI API key for summaries and email extraction.\n- [ ] Enable website fetch (JinaAI or similar) and verify access to target sites.\n- [ ] Set rate-limit wait seconds and run a small test."
      },
      "typeVersion": 1
    },
    {
      "id": "830cb935-b95c-4e3a-b32c-506ca8181100",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        4144
      ],
      "parameters": {
        "color": 7,
        "width": 1136,
        "height": 352,
        "content": "## Input & Scrape  \n  Receive Telegram input (sector; limit; mapsUrl), parse parameters, run Apify Maps Scraper, fetch dataset items, and deduplicate places."
      },
      "typeVersion": 1
    },
    {
      "id": "2a1287e8-28a6-4bff-8446-e6268cccaf73",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        3952
      ],
      "parameters": {
        "color": 7,
        "width": 784,
        "height": 496,
        "content": "## Enrich & Save  \n  Process each place, generate a company summary with GPT, then upsert core place data into Google Sheets."
      },
      "typeVersion": 1
    },
    {
      "id": "d26c5bcf-d1bb-4364-9a43-f1335f034563",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        3952
      ],
      "parameters": {
        "color": 7,
        "width": 1248,
        "height": 336,
        "content": "## Website Email Enrichment  \n  Select website URL, check if it exists, fetch page content via Jina, extract email with GPT, then update Email in Google Sheets."
      },
      "typeVersion": 1
    },
    {
      "id": "224c1f5b-073e-41c2-95c8-98f34bd3f30a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        4304
      ],
      "parameters": {
        "color": 7,
        "width": 816,
        "height": 336,
        "content": "## Loop Control & Notify  \n  Apply rate-limit wait between items and send final DONE notification when processing completes."
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "versionId": "b5fc4444-8e3f-4b83-8d90-598fe6504f8c",
  "connections": {
    "Wait Rate Limit": {
      "main": [
        [
          {
            "node": "Process Each Place",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Maps Scraper": {
      "main": [
        [
          {
            "node": "Fetch Dataset Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deduplicate Places": {
      "main": [
        [
          {
            "node": "Process Each Place",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Place": {
      "main": [
        [
          {
            "node": "Send Done Notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Company Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Website URL": {
      "main": [
        [
          {
            "node": "Website URL Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Dataset Items": {
      "main": [
        [
          {
            "node": "Deduplicate Places",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Website URL Exists?": {
      "main": [
        [
          {
            "node": "Fetch Website Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Rate Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Website Email": {
      "main": [
        [
          {
            "node": "Update Email in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Website Content": {
      "main": [
        [
          {
            "node": "Extract Website Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Email in Sheet": {
      "main": [
        [
          {
            "node": "Wait Rate Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Input Parameters": {
      "main": [
        [
          {
            "node": "Run Maps Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Telegram Input": {
      "main": [
        [
          {
            "node": "Parse Input Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert Places to Sheet": {
      "main": [
        [
          {
            "node": "Select Website URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Company Summary": {
      "main": [
        [
          {
            "node": "Upsert Places to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}