# n8n: Live Lead Scoring with AI + Firmographic Enrichment

> Enrich every new lead with Clearbit/Apollo data, score with an AI-graded fit + intent model, and update HubSpot in real time.

**Platform:** n8n  
**Category:** n8n  
**Difficulty:** Advanced  
**Tags:** n8n, sales, hubspot, openai  
**Updated:** 2026-06-07  
**Source:** https://promptfoo.tech/workflows/n8n-crm-lead-scoring-live

## 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.

## How it works
1. HubSpot webhook on contact creation.
2. Enrich with Clearbit (or Apollo) via email → company, size, industry, tech stack.
3. Prompt A (fit): score 0-10 vs ICP with rationale.
4. Prompt B (intent): score 0-10 from form message + UTM + pages viewed.
5. 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.

## Use cases
- B2B SaaS with inbound-heavy pipelines.
- PLG motions where sales-assist matters on a subset.
- Consultancies filtering low-fit inquiries automatically.

## Step-by-step
### Step 1: Define your ICP as data
Employee count band, industries, tech stack signals, geographies. This becomes a JSON block in your prompt.

### Step 2: Enrichment step
Clearbit / Apollo API. Fall back to a domain lookup if email is generic (gmail, yahoo).

### Step 3: Prompt A — fit
System: ICP JSON. User: enriched lead. Return {score, reasons[]}. Small model is enough.

### Step 4: Prompt B — intent
Include form text, UTM source, and last-30-day event history if you have it. Return {score, signals[]}.

### Step 5: Composite + tier
Weight fit 60% / intent 40%. Tier: A ≥ 8, B 5-7, C < 5. Or tune from historical data.

### Step 6: Write back to HubSpot
Update fit_score, intent_score, tier, and a Note with the reasoning. Notify SDR channel for A-tier only.

## 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
**Can I skip Clearbit?**

Yes — Apollo, PDL, or a domain lookup + LinkedIn scraping alternative. Enrichment quality directly drives score quality.

**Model bias?**

Very real. Audit A-tier vs won-deal correlation monthly. Update the ICP JSON, not the prompt scaffolding.

**GDPR?**

Only enrich B2B business emails. Consumer emails: skip enrichment and score on form data only.

---
Licensed under CC-BY-4.0. Attribution: PromptFoo.tech