Skip to main content

Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram

Workflow preview

Workflow preview
100%
Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Description A customized n8n workflow inspired by the Lead Generation Agent template. It automates B2B lead scraping via Apify , extracts contact emails with AI , sends cold emails via Gmail , a...

Best for

  • Lead Generation automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegram, n8n-nodes-base.googlesheets, n8n-nodes-base.if, n8n-nodes-base.filter, n8n-nodes-base.gmail, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.informationextractor

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Adem Tasin.

Original n8n.io source

1.1 Workflow description

Title
Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram
Workflow name
Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram

đź§© Description

A customized n8n workflow inspired by the Lead Generation Agent template.
It automates B2B lead scraping via Apify, extracts contact emails with AI, sends cold emails via Gmail, and logs every interaction in Google Sheets with Telegram alerts for live monitoring.


đź§  How It Works

This workflow automates the entire B2B lead generation and outreach process from data collection to email delivery.
Once you enter your search keyword and location, the system scrapes business details using Apify, filters valid websites, and extracts email addresses with AI. Each lead is then enriched and logged in Google Sheets.

The workflow automatically composes a personalized cold email based on your preferred tone (friendly, simple, or professional) and sends it through Gmail with short delays between each message to avoid spam filters.
You’ll also receive Telegram notifications to monitor progress and any leads that fail to send.


⚙️ Setup Steps

  1. Clone the workflow into your n8n instance.
  2. Add your API credentials:
    • Apify API Token
    • OpenAI (or Gemini) API Key
    • Google Sheets & Gmail account connections
    • Telegram Bot Token + Chat ID (optional)
  3. Open the Form node or Manual Trigger, and set your search criteria (e.g., “marketing agencies in London”).
  4. Configure your Google Sheet — make sure the columns match the node mapping.
  5. Adjust the AI prompt in the OpenAI node if you want a different tone or style for your emails.
  6. Run the workflow manually to test one or two leads first.
  7. Once confirmed, activate scheduling or keep it manual for on-demand lead generation.

🚀 Try It Out!

Experience how AI and automation can take over your lead generation workflow.
Just enter a business type and location, and watch as the system finds potential clients, extracts contact details, crafts a personalized cold email, and sends it — all without manual effort.
Perfect for freelancers, agencies, or anyone looking to automate their B2B outreach process.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send a text message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 2 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Filter

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 5 - Append or update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 6 - Send a message

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 7 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - Information Extractor1

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1.2

Block 10 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 11 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 12 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 13 - Information Extractor

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1.2

Block 14 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 16 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram
Complexity advanced
Nodes 22
Categories Lead Generation, AI Chatbot
Author Adem Tasin
Published 17 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9816/9816.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated B2B lead generation & cold emails with OpenAI, Apify, Gmail & Telegram do?

Description A customized n8n workflow inspired by the Lead Generation Agent template. It automates B2B lead scraping via Apify , extracts contact emails with AI , sends cold emails via Gmail , a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, AI Chatbot use case.