A lead-routing prompt is an AI prompt that takes a lead or deal record and outputs an owner assignment, built to apply the same routing logic every time rather than deciding case by case. It earns a place next to native tools like Salesforce assignment rules or HubSpot rotation workflows only when the routing logic genuinely needs judgment a field-match rule can’t express â not as a replacement for either.
What native routing tools already do well
Before writing a prompt for this, it’s worth being honest about how much ground Salesforce and HubSpot already cover natively, because most routing problems don’t need an LLM at all.
Salesforce’s assignment rules work as an ordered list of entries. Each entry has an Order, a set of criteria (field-based filters or a formula that evaluates to true or false), and a target user or queue. Salesforce evaluates entries in order and stops at the first match â once an entry’s criteria are met, the record is assigned and no further entries are checked. If nothing matches, the record falls back to a default owner (the Web-to-Lead default owner, the import admin, or the default case owner, depending on the object). Salesforce’s own documentation recommends adding a final catch-all entry with no criteria specifically so every record lands somewhere.
HubSpot’s rotation workflows solve a related but different problem: distributing volume evenly rather than matching criteria to an owner. It offers round robin (sequential), load balanced (fewest open assigned records), and random assignment among an eligible pool. Changing the owner list resets the rotation counters so distribution stays even going forward. Users marked “Away” can be skipped automatically, and if everyone in the pool is unavailable, the record is left unassigned rather than forced onto someone.
The table below lines up what each one is actually built to do, since “lead routing” gets used as an umbrella term for two different mechanisms.
| Mechanism | What it optimizes for | How ties/no-match are handled | Where it’s documented |
|---|---|---|---|
| Salesforce Assignment Rules | Matching specific criteria to a specific owner, in a fixed priority order | Falls through to a default owner if no entry matches; recommended fix is an explicit catch-all entry | Salesforce Help |
| HubSpot Rotation Workflows | Spreading volume evenly across a pool (round robin, load balanced, random) | Skips unavailable users if “assign to available only” is on; leaves the record unassigned if the whole pool is unavailable | HubSpot Knowledge Base |
| A routing prompt | Applying judgment-based criteria that don’t reduce cleanly to field filters | Needs to be explicitly designed in; nothing enforces it unless you build it into the prompt | n/a â covered below |
Neither native tool does anything probabilistic. Salesforce’s rule evaluation is a deterministic if/then chain; HubSpot’s rotation is a deterministic counter. That determinism is the thing a routing prompt has to earn back, because nothing about an LLM call guarantees it by default.
Where native tools run out of room
Field-match criteria break down in a few recurring situations: when the deciding factor lives in a free-text field (a deal note that mentions an existing partner relationship, a lead-source description that doesn’t map cleanly to a picklist value), when the rule depends on combining several fields in a way the criteria builder can’t express as a clean AND/OR chain, or when there’s a standing list of named-account exceptions that keeps changing faster than someone wants to maintain 40 assignment-rule entries for it. None of these are reasons to abandon the native tool â they’re reasons to add one more entry at the top of the chain: “if the prompt returns a match, route there; otherwise fall through to the existing assignment rule.”
Designing a routing prompt that behaves like a rule engine, not a chatbot
The failure mode worth designing against isn’t a wrong routing decision â it’s an inconsistent one. If the same lead record can get routed to two different reps depending on when the prompt happens to run, that’s worse than a slightly suboptimal fixed rule, because nobody can audit it or explain it after the fact. The fix is to borrow the structure Salesforce already uses â ordered, named rules, evaluated in sequence, with an explicit fallback â and make the prompt apply that structure instead of inventing its own judgment from scratch.
Three things make this work in practice:
- Give the model named, ordered rules instead of a vague mandate. “Route enterprise-tier leads to the enterprise team” is a judgment call the model can interpret several ways. “Rule 1: if annual_revenue_field >= 50000000 OR employee_count_field >= 1000, assign to Enterprise Team” is not.
- Require the model to name which rule fired. This turns the output into something auditable â a human can check whether rule 2 should have fired before rule 3, the same way they’d debug a Salesforce entry order.
- Force a structured output schema and a default rule. An unstructured answer invites drift across runs; a missing fallback is how records end up silently unassigned, the exact problem HubSpot’s own “no eligible user” behavior is designed to avoid on its side.
A ready-to-copy routing prompt
You are applying a fixed lead-routing policy. Evaluate the rules below
IN ORDER against the lead record. Stop at the first rule whose
condition is true and return that rule's assignment. If no rule
matches, return the default rule.
RULES (evaluate in this order):
1. If named_account_list contains the company name, assign to:
named_account_owner_field.
2. If annual_revenue >= 50000000 OR employee_count >= 1000, assign to:
Enterprise Team.
3. If country is in [list of EMEA countries], assign to: EMEA Team.
4. If lead_source = "Partner Referral", assign to: Partner Desk.
DEFAULT: assign to: SMB Team.
LEAD RECORD:
{company_name}, {annual_revenue}, {employee_count}, {country},
{lead_source}
Return ONLY this JSON object, with no other text:
{
"matched_rule": "<rule number and short name, or 'default'>",
"assigned_to": "<team or owner from the matched rule>",
"reasoning": "<one sentence citing the specific field value that
triggered the match>"
}
The rationale for each piece: the rules are numbered and ordered on purpose, mirroring how Salesforce entries are evaluated, so a human reviewing the output can independently re-check whether rule 2 should have won over rule 3. The reasoning field isn’t there for style â it’s the one-sentence version of what a Salesforce admin would see by opening the matched entry, and it’s what lets someone catch a bad rule before it routes fifty more leads the same way. The hard requirement to return only the JSON object, with a named default, closes the two gaps a free-text answer would leave open: an answer that drifts in format run to run, and a lead that falls through with no assignment at all.
A before-and-after example
Take a lead record with company_name: "Nimbus Retail Group", annual_revenue: 12000000, employee_count: 340, country: "Germany", lead_source: "Webinar". Without a structured rule set, a model asked to “route this lead sensibly” might reasonably assign it to the EMEA team, the SMB team, or even ask a clarifying question â all defensible, none consistent with what the same model would say on a re-run.
Run through the prompt above, the trace is explicit: rule 1 fails (not on the named-account list), rule 2 fails ($12M revenue and 340 employees are both under the enterprise thresholds), rule 3 matches (Germany is in the EMEA list). Output:
{
"matched_rule": "3: EMEA",
"assigned_to": "EMEA Team",
"reasoning": "country is Germany, which is in the EMEA country list"
}
That’s the entire value of the exercise: the same lead, run ten times, produces the same matched_rule and the same assigned_to, and if it ever didn’t, the reasoning field would show exactly where the logic diverged.
Common pitfalls and how to fix them
The most common failure is treating this as a lead-scoring problem instead of a routing problem. They’re related but not the same: scoring asks “how good is this lead,” while routing asks “whose queue does this lead belong in.” A BANT lead-scoring prompt answers the first question; the routing prompt above answers the second, and the two can run back-to-back on the same record without conflicting.
The second failure is assuming a single prompt call is deterministic because the rules are written out explicitly. It isn’t automatically â setting temperature to zero doesn’t make a model’s output deterministic on its own, and the fix isn’t a sampling setting but a strict output schema the model is forced to fill in, paired with periodic re-runs of the same test records to confirm the matched_rule hasn’t drifted. Build that consistency check once, as a short list of five or six representative lead records with known expected outcomes, and re-run it any time the rule set or the model changes.
The third failure is skipping the default rule because “every lead should match something.” In practice, data is messy â a missing country field, a revenue number that’s blank rather than zero â and a prompt with no default will either invent an assignment or return nothing, both of which are worse than HubSpot’s own explicit choice to leave a record unassigned rather than force a bad match.
A natural follow-up: Does this replace Salesforce assignment rules or HubSpot rotation workflows? No. It’s meant to run only for the subset of leads the native tool can’t cleanly classify â typically routed in as one more entry (“if the routing prompt returns a confident match, use it; otherwise fall through to the standard rule chain”) rather than as a full replacement for either system.
It’s worth addressing directly: What happens if the model’s reasoning field contradicts its own matched_rule? Treat that as a signal the rule set is ambiguous, not as something to silently accept. If a model’s own stated reasoning doesn’t support the rule it picked, that record is a good candidate to add to the test set described above, and the specific rule’s wording likely needs tightening.
There’s one more thing worth spelling out: Can this same structure apply to lead scoring or discovery-call tagging instead of routing? Yes â ordered rules, a required matched-rule field, and a mandatory default are useful any time you need an LLM’s output to behave like a decision table rather than a free-form answer. Routing just happens to be the clearest case, because a routing mistake is immediately visible (the wrong rep gets the lead) in a way that makes consistency failures hard to ignore.



