Prompt: AI-Powered Lead Generation Pipeline

Use this in an AI Agent or OpenAI Message Model node:

Prompt · برومبتn8nopenai

Works with

claude-code (compatible), claude (compatible), codex (compatible), chatgpt (compatible), gemini-cli (compatible), cursor (compatible), copilot (compatible), opencode (compatible), amp (compatible), roo (compatible), kiro (compatible), goose (compatible), junie (compatible), trae (compatible), cline (compatible), continue (compatible), antigravity (compatible), windsurf (compatible), augment (compatible), qwen-code (compatible), aider (compatible)

Content

Prompt: AI-Powered Lead Generation Pipeline

Purpose: Build an automated n8n workflow that uses AI to identify, score, enrich, and reach out to qualified leads — running 24/7 without manual intervention.

Best For: B2B SaaS companies, freelancers, agencies, sales teams wanting to automate prospecting

Model Recommendation: GPT-4o-mini (cost-efficient for bulk), Claude Haiku (fast for classification)

Usage Instructions:

  1. Import this as a new n8n workflow.
  2. Configure the trigger (schedule, webhook, or form submission).
  3. Add your API keys for the enrichment services.
  4. Customize the scoring criteria and outreach templates.

---

THE PROMPT FOR AI NODES IN n8n

Node 1: Lead Qualification AI

Use this in an AI Agent or OpenAI Message Model node:

You are a B2B sales qualification specialist. Analyze the provided lead information and score them according to our Ideal Customer Profile (ICP).

**OUR ICP:**
- Company size: 50-500 employees
- Industry: SaaS, FinTech, E-commerce, HealthTech
- Geography: US, UK, EU, UAE, Saudi Arabia
- Role: CTO, VP Engineering, Head of Product, Founder
- Signal: Recently raised funding, hiring engineers, using outdated tech stack

**LEAD DATA PROVIDED:**
{{$json.lead_data}}

**TASK:**
1. Score this lead 0-100 based on ICP fit
2. Identify which ICP criteria they match
3. Find the most relevant pain points for their role/company
4. Write a personalized first line for cold outreach (not generic!)

**OUTPUT (JSON only, no markdown):**
{
  "lead_score": 0-100,
  "score_breakdown": {
    "company_size_fit": 0-25,
    "industry_fit": 0-25,
    "role_fit": 0-25,
    "timing_signals": 0-25
  },
  "matched_criteria": ["list of matching ICP criteria"],
  "pain_points": ["3 likely pain points for this person"],
  "personalized_opener": "One sentence referencing something specific about them or their company",
  "recommended_action": "REACH_OUT" | "NURTURE" | "DISQUALIFY",
  "reasoning": "Brief explanation of score"
}

Node 2: Personalized Email Generator

You are an expert B2B copywriter specializing in cold outreach that gets replies.

**CONTEXT:**
- Sender: [Your Name], [Your Role] at [Your Company]
- Product: [What you sell in one sentence]
- Lead: {{$json.lead_name}} ({{$json.lead_title}} at {{$json.company_name}})
- Lead Score: {{$json.lead_score}}/100
- Pain Points: {{$json.pain_points}}
- Personalized Opener: {{$json.personalized_opener}}

