Stop spending hours on manual prospecting. We all know the drill: endless LinkedIn scrolling, copying and pasting names, hunting for email addresses, and then struggling to write a personalized message. It’s a time-consuming bottleneck that kills sales productivity. What if you could automate the entire process? With this free n8n lead generation template, you can.

This powerful workflow transforms your n8n instance into an on-demand B2B lead generation machine. Just send a single chat message like “SaaS Marketing Directors in London,” and this template will search, scrape, enrich, and deliver a list of qualified leads—complete with AI-written personalized icebreakers—directly to your Google Sheet.

A workflow diagram for the n8n lead generation template, showing nodes for chat, scraping, AI, and Google Sheets.

🚀 The Benefits: Why This Template is a Game-Changer

  • Massive Time Savings: Automate 90% of your top-of-funnel prospecting. What used to take a full day can now be done in minutes while you focus on closing deals.
  • Skyrocket Your Reply Rates: Generic emails get ignored. This template uses Google Gemini to write a unique, relevant, and professional opening sentence for every single prospect based on their real data.
  • Superior Lead Quality: The workflow automatically filters out prospects without a valid email address, ensuring you only get high-quality, actionable contacts.
  • Rich Data Enrichment: Go beyond just a name and email. This template enriches each lead with their company’s description, industry, and size, giving your sales team valuable context.
  • Scalable & On-Demand: Need a new list? Just send a new chat message. It’s that simple. Generate leads as you need them, 24/7.

⚙️ How It Works: A Look Under the Hood

This workflow is a smart assembly line for B2B leads. Here’s the step-by-step process:

  1. Chat Trigger: It all starts when you send a query (e.g., “Find me ‘Head of Sales’ at retail companies”) via the n8n chat.
  2. Google Search: The template takes your query and uses Apify to perform an advanced Google search for LinkedIn profiles that match.
  3. Profile Scraping: It processes each search result and uses a scraping API (LinkFinderAI in this template) to extract crucial data: name, job title, company, location, and most importantly, their email address.
  4. Smart Qualification: An IF node automatically checks if an email was found. If not, the prospect is discarded, so your final list is clean.
  5. Company Enrichment: For every valid lead, the workflow finds their company’s LinkedIn profile and scrapes it for key data like company description, industry, and size.
  6. AI Personalization: This is the magic. All the prospect and company data is fed to a Google Gemini AI agent. The AI uses a sophisticated prompt to write a compelling, 15-25 word personalized opening line.
  7. Save to Google Sheets: Finally, all this rich data—prospect info, company details, and the custom AI icebreaker—is neatly saved as a new row in your designated Google Sheet.
Example output from the n8n lead generation template in a Google Sheet.

🛠️ Your 5-Minute Setup Guide

This template is “plug-and-play.” You just need to connect your API keys.

  1. Download & Import: Download the free workflow JSON file from this page. In your n8n instance, go to “Workflows” > “Import from File” and upload it.
  2. Configure Credentials: This is the only manual step. You need to add your credentials for the services this workflow uses.
    • Google Sheets Node: Select your Google Sheets OAuth credential from the dropdown (or create one). Then, paste in the Document ID of your Google Sheet and the Sheet Name (e.g., “Sheet1”).
    • Google Gemini Node: Select your Google Gemini (PaLM) API credential. You can get a free API key from Google AI Studio.
    • Apify (HTTP Request Node): Select the “HTTP Request36” node. Paste your Apify API token directly into the URL where it says token=YOUR_TOKEN_HERE.
    • LinkFinderAI (HTTP Request Nodes): This template uses three nodes for scraping (“Profile Linkedin scraper,” “Company Linkedin url,” “Company Linkedin scraper”). In each one, click the “Headers” tab and add your Authorization token (e.g., “Bearer YOUR_API_KEY”).
  3. Activate Workflow: Click the “Active” toggle in the top-right corner.
  4. Run Your First Query: Open the Chat in n8n (bottom-right icon), type your prospect query, and watch the leads roll into your Google Sheet!

💸 A Note on Costs: Free Template, Pay-As-You-Go Services

While this n8n lead generation template is 100% free, it relies on powerful third-party APIs to function. This pay-as-you-go model is far cheaper than most all-in-one SaaS platforms.

You will need active accounts for:

  • Apify: For Google Search scraping.
  • LinkFinderAI: For LinkedIn profile and company scraping. (You can swap this out for any other scraping service, like BrightData or ScrapingBee, by just changing the HTTP Request nodes. Check out our guide to web scraping for more options).
  • Google Gemini: For AI personalization (offers a generous free tier).
  • n8n: This workflow runs on your n8n instance. If you’re not already using n8n, you can get started for free on their cloud or self-hosted plans.

This setup gives you full control and transparency over your costs. For more complex workflows, you might want to explore our full automation services.

⚡ Download Your Free Template Today

AI-Powered B2B Lead Generation & Personalization Engine n8n template

AI-Powered B2B Lead Generation & Personalization Engine n8n template

An automated n8n workflow that turns a simple chat query (e.g., "SaaS Marketing Directors in London") into a Google Sheet full of enriched B2B leads, complete with AI-written personalized openers for outreach.

❓ Frequently Asked Questions (FAQ)

Can I use OpenAI (ChatGPT) instead of Google Gemini?

Absolutely! Simply delete the “Google Gemini Chat Model” node and replace it with an “OpenAI Chat Model” node. Connect it to the “AI Agent” node and copy the system prompt from the Gemini node into the OpenAI node.

Can I use a different scraping API?

Yes. This template is API-agnostic. You can use any scraping service (like BrightData, ScrapingBee, etc.) by replacing the “HTTP Request” nodes. Just make sure you update the URL, headers, and body to match your new provider’s API documentation.

Is scraping LinkedIn profiles allowed?

This is a complex topic. This template scrapes data from Google Search results and uses third-party services that aggregate public data. You are responsible for how you use this template. Always comply with the terms of service of any website or API you use and respect data privacy regulations like GDPR.

How many leads can I generate?

This depends entirely on the limits of your API subscriptions (Apify, LinkFinderAI). The workflow itself can process thousands of leads.

Ready to stop prospecting and start selling? Download the free n8n workflow file and set up your automated lead-gen engine in under 5 minutes.

Have questions or want to share how you’ve customized this workflow? Drop a comment below!

Launch Your 24/7 AI Instagram DM Chatbot (n8n + Gemini)