{
  "name": "AI-powered lead generation with Apollo, GPT-4, and Telegram to database",
  "nodes": [
    {
      "id": "e180e9bb-30ed-447e-b89b-1089850392e6",
      "name": "Create URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -1344,
        -208
      ]
    },
    {
      "id": "03a4bd71-1c8b-4f5b-9c91-739715d9364b",
      "name": "Extract Info",
      "type": "n8n-nodes-base.set",
      "position": [
        -896,
        -208
      ]
    },
    {
      "id": "11c65a93-97d9-439f-803a-a25322842976",
      "name": "Only Keep Verified Emails ",
      "type": "n8n-nodes-base.filter",
      "position": [
        -688,
        -208
      ]
    },
    {
      "id": "0917fa22-1695-403a-9cb4-530a111295f2",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        240,
        -128
      ]
    },
    {
      "id": "78c35016-b023-41e0-8e22-21bed4ca62d2",
      "name": "Download File1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2416,
        -384
      ]
    },
    {
      "id": "5f6b4e2e-9ae5-49ae-9bc3-049179d29ca6",
      "name": "Transcribe1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2208,
        -384
      ]
    },
    {
      "id": "8966e2c9-09da-4aba-8f8b-7e005b05595e",
      "name": "Text1",
      "type": "n8n-nodes-base.set",
      "position": [
        -2304,
        -128
      ]
    },
    {
      "id": "ee032f59-9dcb-4136-953d-a4e73fbb1b21",
      "name": "Voice or Text1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2640,
        -288
      ]
    },
    {
      "id": "0555b1fe-c6d3-4fcf-9949-087bda07b5f4",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1984,
        -64
      ]
    },
    {
      "id": "cca9f664-e7fd-489f-ab76-357e69ee8521",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1856,
        -64
      ]
    },
    {
      "id": "e7ae31f1-d91f-4df2-b98c-3405a62d3e8f",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1744,
        -64
      ]
    },
    {
      "id": "549bb2c5-f726-43e1-b997-4b0921a00223",
      "name": "Select already scraped mails",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1136,
        -480
      ]
    },
    {
      "id": "1c082972-95d9-4218-8d55-398a5f8bc006",
      "name": "Keep only the new leads",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        -448,
        -240
      ]
    },
    {
      "id": "76f9769d-7c61-43c7-8bea-5006d965df16",
      "name": "Already scraped",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -96,
        -336
      ]
    },
    {
      "id": "7b7c68cd-0b3f-4b7e-ac52-a527743f359a",
      "name": "Create rows with new leads",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -160,
        -128
      ]
    },
    {
      "id": "46d24870-39b3-41ad-b8d5-e0c8f7d3dc13",
      "name": "Set Telegram message",
      "type": "n8n-nodes-base.set",
      "position": [
        48,
        -128
      ]
    },
    {
      "id": "44f85035-a144-470d-9e9e-f518664ae8f0",
      "name": "Confirmation message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        464,
        -128
      ]
    },
    {
      "id": "6b01d34b-a969-4da6-82b0-74b88ba1b45b",
      "name": "User message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2864,
        -288
      ]
    },
    {
      "id": "94c7143e-4b6a-48a5-bfa8-1533f99ed78e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        -528
      ],
      "parameters": {
        "width": 860,
        "height": 600,
        "content": "# First step: recieve the message via audio or text"
      }
    },
    {
      "id": "e6f0b89f-c519-4d5a-9c0a-c226636f7144",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -528
      ],
      "parameters": {
        "width": 580,
        "height": 600,
        "content": "# Create the json for the url"
      }
    },
    {
      "id": "34f4f9e6-570a-4379-b2a7-740b420d66ac",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2864,
        112
      ],
      "parameters": {
        "width": 1400,
        "height": 800,
        "content": "## Who’s it for\nGrowth hackers, SDR teams, and founders who collect lead requests via Telegram (voice or text) and want those leads scraped, verified, de-duplicated, and stored in a single Supabase ta"
      }
    },
    {
      "id": "d07f9e36-b9ff-4531-b78b-df2c6c554caa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -288
      ],
      "parameters": {
        "width": 880,
        "height": 280,
        "content": "## Scrape the leads from apify actor"
      }
    },
    {
      "id": "e712997f-35f4-45b3-a07b-1b4f38967292",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        48
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "## Insert the new leads to your database\n\n*can be airtable/sheets/supabase"
      }
    },
    {
      "id": "06f13dd9-ba24-47d5-b3be-7f5c3ab95b47",
      "name": "Generate query payload",
      "type": "n8n-nodes-base.set",
      "position": [
        -1536,
        -176
      ]
    },
    {
      "id": "20b67f44-e172-4e68-ba98-d26aad440cc9",
      "name": "Scraper agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1936,
        -288
      ]
    },
    {
      "id": "e71f90ea-9a6e-4617-b321-4eb3f54b3613",
      "name": "Run an Actor",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -1120,
        -208
      ]
    },
    {
      "id": "c1ab0bf6-8224-4de5-a002-3e20b9aeada5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1296,
        64
      ],
      "parameters": {
        "width": 576,
        "height": 560,
        "content": "## Need a tailor-made workflow? Tell me about your business and get a free proposal:\n\n**[Start here → Custom Automation Form](https://taskmorphr.com/contact)**\n\n---\n## 📈 Cost-Savings Snapshot  \nCuriou"
      }
    },
    {
      "id": "ca635bbf-bcc3-4d82-8e14-5e88bf511269",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        464
      ],
      "parameters": {
        "width": 224,
        "height": 128,
        "content": "### 🛠️ Build it yourself  \nBrowse every ready-made workflow:  \n[Full Template Pack — coming soon](https://n8n.io/creators/diagopl/)\n"
      }
    }
  ],
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Confirmation message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text1": {
      "main": [
        [
          {
            "node": "Scraper agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create URL": {
      "main": [
        [
          {
            "node": "Run an Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe1": {
      "main": [
        [
          {
            "node": "Scraper agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Info": {
      "main": [
        [
          {
            "node": "Only Keep Verified Emails ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run an Actor": {
      "main": [
        [
          {
            "node": "Extract Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User message": {
      "main": [
        [
          {
            "node": "Voice or Text1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scraper agent": {
      "main": [
        [
          {
            "node": "Generate query payload",
            "type": "main",
            "index": 0
          },
          {
            "node": "Select already scraped mails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download File1": {
      "main": [
        [
          {
            "node": "Transcribe1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Voice or Text1": {
      "main": [
        [
          {
            "node": "Download File1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Telegram message": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate query payload": {
      "main": [
        [
          {
            "node": "Create URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the new leads": {
      "main": [
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Already scraped",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create rows with new leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Scraper agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create rows with new leads": {
      "main": [
        [
          {
            "node": "Set Telegram message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only Keep Verified Emails ": {
      "main": [
        [
          {
            "node": "Keep only the new leads",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Select already scraped mails": {
      "main": [
        [
          {
            "node": "Keep only the new leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}