What this automation does
A new inquiry arrives, and within seconds it belongs to the right person, or the right non-sales queue, with a clock running.
- Capture. A form submission, chat transcript, or email to a sales inbox triggers the workflow.
- Match existing records. Look up the email and company domain. If the company is already a customer or has an open deal, route to the existing owner and stop.
- Classify the message. The model reads the free text and returns intent (new business, existing customer support, partnership, vendor pitch, job seeker, spam), product line, and urgency, with a short reason.
- Apply rules. Code looks up the routing table: country or state to territory, employee count to segment, product line to specialist team. Within the matched team, a weighted round-robin picks the next available rep.
- Assign and notify. The CRM owner is set, and the rep gets a Slack or Teams message with the lead summary, the classification reason and a link.
- Escalate. If the lead has no logged activity within your target time, it is reassigned or escalated to a manager, and the miss is recorded.
When it is worth building
Build it when leads sit unassigned in a shared inbox, when the wrong rep gets leads often enough that reassignments are routine, or when non-sales inquiries clog reps’ queues. With one rep and one product, routing is not your problem; response time is, and the lead qualification agent may be the better project.
If every lead arrives through a form with clean dropdowns for region and product, your CRM’s native assignment rules or HubSpot’s rotation may be all you need. The AI step earns its place when the important information is in sentences, not fields.
Architecture
| Layer | What we use | Why |
|---|---|---|
| Intake | Form webhooks (Typeform, HubSpot forms, website forms), chat, sales inbox | Every channel lands in the same routing path |
| Matching | CRM search by email and domain | Existing accounts must stay with their owner |
| Classification | Claude Haiku 5.5 or a small OpenAI GPT model | Fast and inexpensive for short messages; returns a fixed label set |
| Rules | A routing table in Google Sheets or Postgres, read by a code step | Sales ops can change territories without a developer |
| Round-robin | A counter per team with availability and daily caps | Fair distribution that skips reps who are out |
| Notification | Slack or Microsoft Teams | Reps see new leads where they already work |
| SLA timer | Scheduled check in n8n | Catches leads that were assigned but not touched |
How to build it
- Write down today’s routing logic. Interview whoever assigns leads now. Capture territories, segments, special accounts and every exception. Expect to find rules nobody wrote down.
- Define the label set. Keep intents and product lines to a short fixed list, with a description and two examples each. Add an “unclear” label so the model is not forced to guess.
- Build the routing table. One row per rule, with a priority order. Keep it in a sheet or table sales ops can edit, and validate it on load (no gaps, no overlaps).
- Add account matching first. Existing customers and open opportunities override everything else. Most misroutes come from skipping this step.
- Wait briefly for enrichment. If lead enrichment runs in parallel, wait for it with a short timeout, then route with whatever fields are available.
- Implement round-robin with availability. Keep a pointer per team, skip unavailable reps, and respect daily caps. Log every decision with the rule that matched.
- Turn on SLA escalation. Set a response-time target per lead tier and reassign or escalate on a miss.
The downloadable starter template below covers form intake, AI intent classification, a sheet-based routing table and HubSpot owner assignment with a Slack alert.
What breaks in production
- Customers routed as new leads. A customer emails from a new colleague’s address and lands with a new-business rep. Domain matching against customer accounts fixes most of these.
- Territory gaps. Leads from Puerto Rico, Canada or an unexpected country match no rule. Always have a default owner and alert sales ops when it is used.
- Unfair round-robin. Reps who were out get no catch-up, or a rep gets three enterprise leads in a row. Decide whether to weight by segment and document the policy.
- Duplicate submissions. The same person submits twice and gets two reps. Deduplicate within a short window before assigning.
- Rule table edits that break routing. A typo in a state code sends a region to the default owner for a week. Validate the table on every load and alert on unknown values.
- Overnight SLA noise. Leads arriving at midnight breach targets before anyone is awake. Measure SLAs in business hours, or route overnight leads to an after-hours path.
Timeline and cost
A single CRM with one intake channel and a routing table typically takes one to two weeks. Multiple channels, complex territory rules, or a mixed CRM setup take longer. Lumeor builds AI lead routing in the range of $3,000 to $9,000. Running costs are small: classification of short messages with a fast model costs very little per lead, plus workflow hosting. Our no-code vs custom-code comparison covers when a routing table outgrows a visual workflow.
How to measure success
- Seconds from submission to owner assigned
- Median time from assignment to first rep activity
- Reassignment rate, as a proxy for misroutes
- Share of non-sales inquiries diverted away from reps
- Lead distribution per rep against the intended weights