{
  "name": "Generate and enrich local business leads with Decodo, OpenAI and Gmail",
  "nodes": [
    {
      "id": "sticky-setup-1",
      "name": "📋 WF1 Setup Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2816,
        1984
      ],
      "parameters": {
        "width": 672,
        "height": 870,
        "content": "## End-to-End Local Business Lead Generation, Enrichment and Outreach Pipeline with Decodo\n\nThis workflow finds local business leads on Google Maps, enriches them with website and AI analysis, and sen"
      }
    },
    {
      "id": "410c9e4f-b43b-48da-8a9b-bab5c411fe2e",
      "name": "📍 Stage 1: Discovery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3760,
        2832
      ],
      "parameters": {
        "width": 1384,
        "height": 328,
        "content": "## 📍 Stage 1: Discovery\n\nScrapes Google Maps for business leads and saves them to Google Sheets with status='New'"
      }
    },
    {
      "id": "d0770492-2b2a-426a-85aa-85534b4cb981",
      "name": "Schedule: Daily 10AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        3872,
        2944
      ]
    },
    {
      "id": "set-config-1",
      "name": "Search Config",
      "type": "n8n-nodes-base.set",
      "position": [
        4096,
        2944
      ]
    },
    {
      "id": "decodo-maps-1",
      "name": "Decodo: Scrape Google Maps",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        4320,
        2944
      ]
    },
    {
      "id": "code-parse-1",
      "name": "Parse Leads from Markdown",
      "type": "n8n-nodes-base.code",
      "position": [
        4544,
        2944
      ]
    },
    {
      "id": "if-valid-lead-1",
      "name": "Is Valid Lead?",
      "type": "n8n-nodes-base.if",
      "position": [
        4768,
        2944
      ]
    },
    {
      "id": "sheets-save-1",
      "name": "Save Lead to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4992,
        2944
      ]
    },
    {
      "id": "e6e50a51-5968-4090-992c-df02378df0c5",
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        5216,
        2944
      ]
    },
    {
      "id": "104b56fb-964f-4a6d-ae7f-7f0e205bcbf7",
      "name": "Has Website?",
      "type": "n8n-nodes-base.if",
      "position": [
        5440,
        2864
      ]
    },
    {
      "id": "800e38a5-faa1-41b2-b002-d9a636bbc15d",
      "name": "Mark: No Website",
      "type": "n8n-nodes-base.set",
      "position": [
        5664,
        2960
      ]
    },
    {
      "id": "b7fbdc15-2f97-4872-8ecb-e707fa1e701f",
      "name": "Decodo: Scrape Business Website",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        5664,
        2768
      ]
    },
    {
      "id": "9b9e015e-6032-4417-9ff5-cfa163d6c8a7",
      "name": "Update Lead (No Website)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5888,
        2960
      ]
    },
    {
      "id": "faec214f-6216-4ce7-a57d-6be36ef319b4",
      "name": "Merge Website Content",
      "type": "n8n-nodes-base.set",
      "position": [
        5888,
        2768
      ]
    },
    {
      "id": "17253c4a-3d58-4961-b0a2-19c93e15fb51",
      "name": "AI: Score & Enrich Lead",
      "type": "n8n-nodes-base.openAi",
      "position": [
        6112,
        2768
      ]
    },
    {
      "id": "2aecd8b5-884b-4f6a-9551-18d3e05d6732",
      "name": "Parse AI Response",
      "type": "n8n-nodes-base.code",
      "position": [
        6336,
        2768
      ]
    },
    {
      "id": "58747d01-57a5-42a2-9200-73dc11624591",
      "name": "Update Lead (Enriched)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6560,
        2944
      ]
    },
    {
      "id": "e0b90205-19eb-43cb-b320-6675c889a1ac",
      "name": "Get Enriched Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5440,
        2528
      ]
    },
    {
      "id": "3bd6b600-155b-44e5-a6fb-837925bb7d4f",
      "name": "Filter by Score Threshold",
      "type": "n8n-nodes-base.code",
      "position": [
        5664,
        2528
      ]
    },
    {
      "id": "6af19658-76da-43a8-9fa7-982961e4668f",
      "name": "Qualified Leads Exist?",
      "type": "n8n-nodes-base.if",
      "position": [
        5888,
        2528
      ]
    },
    {
      "id": "16a7ec75-61a4-41c0-99e5-8903b8fc47a8",
      "name": "Split In Batches1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6112,
        2528
      ]
    },
    {
      "id": "79fae8e6-e9ef-4ed5-bef1-54955a8798f7",
      "name": "Decodo: Deep Scrape Website",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        6336,
        2272
      ]
    },
    {
      "id": "63c70c4d-210b-4afb-80cd-5bcda8abeba5",
      "name": "Merge Lead + Content",
      "type": "n8n-nodes-base.set",
      "position": [
        6560,
        2272
      ]
    },
    {
      "id": "155ea4e9-aa18-4623-80a1-7052dfe309fc",
      "name": "AI: Write Cold Email",
      "type": "n8n-nodes-base.openAi",
      "position": [
        6784,
        2272
      ]
    },
    {
      "id": "8a1f09c2-dbac-4d60-83a5-9a9df288f7ff",
      "name": "Parse Email Content",
      "type": "n8n-nodes-base.code",
      "position": [
        7008,
        2272
      ]
    },
    {
      "id": "10e90ee5-e213-4300-9e7d-0f4a75948479",
      "name": "Valid Email Address?",
      "type": "n8n-nodes-base.if",
      "position": [
        7232,
        2272
      ]
    },
    {
      "id": "6f120d78-0ac2-4772-9592-6a6c6e4d2229",
      "name": "Gmail: Send Cold Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        7456,
        2192
      ]
    },
    {
      "id": "a28f7f8e-9572-4e1b-9093-0b4372d04bf8",
      "name": "Mark: Invalid Email",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7456,
        2384
      ]
    },
    {
      "id": "5642aa01-efab-40ce-b506-751d613ac5f7",
      "name": "Mark as Contacted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7680,
        2336
      ]
    },
    {
      "id": "92be83cc-542b-47be-be3f-ab298efdbfef",
      "name": "📍 Stage 2: Enrichment",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5200,
        2240
      ],
      "parameters": {
        "width": 1544,
        "height": 920,
        "content": "## 📍 Stage 2: Enrichment\n\nProcesses 'New' leads, scrapes websites, uses AI to score and enrich, updates status='Enriched'"
      }
    },
    {
      "id": "6ee2e8c7-57a1-4450-9602-26360f1af3a3",
      "name": "📍 Stage 3: Outreach",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6768,
        2096
      ],
      "parameters": {
        "width": 1080,
        "height": 488,
        "content": "## 📍 Stage 3: Outreach\n\nFilters enriched leads by score, generates personalized emails with AI, sends via Gmail, marks as 'Contacted'"
      }
    }
  ],
  "connections": {
    "Has Website?": {
      "main": [
        [
          {
            "node": "Decodo: Scrape Business Website",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark: No Website",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Config": {
      "main": [
        [
          {
            "node": "Decodo: Scrape Google Maps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Valid Lead?": {
      "main": [
        [
          {
            "node": "Save Lead to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark: No Website": {
      "main": [
        [
          {
            "node": "Update Lead (No Website)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Get Enriched Leads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Has Website?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark as Contacted": {
      "main": [
        [
          {
            "node": "Split In Batches1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response": {
      "main": [
        [
          {
            "node": "Update Lead (Enriched)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches1": {
      "main": [
        [],
        [
          {
            "node": "Decodo: Deep Scrape Website",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Enriched Leads": {
      "main": [
        [
          {
            "node": "Filter by Score Threshold",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark: Invalid Email": {
      "main": [
        [
          {
            "node": "Split In Batches1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Email Content": {
      "main": [
        [
          {
            "node": "Valid Email Address?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Write Cold Email": {
      "main": [
        [
          {
            "node": "Parse Email Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Lead + Content": {
      "main": [
        [
          {
            "node": "AI: Write Cold Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule: Daily 10AM": {
      "main": [
        [
          {
            "node": "Search Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Valid Email Address?": {
      "main": [
        [
          {
            "node": "Gmail: Send Cold Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark: Invalid Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Website Content": {
      "main": [
        [
          {
            "node": "AI: Score & Enrich Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail: Send Cold Email": {
      "main": [
        [
          {
            "node": "Mark as Contacted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qualified Leads Exist?": {
      "main": [
        [
          {
            "node": "Split In Batches1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Lead (Enriched)": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Score & Enrich Lead": {
      "main": [
        [
          {
            "node": "Parse AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Lead (No Website)": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter by Score Threshold": {
      "main": [
        [
          {
            "node": "Qualified Leads Exist?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Leads from Markdown": {
      "main": [
        [
          {
            "node": "Is Valid Lead?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decodo: Scrape Google Maps": {
      "main": [
        [
          {
            "node": "Parse Leads from Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Lead to Google Sheets": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decodo: Deep Scrape Website": {
      "main": [
        [
          {
            "node": "Merge Lead + Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decodo: Scrape Business Website": {
      "main": [
        [
          {
            "node": "Merge Website Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}