{
  "$schema": "https://promptfoo.tech/schemas/workflow-template.json",
  "name": "n8n: Live Lead Scoring with AI + Firmographic Enrichment",
  "slug": "n8n-crm-lead-scoring-live",
  "platform": "n8n",
  "category": "n8n",
  "difficulty": "Advanced",
  "tags": [
    "n8n",
    "sales",
    "hubspot",
    "openai"
  ],
  "summary": "Enrich every new lead with Clearbit/Apollo data, score with an AI-graded fit + intent model, and update HubSpot in real time.",
  "overview": "Manual lead scoring drifts and gets ignored. This n8n workflow enriches every inbound lead with firmographic data, runs a two-part AI grade (fit + intent), and writes back a score, tier, and one-line rationale to HubSpot. SDRs open leads pre-ranked with reasoning attached.",
  "variables": {
    "WEBHOOK_URL": "<your webhook URL>",
    "API_KEY": "<your provider API key>",
    "OPENAI_API_KEY": "sk-..."
  },
  "steps": [
    {
      "order": 1,
      "name": "Define your ICP as data",
      "description": "Employee count band, industries, tech stack signals, geographies. This becomes a JSON block in your prompt."
    },
    {
      "order": 2,
      "name": "Enrichment step",
      "description": "Clearbit / Apollo API. Fall back to a domain lookup if email is generic (gmail, yahoo)."
    },
    {
      "order": 3,
      "name": "Prompt A — fit",
      "description": "System: ICP JSON. User: enriched lead. Return {score, reasons[]}. Small model is enough."
    },
    {
      "order": 4,
      "name": "Prompt B — intent",
      "description": "Include form text, UTM source, and last-30-day event history if you have it. Return {score, signals[]}."
    },
    {
      "order": 5,
      "name": "Composite + tier",
      "description": "Weight fit 60% / intent 40%. Tier: A ≥ 8, B 5-7, C < 5. Or tune from historical data."
    },
    {
      "order": 6,
      "name": "Write back to HubSpot",
      "description": "Update fit_score, intent_score, tier, and a Note with the reasoning. Notify SDR channel for A-tier only."
    }
  ],
  "howItWorks": [
    "HubSpot webhook on contact creation.",
    "Enrich with Clearbit (or Apollo) via email → company, size, industry, tech stack.",
    "Prompt A (fit): score 0-10 vs ICP with rationale.",
    "Prompt B (intent): score 0-10 from form message + UTM + pages viewed.",
    "Composite score → tier A/B/C → write to HubSpot with rationale in a note."
  ],
  "benefits": [
    "SDRs focus on A-tier only — response rate 2-3x.",
    "Consistent, explainable scoring across the team.",
    "Rationale in the note satisfies compliance and helps handoffs."
  ],
  "useCases": [
    "B2B SaaS with inbound-heavy pipelines.",
    "PLG motions where sales-assist matters on a subset.",
    "Consultancies filtering low-fit inquiries automatically."
  ],
  "example": "Lead: 'Head of Ops, 240-person e-commerce brand, message mentions returns automation'. Fit: 9 (ICP match). Intent: 8 (specific pain, right title). Tier A. SDR pinged.",
  "faqs": [
    {
      "q": "Can I skip Clearbit?",
      "a": "Yes — Apollo, PDL, or a domain lookup + LinkedIn scraping alternative. Enrichment quality directly drives score quality."
    },
    {
      "q": "Model bias?",
      "a": "Very real. Audit A-tier vs won-deal correlation monthly. Update the ICP JSON, not the prompt scaffolding."
    },
    {
      "q": "GDPR?",
      "a": "Only enrich B2B business emails. Consumer emails: skip enrichment and score on form data only."
    }
  ],
  "source": "https://promptfoo.tech/workflows/n8n-crm-lead-scoring-live",
  "updated": "2026-06-07",
  "license": "CC-BY-4.0"
}