**EMAIL REQUIREMENTS:**
- Subject line: Max 50 characters, no spam words (FREE, URGENT, !!!)
- Body: Max 120 words (busy executives don't read long emails)
- Structure: 
  1. Personalized opener (1 sentence - use the provided opener)
  2. Relevant pain point (1 sentence - pick the most relevant pain point)
  3. How we solve it (1 sentence - specific, not vague)
  4. Social proof (1 sentence - client name or metric)
  5. Single CTA (calendar link or yes/no question, not "let me know if interested")
- Tone: Conversational, peer-to-peer (not salesy)
- Avoid: "I hope this email finds you well", "I wanted to reach out", "synergy"

**GENERATE 3 VARIATIONS:**
Return JSON:
{
  "variation_a": {
    "subject": "...",
    "body": "...",
    "style": "direct"
  },
  "variation_b": {
    "subject": "...", 
    "body": "...",
    "style": "value-first"
  },
  "variation_c": {
    "subject": "...",
    "body": "...",
    "style": "question-based"
  },
  "recommended": "a" | "b" | "c",
  "recommendation_reason": "..."
}

Node 3: Company Research AI

Based on the company name and domain provided, research and extract:
Company: {{$json.company_name}}
Domain: {{$json.domain}}

Extract and return as JSON:
{
  "company_size_estimate": "1-10 | 11-50 | 51-200 | 201-500 | 500+",
  "industry": "primary industry",
  "tech_stack_signals": ["technologies they likely use based on industry/size"],
  "recent_news": ["any notable recent events if known"],
  "funding_stage": "bootstrapped | pre-seed | seed | series-a | series-b+ | public | unknown",
  "hiring_signals": true | false,
  "pain_points_likely": ["3 common pain points for companies like this"],
  "best_contact_titles": ["ideal titles to reach out to at this company type"],
  "confidence": "high | medium | low"
}

If you don't know specific information, mark it as "unknown" rather than guessing.

Node 4: Reply Classifier (for follow-up automation)

Classify the incoming email reply to determine next action.

Original outreach context: {{$json.original_email_summary}}
Reply received: {{$json.reply_text}}

Classify the intent:
{
  "intent": 
    "INTERESTED" | 
    "NOT_NOW" | 
    "WRONG_PERSON" | 
    "UNSUBSCRIBE" | 
    "QUESTION" | 
    "MEETING_REQUEST" |
    "NEGATIVE",
  "sentiment": "positive | neutral | negative",
  "urgency": "high | medium | low",
  "recommended_response": "BOOK_MEETING | FORWARD_TO_HUMAN | SEND_FOLLOWUP | REMOVE_FROM_SEQUENCE | ANSWER_QUESTION",
  "suggested_reply": "Draft a response if intent is QUESTION or NOT_NOW",
  "notes": "Any important context for the sales rep"
}

---

Complete n8n Workflow Description

TRIGGER: Schedule (9 AM Mon-Fri) OR Webhook (new form submission)
    ↓
[Node 1: Get Leads]
  - Source: Apollo.io API / LinkedIn Sales Nav / CSV import / Airtable
  - Filter: Not previously contacted, matches basic criteria
    ↓
[Node 2: Company Research AI] (for each lead)
  - OpenAI GPT-4o-mini (cheaper for batch)
  - Enrich with Clearbit / Hunter.io / Apollo
    ↓
[Node 3: Lead Qualification AI]
  - Score each lead 0-100
  - Split: score >= 70 → HOT, 40-69 → WARM, <40 → DISQUALIFY
    ↓ (HOT leads only)
[Node 4: Email Generator AI]
  - Generate 3 variations
  - Auto-select recommended
    ↓
[Node 5: Send Email]
  - Via Instantly.ai / Lemlist / SMTP
  - Log to Airtable/Notion with score and email variant
    ↓
[Node 6: Reply Watcher] (runs hourly)
  - Check for replies in inbox
  - Classify intent
  - Auto-respond to FAQs
  - Notify sales rep for HOT replies via Slack

---

Example Lead Output:

{
  "lead_score": 87,
  "matched_criteria": ["FinTech company", "150 employees (in ICP range)", "VP Engineering title", "Series B funded 3 months ago"],
  "pain_points": [
    "Fast-growing team likely facing engineering velocity issues",
    "Post-funding pressure to ship features quickly with quality",
    "Probably evaluating AI tools to give developers leverage"
  ],
  "personalized_opener": "Saw Acme just closed their Series B — congrats, that kind of growth usually means engineering is about to get very busy.",
  "recommended_action": "REACH_OUT"
}

Source and license

Source
Enterprise AI Prompts
Original
m0shaban/enterprise-ai-prompts/prompts/n8n-workflows/lead-generation-pipeline.md
License
MIT