A real-world Lead routing scenario: 24x7 inbound leads, three regions (NA, EMEA, APAC), each with a default team and specialist sub-teams (Enterprise, Mid-Market, SMB), with handoff to local-language reps where applicable.
Architecture:
- Lead Source enrichment. Inbound Lead first runs through a flow that derives standardised fields from messy sources — Country -> Region, Company size -> Segment, Language detection -> Locale. Don't route off raw fields; route off normalised ones.
- Region + Segment + Time-of-Day decision. A record-triggered flow (or Apex) determines:
- Region (NA / EMEA / APAC) from normalised Country.
- Segment (Ent / MM / SMB) from Annual Revenue or Employee Count.
- Local time at the Lead's location.
- Routing destination:
- During business hours in the target region: assign to a queue for that region+segment, e.g.,
EMEA_Enterprise_Queue. - Outside business hours: route to a "follow-the-sun" queue covering the next region's working hours.
- Tag with priority based on score (Lead Scoring or Pardot/MCAE).
- Implementation:
- Custom Lead Assignment Rule — for the simple region-and-segment case. Rules evaluate top-down; first match wins. Fast and declarative but limited expressiveness.
- Flow-based routing — overrides assignment rules with custom logic. More flexible but you have to manage it as code.
- Apex routing — for the most complex multi-criteria + scoring + load-balancing scenarios. Heavyweight; only when declarative isn't enough.
- Round-robin within a queue — to spread leads across reps in a queue, use a custom field "Last Assigned Index" on the queue and increment via a flow on each pickup. Or use a managed package like LeanData / Distribution Engine for serious routing.
- Time zone awareness:
- Use Business Hours records per region (NA Business Hours, EMEA Business Hours, APAC Business Hours).
- In the routing logic, check
IsWithinBusinessHours(Country)and pick the active region.
- SLA + Escalation:
- Once routed, fire an Escalation Rule that pages a manager if not contacted within 5 minutes during business hours.
- Reporting:
- Route reasoning fields (
Region__c,Segment__c,Routing_Path__c) on every Lead, populated by the flow, so you can audit "why did this lead go to this rep" later.
- Failure handling:
- If routing logic can't decide (missing fields, edge cases), assign to a triage queue rather than a person — never let a lead sit unassigned.
Trade-off recommendation: small org -> Lead Assignment Rules. Mid-market -> Flow-driven routing. Enterprise -> LeanData / Distribution Engine, because hand-rolling complex round-robin + load balancing in flow becomes a maintenance nightmare.
