Telegram Lead Gen AI Agent
Use voice or text commands in Telegram to scrape leads or generate LinkedIn research reports
- Who
- Cold emailers, growth marketers, solo founders, or SDRs who need automated lead generation
- You get
- Send voice or text to a Telegram bot; the AI Agent calls Apollo to save leads into Google Sheets, or creates a research report from a LinkedIn URL
Constraints
Import the official n8n template, configure Telegram Bot, OpenAI, and Apollo credentials, set the Lead Agent system prompt, then deploy and trigger via Telegram. Requires an n8n instance; sub-workflows leadScraping and leadResearch must be prepared separately or replaced with your own implementation.
What they did
Author Abdul Mir published this workflow template in the n8n official template library. The template uses a Telegram Bot as the entry point, parses user intent via an AI Agent, calls Apollo to scrape leads into Google Sheets, or generates a research report from a LinkedIn URL. The workflow includes a complete node chain: voice transcription (Whisper), text/voice routing, Agent decision, tool invocation, and Telegram response.
How it went
The template has 7,374 views on n8n and is marked as published. The author describes it as responding instantly to voice or text commands, outputting a contact spreadsheet or a PDF-style research brief. (author_report)
Worth knowing
1. This template only contains the main orchestration workflow; leadScraping and leadResearch are external sub-workflow references that users must prepare or replace. 2. The default workflowIds (IPhiwjZXcxi0UDSf and LAvUyCmqSnNmVrjk) are not included in the current snapshot and may not work after direct import. 3. Apollo API usage incurs costs and must be used in compliance with terms. 4. Email delivery of research reports is likely handled inside the sub-workflow and is not visible in the main workflow. 5. This site has not tested the workflow; reproduction=not_tested.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenAI Chat Model node: connect OpenAI API credentials.
- Download File node: connect Telegram API credentials.
- Transcribe node: connect OpenAI API credentials.
- Response node: connect Telegram API credentials.
- Error Response node: connect Telegram API credentials.
- Telegram Trigger node: connect Telegram API credentials.
Configuration to replace
- Source template is n8n public workflow #6532 (~20 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Prepare prerequisites
Ensure you have: a Telegram Bot Token (from @BotFather), an OpenAI API Key, an Apollo API Key or alternative scraping tool credentials, and a Google Sheet to receive leads.
Configure the Telegram trigger
After importing the template, open the Telegram Trigger node and select your Telegram credential. Confirm that updates includes message so the workflow receives both text and voice messages.
Configure OpenAI and the model
In the OpenAI Chat Model node, select gpt-4o and bind your openAiApi credential. The same credential is used by the Transcribe node for Whisper voice-to-text.
Configure the Lead Agent system prompt and sub-workflows
Open the Lead Agent node, confirm promptType is define, and set the system prompt as follows. This prompt defines the Agent as Sam Ovens, who uses leadScraping and leadResearch tools to execute lead scraping and LinkedIn research. Note: spaces in search queries must be replaced with '+'.
Execution prompt · Source text。Lead Agent node systemMessage field (promptType=define)
=# Overview You are Sam Ovens, a lead generation agent, responsible for scraping and researching leads. # Tools ### leadScraping: Use this tool to scrape leads into a Google Sheet. Only call this tool once you have enough information to complete the desired JSON search query. ### leadResearch: Use this tool to research a lead by their linkedIn URL. # Rules: - Ask clarifying questions if you're unsure about something. - Ask questions to gather enough information to satisfy the query for each of the tools. - You should introduce yourself as "Sam Ovens" and ask the user what leads they want to scrape today. - Always replace spaces with '+' in your search queries. For example, instead of "los angeles united states", your query should be "los+angeles+united+states". - You always need a linkedIn URL to research a lead. - You can only research one person at a time. - Feel free to be lighthearted and funny. - Make sure you always call the tools with correct JSON formatting, but don't wrap the query in ```json```. # Example - Input: "Hi" - Output: "Sam Ovens here, the god of B2B outreach. Which leads can I help you scrape today? Just tell me the locations, Business and job titles and I'll handle the rest! " - Input: "Let's do \n Locations: \n - Chicago United States \n - Sydney Australia \n\n Business: \n - Financial Planners \n] - Output: "Awesome. I think you forgot the job titles. Which job titles should I search for?" - Input: "Only CEOs please" - Call leadScrape tool with query: [ { "location": [ "chicago+united+states", "sydney+australia" ], "business": [ "financial+planner" ], "job_title": [ "ceo" ] } ] - Input from tool: "25 new contacts have been added to the Google Sheet!" - Output: "Done! I've added 25 new contacts to the Google Sheet. Let me know if you need anything else!"Configure tool nodes and test
Inspect the leadScraping and leadResearch toolWorkflow nodes: the former must point to an actual lead-scraping sub-workflow (default workflowId=IPhiwjZXcxi0UDSf), and the latter to a research sub-workflow (default workflowId=LAvUyCmqSnNmVrjk). Replace the workflowIds with your own implementations if needed. The Simple Memory node is already configured to use the Telegram chat ID as sessionKey. Save, activate the workflow, and test by sending a text or voice message to your Telegram bot.
Execution prompt · Source text。leadScraping node description field, used by the Agent to understand input format
Call this tool to scrape leads once you have enough details about the search query. Your input must be in json like this: [ { "location": [ "LOCATION1+HERE", "LOCATION2+HERE", ... ], "business": [ "BUSINESS1+HERE", "BUSINESS2+HERE", ... ], "job_title": [ "TITLE1+HERE", "TITLE2+HERE", ... ] } ]Execution prompt · Source text。leadResearch node description field, used by the Agent to understand input format
Call this tool to research leads. the input should be their linkedin URL in the following format: { "linkedinURL": "[URL-HERE]" }
Prompt you can copy
Setup guidance · Editorial suggestion。Setup assistant starter prompt to confirm inputs, permissions, and sub-workflow readiness
This block is the prompt. Ads are never placed here.
You are setting up an n8n-based Telegram AI Agent to automatically scrape leads or generate LinkedIn research reports. Confirm you have all credentials and sub-workflows ready, then import the template and configure nodes step by step.
First confirm Telegram Bot Token, OpenAI Key, Apollo Key, and Google Sheets are ready; then check whether leadScraping/leadResearch sub-workflows are available or need replacement
Source
Lead gen agent (Telegram) · abdulmir · n8n.io · 2025-07-27
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.