FlowKit

Qualifying and routing inbound leads automatically with n8n and AI

Published 19 July 2026 · 5 min read

A contact form that receives twenty to a hundred submissions a day always runs into the same problem: nobody reads all of them with equal attention. The lead genuinely ready to buy within the week ends up mixed in with the internship request, the off-topic partnership pitch, and the sales spam. Without triage, whoever arrives first gets handled first — rarely the most promising one.

An LLM changes that because it reads a message the way an experienced salesperson would: it recognizes a specific need, a mentioned budget, real urgency, and separates those from idle curiosity. This article builds, node by node, an n8n pipeline that captures a lead on submission, scores it against an explicit rubric, then automatically routes it to your CRM and to Slack for hot leads — all within seconds, with no human intervention on the initial triage.

Pipeline overview

The pipeline has four building blocks, in this order: form capture via webhook, field normalization, LLM scoring with structured output, then conditional routing. This is exactly the architecture behind the email urgency scoring workflow in the AI Inbox Pack (€79), applied here to leads instead of inbound emails: same webhook + LLM chain + structured output skeleton, a different rubric.

Step 1 — Capture the lead without depending on a proprietary tool

The entry point is a Webhook node (n8n-nodes-base.webhook) using POST, with responseNode mode if you want to send a confirmation back to the calling form. The benefit of a generic webhook over a proprietary trigger: any form capable of a POST request can feed it — Typeform, Tally, a plain HTML form on your site, or even n8n's native Form Trigger if you'd rather host the form directly inside your instance.

Expect a minimal JSON payload: name, email, message, and ideally one or two qualifying fields specific to your business (rough budget, team size, desired timeline). The more of these fields are present, the more precise the scoring — but the pipeline still works with just a free-text "message" field.

Step 2 — Clean and normalize

A Set node (n8n-nodes-base.set) right after the webhook does two things: it keeps only the fields the LLM needs, to control token cost, and it normalizes their format (email lowercased, missing fields replaced with an empty string rather than undefined, which would break the prompt). This is also the right place to silently reject submissions that look like obvious spam — an empty "message" field paired with a disposable email domain, for instance, via an IF node before the LLM is even called.

Step 3 — Score against an explicit rubric

This is the core of the pipeline: an LLM chain (@n8n/n8n-nodes-langchain.chainLlm) wired to a model via an ai_languageModel sub-node (gpt-4o-mini is plenty for this task — see our guide on connecting Claude or GPT to n8n).

The system prompt should spell out a rubric in black and white, with one example per tier rather than a vague instruction like "rate the quality of this lead." A rubric that works well in practice:

  • Score 5 — specific need, budget or timeline mentioned, decision imminent ("we're looking for a solution before end of quarter")
  • Score 3-4 — real need but vague, no budget or timeline signal
  • Score 1-2 — general inquiry, curiosity, job application or off-topic partnership request

An important instruction to add explicitly: don't be swayed by an insistent tone or words like "urgent" written by the sender themselves — the factual content of the message should drive the score, not its formatting.

A Structured Output Parser (@n8n/n8n-nodes-langchain.outputParserStructured) then enforces a reliable JSON output: score (integer 1 to 5), justification (one sentence), detected_category, and suggested_action. This strict schema is what makes the routing step reliable — without it, you'd be parsing free text on every execution, a bet that loses over time.

Step 4 — Route to the right channel

An IF or Switch node compares the score against your chosen threshold. Two typical branches:

  • Score ≥ 4: an immediate Slack alert (n8n-nodes-base.slack node) with name, message, score and justification — your sales team sees the hot lead before even opening their inbox, following the same pattern as the AI Inbox Pack's alert for urgent emails.
  • Score < 4: logged in the CRM with no alert, for batch follow-up later.

For the logging step itself, the node depends on your tool: HubSpot (n8n-nodes-base.hubspot) or Pipedrive (n8n-nodes-base.pipedrive) if you already run one, otherwise Airtable (n8n-nodes-base.airtable) or a Supabase table — see our guide to connecting n8n to Supabase if you're starting from scratch. Either way, write the LLM's score and justification as first-class fields: they become sorting and reporting criteria for the team, not just data passing through.

Securing the exposed webhook

A lead-capture webhook is, by nature, publicly exposed — that's the point. That also makes it a target for automated form-filling or malicious content injected into the fields. Two minimum safeguards: enable at least lightweight authentication on the Webhook node (Header Auth with a secret shared with your form) and validate the payload's structure before sending it to the LLM. Our guide on securing a publicly exposed n8n webhook covers Header Auth, JWT Auth, and HMAC signature verification in detail for integrations that support it.

Reliability: never lose a lead

A lead arriving during a traffic spike (an ad campaign, a press mention) can run into an LLM API rate limit. The right practice is the same as for any variable-volume AI call: a dedicated Error Workflow that catches failures and alerts instead of letting the execution die silently — see our guide on handling errors in n8n. If your lead volume goes past a few hundred a day, also check our article on OpenAI and Anthropic API rate limits to size your calls correctly.

What it costs

With gpt-4o-mini and a short scoring prompt, expect roughly $0.01-0.02 per scored lead — negligible next to the cost of a hot lead handled too late, or never handled at all. The only meaningful cost line is your n8n instance itself (Cloud or self-hosted — see our n8n self-hosted vs cloud comparison to decide based on your volume).

Going further

This qualification pipeline relies on exactly the same n8n building blocks as the email triage in the AI Inbox Pack (€79): webhook, LLM chain with structured output, conditional routing, Slack alert. If you already own that pack, adapting the urgency-scoring workflow to leads instead of emails only requires changing the prompt and the destination node — the architecture stays identical. And if you want to cover the inbox, the document assistant, and compliance in one go, the Complete FlowKit Bundle (€269 instead of €347) bundles all three packs.

FAQ

Frequently asked questions

Do I need a paid CRM to set up this pipeline?

No. Scoring and routing work identically with Airtable or a Supabase table as with HubSpot or Pipedrive: only the destination node changes. Many independents start on Airtable, free up to a comfortable volume, then move to a dedicated CRM once the sales team grows.

Can the LLM hallucinate a completely wrong score?

The risk exists if the rubric is vague. Giving explicit criteria and one example per score level in the prompt, as detailed in this article, keeps discrepancies between neighboring scores (a 3 instead of a 4), never between the extremes. The required 'justification' field in the structured output lets you quickly spot a score that falls outside the intended range during the first days in production.

Can leads be qualified in a language other than English?

Yes, with no change to the architecture: the scoring prompt can be multilingual, or instruct the model to answer in a fixed language regardless of the incoming message's language. OpenAI and Anthropic models natively handle French, Spanish and most European languages with the same scoring quality.

What if my form doesn't send webhooks natively?

Nearly every modern tool (Typeform, Tally, Framer, a plain HTML form) can POST to a URL on submission. If yours can't, a Zapier or Make integration can relay to the n8n webhook in one step; or replace the trigger with n8n's native Form Trigger, which hosts the form directly with no third-party tool.

AI Inbox Pack

€79