n8n AI Lead Scoring
Most inbound forms treat a funded startup with a two-week deadline and a student asking for a free trial as the same event. A human eventually sorts them out, usually after the hot lead has already waited a day. AI lead scoring is not about replacing that judgment. It is about applying a first pass consistently, within seconds, so the human spends their attention on the leads that deserve it.
An n8n AI lead scoring workflow is a short pipeline: a trigger, a validation step, a model call, a parser and a routing decision. The difference between a demo and something you trust is what happens when the model returns malformed JSON, when the email is invalid, or when the score is exactly on the threshold.
The workflow
Workflow 02 in the Lead Ops Pack implements this as Form to AI lead score to CRM. A webhook receives the form POST, a Code node lowercases and validates the email, and an HTTP Request node asks an OpenAI-compatible model for strict JSON: score, tier, reason and a one-sentence summary. A second Code node clamps the score to 0โ100, derives HOT/WARM/COLD and removes the prompt before anything is written downstream.
The routing rule is explicit: 70 or above upserts the contact to HubSpot and posts a Slack message; everyone else goes to a nurture sheet. Invalid emails stop the run with a clear error. That fail-closed behavior is deliberate โ a broken lead row is worse than a visible failure.
A free lite version uses an n8n-hosted form instead of a webhook, scores the lead the same way and routes to two Google Sheets tabs. No HubSpot, no Slack.
Build it in six steps
- Trigger. Use a webhook for your existing form, or the n8n Form Trigger if you want n8n to host the form. Keep the field names stable.
- Validate before you spend tokens. Check the email format, trim whitespace, cap the message length and build the prompt in a Code node. Reject invalid input before the API call.
- Ask for strict JSON. Use a system prompt that names the exact keys and a response format that enforces JSON. Keep temperature low. Do not ask for prose and parse it later.
- Parse defensively. Strip code fences, clamp the score, derive the tier from the score rather than trusting the model's tier string, and default to a safe value when parsing fails.
- Route on one number. A single threshold is easier to explain and tune than a matrix. Start at 70, review a week of leads, then move it.
- Log the reason. A score without a reason cannot be audited. Store the reason and the summary next to the score.
What to watch
- Prompt drift. Changing the ICP definition means changing the prompt. Version it in the Code node so you can compare results.
- Model cost. A short prompt and a small model are enough for triage.
- Threshold gaming. If sales disagrees with the score, inspect the reasons before changing the model. Usually the prompt is missing a signal.
Get the working version
The Lead Ops Pack includes workflow 02 with HubSpot upsert, Slack notification and the nurture path, plus nine other lead-ops workflows, setup docs and a troubleshooting guide. It is $29 one-time with a 14-day refund. The free lite template is enough to see the n8n AI lead scoring loop end to end.
Get the full pack: https://www.creem.io/product/prod_4vIP7lONOlaSuCPcW832Lm
Get the free lite workflow: [FREEBIE_LEAD_SCORE_URL]