Templates / AI-powered lead generation with Apollo, GPT-4, and Telegram to database

AI-powered lead generation with Apollo, GPT-4, and Telegram to database

Needs changes

by Paul ✓ · 12,062 views · created 2025-07-02 · Lead Generation, AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 21 nodes and runs on Telegram events (message). Along the way it connects Telegram, OpenAI, OpenAI Chat Model and Postgres and 2 more.

How it runs

Trigger: On Telegram events (message).

  1. Voice or Text (Switch): routes items into 2 branches
  2. Download File (Telegram): work with file
  3. Text (Edit Fields (Set)): sets 1 field: text
  4. Transcribe (OpenAI): transcribe (audio)
  5. Scraper agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; memory: Simple Memory; output parser: Structured Output Parser
  6. Generate query payload (Edit Fields (Set)): sets or maps fields
  7. Select already scraped mails (Postgres): select
  8. Create URL (Code): runs custom JavaScript code
  9. Keep only the new leads (Compare Datasets): uses Compare Datasets
  10. Run an Actor (Apify): run actor

…plus 6 more steps. See the full node list below.

Services it uses

TelegramOpenAIOpenAI Chat ModelPostgresSupabaseApify (community)

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in Scraper agent (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
AI Agent v1 (old agent modes)
Scraper agent (v1.9)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (17)

From the author

AI-Powered Lead Generation with Apollo, GPT-4, and Telegram to Database Overview This intelligent lead generation workflow transforms voice commands or text input into verified prospect lists through automated Apollo.io scraping. The system processes natural…

Excerpt from Paul's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.