Automate Lead Generation with n8n: Complete Marketing Workflow Guide
Build automated lead generation systems with n8n. Capture leads from websites, social media, and ads. Qualify, score, and route leads to your CRM automatically. Full implementation guide.

Automate Lead Generation with n8n: The Complete Marketing Workflow Guide
Lead generation is the lifeblood of any business. But manually moving leads between forms, spreadsheets, and CRMs wastes hours every week. With n8n, you can build a fully automated lead generation pipeline that captures, qualifies, and routes leads — while you focus on closing deals.
The Automated Lead Pipeline: Overview
Lead Sources → Capture → Enrichment → Scoring → Routing → CRM
↓ ↓ ↓ ↓ ↓ ↓
Web forms Webhooks Clearbit AI Score Rules HubSpot
Social APIs Apollo Points Round Salesforce
Ads Email LinkedIn Tags Robin Pipedrive
Step 1: Capture Leads from Every Channel
Web Form Capture
// n8n Webhook node receives form submissions
// POST https://your-n8n.com/webhook/lead-capture
{
"name": "Jane Smith",
"email": "[email protected]",
"company": "Acme Corp",
"source": "website_form"
}
Connect your forms:
- Typeform / Jotform → Webhook
- HubSpot / WordPress forms → Native integration
- Custom HTML forms → Direct webhook POST
Social Media Lead Capture
- LinkedIn — Monitor comments and DMs for lead signals
- Twitter/X — Track mentions and relevant hashtags
- Facebook Lead Ads — Native integration available
- Instagram — Comment-to-DM automation
Ad Platform Integration
- Google Ads — Sync offline conversions back to campaigns
- Meta Ads — Instant lead alerts when someone fills a lead form
- LinkedIn Ads — Capture lead gen form submissions
Step 2: Enrich Lead Data
Raw form data rarely tells the full story. Use data enrichment APIs:
// Enrichment workflow in n8n
const email = $input.item.json.email;
// 1. Clearbit — company info, role, social profiles
const clearbitData = await fetch(`https://person.clearbit.com/v2/people/find?email=${email}`);
// 2. Hunter.io — verify email validity
const hunterData = await fetch(`https://api.hunter.io/v2/email-verifier?email=${email}`);
// 3. Apollo.io — technographics and buying signals
const apolloData = await fetchApolloEnrichment(email);
return {
...$input.item.json,
enriched: {
company_size: clearbitData.company.metrics.employees,
industry: clearbitData.company.category.sector,
email_valid: hunterData.data.status === 'valid',
tech_stack: apolloData.technologies
}
};
Key enrichment data points:
- Company size and industry
- Job title and seniority
- Technology stack (useful for SaaS companies)
- Funding status and recent news
- Social media profiles
Step 3: AI-Powered Lead Scoring
Manual lead scoring is inconsistent. Let AI do it:
// AI lead scoring prompt
const prompt = `
Score this lead from 1-100 based on fit:
- Company size: ${lead.enriched.company_size}
- Industry: ${lead.enriched.industry}
- Role: ${lead.enriched.job_title}
- Source: ${lead.source}
Ideal customer profile:
- B2B SaaS companies, 50-500 employees
- Marketing, Sales, or Operations roles
- US/Europe based
Return JSON: {"score": number, "tier": "A"|"B"|"C", "reasoning": "string"}
`;
// Call OpenAI/Anthropic node
const score = await aiNode.score(prompt);
Tier-based routing:
- A-tier (80-100): Instant Slack/email alert to sales team
- B-tier (50-79): Enter automated nurture sequence
- C-tier (0-49): Archive with 90-day follow-up
Step 4: Automated Lead Routing
Route leads based on territory, product, or deal size:
// Smart routing logic
const lead = $input.item.json;
const routingRules = {
'US_Enterprise': lead.country === 'US' && lead.enriched.company_size > 500,
'EMEA': ['UK', 'DE', 'FR', 'NL'].includes(lead.country),
'SMB': lead.enriched.company_size <= 100,
'default': 'General Sales Queue'
};
const route = Object.entries(routingRules)
.find(([key, condition]) =>
typeof condition === 'boolean' ? condition : condition) || routingRules.default;
// Assign to specific sales rep or round-robin
Step 5: CRM Sync and Follow-up
Push everything to your CRM automatically:
HubSpot Integration
Webhook → Data Enrichment → AI Scoring → HubSpot Create/Update Contact
- Create or update contact with all enriched data
- Add to appropriate deal pipeline stage
- Log source attribution for ROI tracking
- Trigger HubSpot workflows (email sequences, tasks)
Salesforce / Pipedrive
Same pattern — n8n has native nodes for all major CRMs:
- Salesforce: Full CRUD operations, custom objects
- Pipedrive: Deals, persons, organizations, activities
- Zoho CRM: Modules, records, workflows
- Custom CRM: HTTP Request node + REST API
Complete Workflow: Lead to Meeting
Here's the end-to-end automation:
- Form submitted → Webhook captures data
- Email verified → Hunter.io check
- Data enriched → Clearbit + Apollo
- AI scores lead → GPT-4 classification
- CRM updated → HubSpot contact created
- Sales notified → Slack message with lead summary
- Calendar link sent → Automated email with booking link
- Nurture triggered → If no response in 48 hours, follow-up sequence
Advanced Patterns
Pattern 1: Intent-Based Lead Scoring
Monitor your website for buying signals:
- Visited pricing page 3+ times in 7 days → +20 points
- Downloaded whitepaper → +15 points
- Viewed case studies → +10 points
- Chatbot conversation indicated interest → +25 points
Pattern 2: Competitor Intent Leads
// Capture leads researching competitors
const competitorKeywords = ['alternative to Salesforce', 'Zapier competitor', 'Make vs'];
const searchQuery = $input.item.json.search_term;
if (competitorKeywords.some(kw => searchQuery.includes(kw))) {
return { ...lead, competitor_intent: true, score: '+30' };
}
Pattern 3: Re-engagement Automation
For cold leads that haven't engaged in 90 days:
- AI analyzes their original interest
- Generates personalized re-engagement email
- Includes relevant case study or new feature announcement
- If they click, score resets and lead re-enters active pipeline
Measuring ROI
Track these metrics in your automation:
- Leads captured per channel (weekly/monthly)
- Enrichment rate (% of leads with complete data)
- Score distribution (A/B/C tier breakdown)
- Time-to-contact (lead capture → first sales touch)
- Conversion rate by source (which channels produce quality)
- Pipeline velocity (days from lead → opportunity → closed)
Getting Started Today
- Start with one lead source (your website form)
- Add email verification
- Set up basic CRM sync
- Add AI scoring once you have 100+ historical leads
- Expand to additional channels
Browse our Lead Generation workflow collection for ready-to-import templates, or explore premium lead nurturing workflows for advanced automation.
Share this article
Help others discover n8n automation tips and tricks
Related Articles

n8n CRM Automation: Connect Your Sales Stack Without Code
Automate your entire CRM workflow with n8n. Sync contacts across HubSpot, Salesforce, and Pipedrive. Automate lead routing, deal tracking, and follow-ups. Complete integration guide.

AI Content Creation Pipeline with n8n: From Idea to Published Automatically
Build an end-to-end AI content creation pipeline with n8n. Automate research, writing, editing, image generation, and publishing across blogs, social media, and newsletters.

Social Media Automation with n8n: Cross-Platform Workflow Templates
Automate your social media marketing with n8n. Cross-post to multiple platforms, schedule content, monitor mentions, generate AI-powered posts, and analyze performance — all automated.
