Most inbound lead processes fail in the gap between submission and human attention. This workflow closes that gap: a form submission is enriched with company data, scored 0–100 by Claude against your ideal customer profile, and then routed three ways, hot leads become a HubSpot MQL with a Slack alert, weaker leads enter a nurture sequence, and anything the model cannot score confidently is flagged for a human rather than guessed at.
Workflow diagram
flowchart TD
A[Typeform Webhook] --> B[Log Raw Submission]
B --> C[Extract Form Fields]
C --> D[Company Enrichment Lookup]
D --> E{Enrichment OK?}
E -->|No| F[Fallback Data]
E -->|Yes| G[Merge Enrichment]
F --> G
G --> H[Build AI Prompt]
H --> I[Claude Score Lead]
I --> J[Parse AI Response]
J --> K{Confidence >= 0.6?}
K -->|No| L[Flag Manual Review]
K -->|Yes| M{Score >= 70?}
M -->|Yes| N[Create HubSpot MQL]
M -->|No| O[Add To Nurture List]
N --> P[Assign Rep Round Robin]
P --> Q[Slack Hot Lead Alert]
O --> R[Trigger Nurture Sequence]
Q --> S[Merge Outcomes]
R --> S
L --> S
S --> T[Log Lead Score]
T --> U[Tag Typeform Response] Every branch shown here (IF/Switch outcomes) exists as a real conditional in the downloadable JSON, not a simplification for this diagram.
The speed-to-lead problem this solves
Speed to lead is one of the few sales metrics with a genuinely well-documented relationship to conversion: response within minutes dramatically outperforms response within hours. Yet most inbound processes insert a human triage step precisely where the delay is most expensive, someone has to open the CRM, read the submission, decide whether it is worth pursuing, and assign it.
The instinctive fix, alerting every rep on every lead, fails for the opposite reason. Reps learn to ignore a channel that is 80% noise, and the genuinely good lead gets the same muted response as the student doing research for a dissertation. What you need is not more alerts, it is fewer and better ones.
This workflow inserts an AI scoring step where the human triage step used to be. The model does not decide whether to pursue a lead, a rep still does that. It decides how urgently a human should look, which is a much easier judgement to automate reliably.
Why enrichment happens before scoring
A lead form submission contains what the prospect chose to tell you. Enrichment adds what they did not: actual company headcount, industry classification, technology stack, funding stage. Scoring on form data alone means scoring largely on self-reported budget, which is the least reliable field on any form.
The Enrichment Succeeded? IF node handles the case that matters most in practice: the enrichment provider has no record of this company. Small businesses, very new companies and non-English-language markets are all routinely missing from enrichment databases. The fallback path sets companySize to unknown and continues to scoring rather than dropping the lead, an enrichment miss must never mean a lost lead.
Scoring with confidence thresholds, not just a number
The Claude Score Lead node asks for three outputs, not one: a score, a one-line reason, and a confidence value. The confidence value is what makes this safe to run unattended. A model asked to score anything will produce a number, including for inputs it has no real basis to judge.
The Score Confident Enough? node gates on confidence before the score is ever acted on. Below the threshold (0.6 in the template), the lead goes to manual review regardless of what score the model produced. This is the difference between an AI triage system you can trust and one that silently misroutes edge cases.
The reason string is equally important operationally. When a rep receives a Slack alert saying a lead scored 84, the next question is always why. Including the model's one-line justification in the alert turns the score from an opaque number into something a rep can sanity-check in two seconds.
Three-way routing and closing the feedback loop
The routing has three terminal states, not two. Hot leads (score ≥ 70) create a HubSpot deal, get assigned via round-robin, and trigger a formatted Slack alert. Everything else enters a nurture list and an automated email sequence. Low-confidence leads bypass both and wait for a human.
All three paths merge back into Log Lead Score To Airtable. This is the node that makes the system improve over time: every lead is recorded with its score, its confidence, its routing outcome, and eventually whether it converted. After a few hundred leads, that table tells you whether your threshold of 70 is right, whether the model over-scores certain industries, and where the ICP definition needs adjusting.
Without that log, an AI scoring system is unfalsifiable, it feels like it works and nobody can prove otherwise. With it, you can measure precision and recall against real outcomes and tune deliberately.
Node-by-node reference
| Node | Type | Role |
|---|---|---|
| Typeform Webhook | Webhook | Fires on every lead form submission |
| Log Raw Submission | HTTP Request | Durable record before any processing |
| Extract Form Fields | Set | Normalises the Typeform answer array into flat fields |
| Company Enrichment Lookup | HTTP Request | Pulls firmographic data from Clearbit |
| Enrichment Succeeded? | IF | Handles companies missing from the enrichment database |
| Build AI Scoring Prompt | Set | Assembles the ICP-aware prompt from form + enrichment data |
| Claude Score Lead | HTTP Request | Returns score, reason and confidence as structured JSON |
| Parse AI Response | Code | Extracts the three values from the model response |
| Score Confident Enough? | IF | Confidence gate, below threshold goes to a human |
| Hot Lead? | IF | The score threshold, 70 by default |
| Create HubSpot MQL | HTTP Request | Creates the deal record for qualified leads |
| Assign To Rep Round Robin | HTTP Request | Distributes ownership across the team |
| Post Hot Lead Slack Alert | HTTP Request | Sub-90-second notification with score and reason |
| Add To Nurture List / Trigger Sequence | HTTP Request ×2 | The non-hot path, automated follow-up |
| Merge Routing Outcomes | Merge | Rejoins all three terminal states |
| Log Lead Score To Airtable | HTTP Request | The feedback-loop table for tuning the model |
24 total nodes in the downloadable file, including sticky-note documentation embedded directly on the canvas.
Key logic, in code
ICP scoring prompt (Build AI Scoring Prompt node)
You are scoring an inbound lead for a business automation agency.
Our ideal customer profile:
- 10–200 employees
- Service business with repeatable manual back-office processes
- Already paying for 3+ SaaS tools that do not talk to each other
- Someone in ops, finance or the founder is the buyer
- Budget of at least EUR 800/month
Lead data:
{{ JSON.stringify($json, null, 2) }}
Return ONLY valid JSON in this exact shape:
{
"score": <integer 0-100>,
"reason": "<one sentence, max 20 words>",
"confidence": <float 0-1, how certain you are given available data>
}
Set confidence below 0.6 if key fields are missing or contradictory. Response parsing with a safe fallback (Parse AI Response node)
const raw = $input.first().json.content[0].text.trim();
let parsed;
try {
// Strip markdown fences the model sometimes adds despite instructions
const cleaned = raw.replace(/^```(json)?/, '').replace(/```$/, '');
parsed = JSON.parse(cleaned);
} catch (e) {
// Never let a malformed response silently route a lead the wrong way
return [{ json: { score: 0, reason: 'Parse failure', confidence: 0 } }];
}
return [{
json: {
...$('Merge Enrichment Path').first().json,
score: Number(parsed.score),
reason: String(parsed.reason),
confidence: Number(parsed.confidence),
}
}]; Before / after
| Metric | Before | After this workflow |
|---|---|---|
| Time to hot-lead notification | Hours (manual triage) | Under 90 seconds |
| Leads manually triaged by reps | 100% | Roughly 40%, only hot and low-confidence |
| Scoring consistency | Varies by rep and by day | One documented, tunable rubric |
| Leads lost to enrichment gaps | Silently dropped | Zero, fallback path scores anyway |
Prerequisites
- n8n v1.40+ (self-hosted or Cloud)
- Typeform account with webhook access on the lead form
- Clearbit API key, or substitute any enrichment provider
- Anthropic API key with access to a Claude model
- HubSpot private app token with CRM write scopes
- Slack bot token (chat:write) and an Airtable base for the score log
Common pitfalls
Do not act on a score without a confidence gate
A model will return a number for any input, including a form submitted with a fake company name and no budget. The confidence threshold is the difference between triage and guessing.
Tune the threshold on real data, not intuition
The default 70 is a starting point, not a recommendation. After 200 or so leads, compare scores against actual outcomes in the log table and move the threshold deliberately.
Never let the AI send outbound messages unreviewed
This workflow scores and routes, it does not write to the prospect. Keep it that way until you have months of score-accuracy data.
Log the prompt version alongside the score
If you change the ICP definition in the prompt, scores before and after are not comparable. Add a promptVersion field to the log table so historical analysis stays honest.
Want this deployed, configured and monitored?
The template is free. Wiring in your real credentials, tuning the logic to your business, and keeping it running when an upstream API changes is what we do.
Get my free automation plan →Frequently asked questions
Can I use OpenAI or a local model instead of Claude?
Yes, only the Claude Score Lead node changes. The prompt asks for structured JSON, which any capable model can produce, though you should re-validate the confidence calibration after switching.
Does this replace a sales rep's judgement?
No. It decides how urgently a human should look at a lead, not whether to pursue it. Every hot lead still goes to a rep who makes the actual call.
What if our form is on Webflow or HubSpot rather than Typeform?
Swap the trigger node. Anything that can send a webhook works, the Extract Form Fields node is where you normalise the differing payload shapes.
How much does the AI scoring cost to run?
The prompt and response are both short. At typical inbound volumes this is a negligible line item compared to the rep time it saves, but measure it on your own volume rather than assuming.