Skip to main content
Community template Uses AILead GenerationMultimodal AI

Lead generation agent - n8n workflow template

This workflow is for digital marketing agencies or sales teams who want to automatically find business leads based on industry & location, gather their contact details, and send personalized cold emails — all from one form submission. --- This workflow starts every time someone…

Template by Rakin Jakaria · Original listing (opens in a new tab)

Starts on
Form submission
Nodes
15 nodes
Level
Intermediate
Setup
About 25 min

Workflow preview

How this workflow runs

  1. 1

    On form submission

    Starts the workflow from a public form submission, capturing the submitted fields.

  2. 2

    Google Gemini Chat Model

    Provides Google Gemini as the chat model for the AI steps.

  3. 3

    OpenAI Chat Model

    Provides the OpenAI chat model (GPT) that powers the AI reasoning in this workflow.

  4. 4

    HTTP Request

    Makes an external API call (HTTP request) to send or retrieve data from a third-party service.

  5. 5

    Filter

    Keeps only the items that match a condition and discards the rest.

  6. 6

    Information Extractor

    Handles the Information Extractor step in this workflow.

  7. 7

    If

    Branches the workflow based on a true/false condition.

  8. 8

    Append row in sheet

    Reads from or writes rows to a Google Sheets spreadsheet.

  9. 9

    No Operation, do nothing

    A pass-through step that does nothing — used to organize the flow.

  10. 10

    Loop Over Items

    Loops over items in batches, processing each one in turn (used for iteration).

Creator's notes and setup

Written by Rakin Jakaria for the original listing.

Who this is for

This workflow is for digital marketing agencies or sales teams who want to automatically find business leads based on industry & location, gather their contact details, and send personalized cold emails — all from one form submission.


What this workflow does

This workflow starts every time someone submits the Lead Machine Form. It then:

  • Scrapes business data (company name, website, phone, address, category) using Apify based on business type & location.
  • Extracts the best email address from each business website using Google Gemini AI.
  • Stores valid leads in Google Sheets.
  • Generates cold email content (subject + body) with AI based on your preferred tone (Friendly, Professional, Simple).
  • Sends the cold email via Gmail.
  • Updates the sheet with send status & timestamp.

Setup

To set this workflow up:

  1. Form Trigger – Customize the “Lead Machine” form fields if needed (Business Type, Location, Lead Number, Email Style).
  2. Apify API – Add your Apify Actor Endpoint URL in the HTTP Request node.
  3. Google Gemini – Add credentials for extracting email addresses.
  4. Google Sheets – Connect your sheet for storing leads & email status.
  5. OpenAI – Add your credentials for cold email generation.
  6. Gmail – Connect your Gmail account for sending cold emails.

How to customize this workflow to your needs

  • Change the AI email prompt to reflect your brand’s voice and offer.
  • Add filters to only target leads that meet specific criteria (e.g., website must exist, email must be verified).
  • Modify the Google Sheets structure to track extra info like “Follow-up Date” or “Lead Source”.
  • Switch Gmail to another email provider if preferred.

n8n nodes used (13 types)

What every node does (15)
  • On form submission (Form Trigger)Starts the workflow from a public form submission, capturing the submitted fields.
  • HTTP Request (HTTP Request)Makes an external API call (HTTP request) to send or retrieve data from a third-party service.
  • Information Extractor (Information Extractor)Handles the Information Extractor step in this workflow.
  • Google Gemini Chat Model (LLM Chat Google Gemini)Provides Google Gemini as the chat model for the AI steps.
  • Filter (Filter)Keeps only the items that match a condition and discards the rest.
  • Append row in sheet (Google Sheets)Reads from or writes rows to a Google Sheets spreadsheet.
  • If (If)Branches the workflow based on a true/false condition.
  • No Operation, do nothing (No Op)A pass-through step that does nothing — used to organize the flow.
  • Send a message (Gmail)Sends or reads email through Gmail.
  • Information Extractor1 (Information Extractor)Handles the Information Extractor step in this workflow.
  • OpenAI Chat Model (LLM Chat Open AI)Provides the OpenAI chat model (GPT) that powers the AI reasoning in this workflow.
  • Append or update row in sheet (Google Sheets)Reads from or writes rows to a Google Sheets spreadsheet.
  • Edit Fields1 (Set)Sets or transforms workflow data — prepares, renames, or injects fields before the next step.
  • Loop Over Items (Split In Batches)Loops over items in batches, processing each one in turn (used for iteration).
  • Wait (Wait)Pauses the workflow for a set time or until a condition is met (used for polling / async jobs).

FAQ

Lead generation agent: questions

How do I import the "Lead generation agent" workflow into n8n?

Copy the workflow JSON from this page, open the n8n editor, click on an empty canvas and paste with Ctrl+V (Cmd+V on macOS). You can also download the .json file and choose Import from File in the workflow menu. Save the workflow, then attach credentials before activating it.

Which nodes and credentials does "Lead generation agent" use?

It uses Google Sheets, HTTP Request, If, No Op, Set and Split In Batches, plus 7 more. Any node that connects to an external service needs your own credential — open each node after import and select or create one. Trigger, logic and transformation nodes usually need no credentials.

Can it run on n8n Cloud and on self-hosted n8n?

The workflow format is the same on both. If a node appears as unknown or outdated after import, update n8n to a recent version or, on self-hosted instances, install the required community node package. Features such as $env access are available on self-hosted instances only.

How can I customise "Lead generation agent"?

Start by changing the trigger (schedule, webhook or app event) and the destination nodes to match your stack — it is listed under Lead Generation, Multimodal AI. Edit prompts, field mappings and filters in the relevant nodes, use expressions like {{ $json.field }} to map data, and test with a manual execution before activating.

n8n is a trademark of n8n GmbH. AltFTool is not affiliated with, endorsed by or sponsored by n8n. Community templates are credited to their creators and link to the original listing; AltFTool originals are written and tested by the AltFTool team.

About this page

Free n8n workflow templates to copy and import

The AltFTool n8n library collects free n8n workflow templates for AI agents, Gmail, Google Sheets, Telegram and other apps. Each workflow page shows a preview, the list of nodes and the credentials it needs, and lets you copy or download the JSON to import into your own n8n.

Search the templates by app or task, or browse them by category and by node. The Workflow Inspector checks any workflow JSON for triggers, credentials and hardcoded keys before you share it, and the expressions cheat sheet gives copy-paste n8n expression examples. AltFTool is not affiliated with n8n.

People also search for

  • n8n workflow templates
  • n8n templates
  • n8n automation examples
  • n8n json workflows
  • n8n nodes
  • free n8n workflow templates
  • n8n ai agent template
  • n8n expressions cheat sheet