{
  "name": "Scrape Google Maps leads with GPT-4 and assign them in Notion via Telegram",
  "nodes": [
    {
      "id": "85765140-57f9-4f87-9ee8-bd1e9e822f77",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3792,
        -592
      ],
      "parameters": {
        "width": 863,
        "height": 331,
        "content": "## Step 1: Fetch & Prepare Data\nWe define the search query and fetch fresh leads from Google Maps via Outscraper. Then we normalize the data (clean phone numbers, extract top reviews) to make it ready"
      }
    },
    {
      "id": "12501ec6-3a17-430f-90f2-48288c757026",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        -768
      ],
      "parameters": {
        "width": 1144,
        "height": 549,
        "content": "## Step 2: CRM Check & AI Analysis\nBefore spending money on AI, we check Notion to ensure this lead doesn't exist yet. If it's new, GPT-4 analyzes the reviews to generate a personalized \"Icebreaker\" p"
      }
    },
    {
      "id": "6166bb8d-4fe6-43ad-a356-ec155f54cfeb",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        -624
      ],
      "parameters": {
        "width": 811,
        "height": 412,
        "content": "## Step 3: Save to Notion & Alert Telegram\nWe save the enriched lead into the \"Active Deals\" database and format a beautiful HTML card for the Telegram sales group."
      }
    },
    {
      "id": "a074c39f-7f94-49ef-9267-709dd2cdb6e9",
      "name": "Sticky Note 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        -128
      ],
      "parameters": {
        "width": 1391,
        "height": 511,
        "content": "## Step 4: Handle Button Clicks (Assignment)\nWhen an agent clicks \"⚡️ Take Lead\" in Telegram:\n1. We identify the agent by their Telegram ID.\n2. We assign the lead to them in Notion.\n3. We update the c"
      }
    },
    {
      "id": "f96a3d09-7a29-40aa-943e-819510566098",
      "name": "Main Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4336,
        -672
      ],
      "parameters": {
        "width": 473,
        "height": 751,
        "content": "# AI Sales Coach System (Lead Gen)\nThis workflow automates the cold outreach process. It scrapes local businesses from Google Maps, duplicate-checks them against your CRM, generates personalized AI ic"
      }
    },
    {
      "id": "51ff95b9-3f35-48bf-b01f-c62f0edf8b91",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3744,
        -464
      ]
    },
    {
      "id": "98199f1c-e103-4840-975a-bb7181ed5f36",
      "name": "📝 CONFIGURATION",
      "type": "n8n-nodes-base.set",
      "position": [
        -3520,
        -464
      ]
    },
    {
      "id": "6b4dca8f-967a-4369-baa7-674f1f51722f",
      "name": "1. Fetch Google Maps Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3280,
        -464
      ]
    },
    {
      "id": "be7feb25-3cc0-46c7-b45f-2104f021709c",
      "name": "2. Clean & Normalize",
      "type": "n8n-nodes-base.code",
      "position": [
        -3072,
        -464
      ]
    },
    {
      "id": "fce9b11b-cb1b-4062-873d-4899239d6714",
      "name": "🔄 Loop Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2848,
        -464
      ]
    },
    {
      "id": "3275b832-536e-47b3-ae8f-5433a7168b2c",
      "name": "🔎 Search Duplicate",
      "type": "n8n-nodes-base.notion",
      "position": [
        -2624,
        -432
      ]
    },
    {
      "id": "b9d1b41a-08be-4ba5-a166-28ab11f55d83",
      "name": "🛡️ Restore Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2432,
        -640
      ]
    },
    {
      "id": "b14870a2-ce22-4c02-aad4-bccb82935585",
      "name": "Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        -2192,
        -464
      ]
    },
    {
      "id": "c05c1d7e-5d8c-4cbc-965b-4c5625af7a77",
      "name": "🚫 Duplicate / Skip",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -1968,
        -656
      ]
    },
    {
      "id": "72eff68c-dce6-4e00-b40a-e4284d1ad8c1",
      "name": "🤖 AI Icebreaker",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1984,
        -352
      ]
    },
    {
      "id": "683f1ee4-4cd5-468d-9972-2bf1ecfd0161",
      "name": "🔗 Merge Final",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1648,
        -464
      ]
    },
    {
      "id": "636d058b-ebda-4929-af6f-822a0117dba5",
      "name": "💾 Create New Lead",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1456,
        -464
      ]
    },
    {
      "id": "08e8c676-189f-4540-ab1b-a5ba616c6341",
      "name": "🎨 Prepare Message",
      "type": "n8n-nodes-base.code",
      "position": [
        -1264,
        -464
      ]
    },
    {
      "id": "cffb9d6a-258d-4c97-bff7-460d345e4be0",
      "name": "📢 Notify Team",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1088,
        -368
      ]
    },
    {
      "id": "921d380f-5305-445a-8143-88cadbae74cd",
      "name": "Telegram Callback",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2224,
        64
      ]
    },
    {
      "id": "3b69a6e5-5d78-4308-b4b1-35d454cf282a",
      "name": "🕵️‍♂️ Find Agent",
      "type": "n8n-nodes-base.notion",
      "position": [
        -2000,
        64
      ]
    },
    {
      "id": "78f2877f-3a12-4ece-815f-73612440af19",
      "name": "Agent Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1776,
        64
      ]
    },
    {
      "id": "d056c8a7-212a-4cba-a8a4-ce7c179999a7",
      "name": "📝 Assign Lead",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1520,
        -64
      ]
    },
    {
      "id": "df28b9a0-f165-415e-a386-51ae916cb2ef",
      "name": "✅ Update Chat",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1296,
        -64
      ]
    },
    {
      "id": "7b8de588-d6b6-4695-82a3-dae98d66ab01",
      "name": "🔔 Show Toast",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1072,
        -64
      ]
    },
    {
      "id": "4e5f21f6-f248-444e-bddc-a9a57267a5de",
      "name": "❌ Error Toast",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1520,
        192
      ]
    }
  ],
  "connections": {
    "Found?": {
      "main": [
        [
          {
            "node": "🚫 Duplicate / Skip",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "🤖 AI Icebreaker",
            "type": "main",
            "index": 0
          },
          {
            "node": "🔗 Merge Final",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Agent Exists?": {
      "main": [
        [
          {
            "node": "📝 Assign Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "❌ Error Toast",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "📝 CONFIGURATION",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "✅ Update Chat": {
      "main": [
        [
          {
            "node": "🔔 Show Toast",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔄 Loop Items": {
      "main": [
        [],
        [
          {
            "node": "🔎 Search Duplicate",
            "type": "main",
            "index": 0
          },
          {
            "node": "🛡️ Restore Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Assign Lead": {
      "main": [
        [
          {
            "node": "✅ Update Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📢 Notify Team": {
      "main": [
        [
          {
            "node": "🔄 Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔗 Merge Final": {
      "main": [
        [
          {
            "node": "💾 Create New Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Callback": {
      "main": [
        [
          {
            "node": "🕵️‍♂️ Find Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 CONFIGURATION": {
      "main": [
        [
          {
            "node": "1. Fetch Google Maps Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🤖 AI Icebreaker": {
      "main": [
        [
          {
            "node": "🔗 Merge Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Clean & Normalize": {
      "main": [
        [
          {
            "node": "🔄 Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🎨 Prepare Message": {
      "main": [
        [
          {
            "node": "📢 Notify Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💾 Create New Lead": {
      "main": [
        [
          {
            "node": "🎨 Prepare Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🛡️ Restore Data": {
      "main": [
        [
          {
            "node": "Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔎 Search Duplicate": {
      "main": [
        [
          {
            "node": "🛡️ Restore Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "🚫 Duplicate / Skip": {
      "main": [
        [
          {
            "node": "🔄 Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Fetch Google Maps Data": {
      "main": [
        [
          {
            "node": "2. Clean & Normalize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🕵️‍♂️ Find Agent": {
      "main": [
        [
          {
            "node": "Agent Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}