Lead routing and enrichment: automating inbound leads with n8n and LLMs
An inbound lead that waits in a shared inbox for a day is worth a fraction of one that gets a relevant reply within the hour, and most companies lose leads to that gap rather than to competitors. This is for sales and operations leads who have forms, an inbox and a CRM, and who want the handoff between them to stop depending on whoever is watching.
What lead routing and enrichment does
Leads arrive through web forms, a shared address, chat widgets and marketplace listings. Before anyone can act on one, somebody has to answer four questions: who is this, what do they want, how urgent is it, and who owns it. Routing and enrichment automates those four answers.
In practice it is one n8n workflow with six stages: capture, deduplicate, enrich, classify, route, write back to the CRM with a timer attached. The model sits in two of those stages; everything else is ordinary code, and that ratio is deliberate.
Which decisions get a rule and which get the model
The most common design mistake is letting the model decide what a lookup table decides better.
| Decision | Rule or model | Why |
|---|---|---|
| Is this a duplicate? | Rule | Exact matching on email, phone and domain is cheap. |
| Which company is this? | Rule, then enrichment API | Domain lookup first; free text only when there is no domain. |
| What do they want? | Model | Intent lives in the message body, which has no schema. |
| How urgent is it? | Model proposes, rule caps | The model reads tone and deadlines; a rule decides what "urgent" triggers. |
| Who owns it? | Rule | Territory and account ownership are business policy, not inference. |
| Is the SLA breached? | Rule | A timer. No judgement involved. |
The model's output is always a structured proposal — intent from a fixed list, urgency on a three-point scale, a one-line reason, a confidence value — and the routing rules consume it. Free text never drives a write, the same principle we apply as a guardrail in any automation that touches a system of record.
The pipeline, stage by stage
1. Capture and deduplicate
Every source lands in one queue with the same shape: source, timestamp, raw payload, contact fields. Deduplication runs first, against the CRM and the last 30 days of the queue. A repeat submission from the same address is merged; a second contact from a company with an open opportunity is attached to it, not created as a new lead.
2. Enrich
From the email domain: company name, size, industry, country, existing customer or not. From the CRM: prior contacts, open deals, account owner. From a paid enrichment API if you have one. Enrichment is additive and never blocking: if the API is down, the lead proceeds with the form data and a pending flag.
3. Classify
The model reads the message and the enrichment record and returns intent (quote request, support masquerading as sales, partnership, job seeker, spam), urgency and product area. Ten labeled examples per category in the prompt is the cheapest way past 90% accuracy on a stable taxonomy. The same mechanics carry over to support triage, with different categories.
4. Route
A rules table maps intent, product area, territory and account status to an owner, with a fallback queue for anything that does not match, including low-confidence classifications with the model's reason attached. Rules are data, not code, so a sales manager can change them without a deploy.
5. Write back and start the clock
The workflow creates or updates the CRM record, assigns the owner, posts a summary to the owner's channel and starts an SLA timer. If the record is untouched after the SLA — one hour for hot leads, one business day for the rest — it escalates to the manager and, after a second interval, reassigns. Every action is logged with the run ID, the same discipline as any back-office workflow, so a wrong assignment can be traced to a rule, a model output or an upstream field.
A worked example: an industrial equipment distributor
Consider a distributor with four sales reps split by region and product line, a web form, a marketplace listing and a shared sales address: about 300 messages a month. A coordinator read the inbox each morning, forwarded by hand and kept a spreadsheet of who got what. Median first reply: 26 hours. Duplicates and wrong forwards: one in eight.
All three sources feed one n8n queue. Dedupe matches on email and phone against the CRM. Enrichment resolves the domain to an existing account in about 60% of cases, which route straight to the account owner. The model classifies the rest: about 30% are quote requests for a product line, 25% are support questions that should never have reached sales, the remainder partnerships, recruiters and spam. Rules send quotes to the regional rep, support to the service desk, everything else to a shared triage view. SLA timers escalate untouched hot leads after 60 minutes.
After a month: median first reply under two hours for quote requests, duplicate assignments near zero, and the coordinator's morning hour spent chasing stalled quotes. The number that matters is not classification accuracy; it is that no lead sits untouched for a day without a manager knowing.
Failure modes and how the design absorbs them
Wrong owner. Usually a stale rules table, not a model error. Version the table, log which rule fired, and make reassignment one click so the rep fixes the routing instead of quietly forwarding.
Duplicate leads. Caused by dedupe that only checks exact email matches. Match on normalized email, phone and domain, and treat a company with an open deal as a duplicate by default.
Enrichment API outage. If enrichment blocks the pipeline, an outage stops your sales team. Make it asynchronous with a retry, and let the lead proceed unenriched with a visible flag.
Model drift. A new product line or a new kind of spam shifts the input. Sample 20 classified leads a week for a person to check, and treat the accuracy trend as an operational metric, as we do in Hilluter's automation projects.
Checklist before the first lead is routed automatically
- Every lead source is listed and lands in one queue with one schema.
- Deduplication rules are written down and tested against last quarter's leads.
- The intent taxonomy has at most ten categories and ten labeled examples each.
- Routing rules live in a table an owner can edit, with a fallback queue.
- Enrichment is non-blocking and its failures are visible.
- Every assignment is logged with the rule or model output that caused it.
- Someone owns the weekly accuracy sample and the rules table.
If you can describe your lead sources and who should own what, send us that description and we will reply with the routing table and the rules-versus-model split we would start from.
Frequently asked questions
Do we need an enrichment API to start?
No. Domain lookup against your own CRM and a public company register covers most B2B leads. Add a paid API later if missing company data is costing you routing accuracy.
Can the model assign the owner directly?
It can, but it should not. Ownership is business policy — territories, account history, capacity — and belongs in a rules table a manager controls, which gives the same answer every time.
How long does a first version take?
With existing forms and a CRM API, one to two weeks to a version routing real leads with a person watching the fallback queue. The rules table is usually the slowest part: it forces decisions nobody has written down.
This article expands Lead routing + enrichment from the Automations service on the main page.
Related articles
Support triage and tagging: LLM ticket classification with a human in the loop
Classify support tickets by intent, urgency, product area and sentiment, draft replies for human review, keep tag taxonomies stable and measure triage accuracy.
Automations / Reporting + dashboardsAutomated reporting and dashboards: pipelines that replace the weekly report
Replace hand-built weekly reports with an n8n pipeline from Postgres, Sheets and CRM to dashboards and chat. Numbers come from queries, narrative from an LLM.
Automations / Back-office ops automationBack-office ops automation: resilient workflows that replace repetitive admin
Automate back-office work — invoicing nudges, document handling, onboarding, approvals, data sync — with retries, idempotency, logging and clean ownership.
Tell us what the workflow does, where it hurts and which tools are involved. We reply with next steps and a proposed approach.