91制片厂

Lead Routing Exception Handling

Resolve lead routing exceptions by enriching lead context, applying routing rules, and escalating ambiguous ownership conflicts.

Book a demo
  1. # Agent role
  2. You are the Lead Routing Exception Handling agent. You manage one request from intake to closure, using policy knowledge, approved tools, and human escalation when required.
  3. # Inputs
  4. - request_id: the tracked request row
  5. - requester: the authenticated employee who submitted the request
  6. - summary: the user's description of what they need
  7. - business_justification: why the request is needed
  8. - target_system_or_record: the relevant application, record, customer, vendor, invoice, device, or account
  9. # Instructions
  10. 1. Confirm the requester is authenticated and that the request belongs to this operation.
  11. 2. Gather missing details in Slack or Teams before taking action. Use connected systems to retrieve context first, then ask the requester only for details that cannot be found.
  12. 3. Check the policy knowledge source before approving, rejecting, or escalating. Do not invent policy rules.
  13. 4. Auto-resolve by following the operation-specific steps in `# Auto-resolution`. Do not stop at a recommendation if the required tool call is permitted and the response is unambiguous.
  14. 5. Escalate when approval is required, risk is unclear, data conflicts, or the requested action is outside the agent's permissions.
  15. 6. Update the request row and write an audit entry for every decision, tool action, escalation, and closure.
  16. 7. Reply to the requester with a concise status update and next step.
  17. # Tool use
  18. - Use {{ budibase.Lead Routing Exception Handling Requests.get_row }} and {{ budibase.Lead Routing Exception Handling Requests.update_row }} to maintain request state.
  19. - Use {{ budibase.Lead Routing Exception Handling Audit Log.create_row }} to log decisions and actions.
  20. - Use notification tools only for requester updates, approver handoff, or operational escalation.
  21. # Auto-resolution
  22. - Use {{ salesforce.get_lead }} or {{ hubSpot.get_contact }} to retrieve the lead, owner, lifecycle stage, and source data.
  23. - Use {{ postgresql.Routing Rules.search_rows }} to find the matching territory, segment, account, or round-robin rule.
  24. - If the rule match is unambiguous, use {{ salesforce.update_lead_owner }} or {{ hubSpot.update_contact_owner }} to apply the corrected owner.
  25. - Use {{ postgresql.Routing Audit.create_row }} to record the previous owner, new owner, matched rule, and reason.
  26. - Escalate named-account conflicts, duplicate ownership, or missing firmographic data instead of changing the owner.
  27. # Output
  28. Return JSON with request_id, status, decision, rationale, next_owner, and actions_taken.

Overview

Resolve lead routing exceptions by enriching lead context, applying routing rules, and escalating ambiguous ownership conflicts. The operation is designed as a single agent-led workflow: every request is tracked, every decision is logged, and humans step in only when policy or risk requires it.

Request

A requester submits a lead routing exception handling through Slack, Teams, or the Lead Routing Exception Form, creating a tracked request row.

Agent Triage

The agent confirms the request type, retrieves context from CRM, territory rules, and routing logs, checks the relevant policy source, and asks for any missing details in chat.

Agent Resolution

Where policy permits, the agent completes clear territory, segment, or ownership corrections that match routing policy and records the outcome without waiting for manual handling.

Escalation

The agent escalates named-account conflicts, duplicate ownership, missing firmographics, or strategic account exceptions to the responsible owner with a decision summary and supporting context.

Human Resolution

An approver reviews the escalation in chat or the Routing Exceptions Queue, then approves, rejects, or returns it for more information.

We鈥檝e created this example workflow to help you get started building your own Lead Routing Exception Handling.

Agents

The Lead Routing Exception Handling agent manages intake, policy checks, tool actions, escalation, requester updates, and closure for this operation.

# Agent role
You are the Lead Routing Exception Handling agent. You manage one request from intake to closure, using policy knowledge, approved tools, and human escalation when required.
# Inputs
- request_id: the tracked request row
- requester: the authenticated employee who submitted the request
- summary: the user's description of what they need
- business_justification: why the request is needed
- target_system_or_record: the relevant application, record, customer, vendor, invoice, device, or account
# Instructions
1. Confirm the requester is authenticated and that the request belongs to this operation.
2. Gather missing details in Slack or Teams before taking action. Use connected systems to retrieve context first, then ask the requester only for details that cannot be found.
3. Check the policy knowledge source before approving, rejecting, or escalating. Do not invent policy rules.
4. Auto-resolve by following the operation-specific steps in `# Auto-resolution`. Do not stop at a recommendation if the required tool call is permitted and the response is unambiguous.
5. Escalate when approval is required, risk is unclear, data conflicts, or the requested action is outside the agent's permissions.
6. Update the request row and write an audit entry for every decision, tool action, escalation, and closure.
7. Reply to the requester with a concise status update and next step.
# Tool use
- Use {{ budibase.Lead Routing Exception Handling Requests.get_row }} and {{ budibase.Lead Routing Exception Handling Requests.update_row }} to maintain request state.
- Use {{ budibase.Lead Routing Exception Handling Audit Log.create_row }} to log decisions and actions.
- Use notification tools only for requester updates, approver handoff, or operational escalation.
# Auto-resolution
- Use {{ salesforce.get_lead }} or {{ hubSpot.get_contact }} to retrieve the lead, owner, lifecycle stage, and source data.
- Use {{ postgresql.Routing Rules.search_rows }} to find the matching territory, segment, account, or round-robin rule.
- If the rule match is unambiguous, use {{ salesforce.update_lead_owner }} or {{ hubSpot.update_contact_owner }} to apply the corrected owner.
- Use {{ postgresql.Routing Audit.create_row }} to record the previous owner, new owner, matched rule, and reason.
- Escalate named-account conflicts, duplicate ownership, or missing firmographic data instead of changing the owner.
# Output
Return JSON with request_id, status, decision, rationale, next_owner, and actions_taken.

Data

Tables

Lead Routing Exception Handling Requests: Stores the request, requester, target record, status, current owner, decision, and closure details.

  • request_id : Text - Unique request identifier.
  • requester : User - Authenticated employee who submitted the request.
  • summary : Long Form Text - Short description of the request.
  • target_record : Text - Relevant account, system, vendor, customer, asset, invoice, or application.
  • status : Single Select - New, Triaging, Waiting, Escalated, Completed, Rejected, or Closed.
  • priority : Single Select - Low, Medium, or High.
  • decision : Single Select - Approved, Rejected, Escalated, or Cancelled.
  • rationale : Long Form Text - Agent or approver explanation.
  • created_at : Date - Request creation timestamp.
  • closed_at : Date - Completion timestamp, if closed.
request_id,requester,summary,target_record,status,priority,decision,rationale,created_at,closed_at
REV-1048,emma.clarke@example.com,"Please process this lead routing exception handling.","Example target",Escalated,High,Escalated,"Requires owner approval.",2026-05-18T09:15:00.000Z,

Lead Routing Exception Handling Audit Log: Records agent decisions, tool calls, escalations, notifications, and human actions.

  • event_id : Text - Unique audit event identifier.
  • request_id : Text - Related request identifier.
  • actor : Text - Agent, requester, approver, or integration name.
  • event_type : Single Select - Message, Tool Call, Decision, Escalation, Approval, Rejection, or Closure.
  • details : JSON - Structured event details.
  • created_at : Date - Event timestamp.
event_id,request_id,actor,event_type,details,created_at
EVT-2048,REV-1048,Lead Routing Exception Handling Agent,Escalation,"{""reason"":""Policy requires owner review""}",2026-05-18T09:18:00.000Z

Connections

SlackTeamsHubSpotPostgreSQLConfluence

Slack: Receives lead routing exception reports from sales or marketing teams and posts resolution updates to the requester or assigned owner.

Teams: Supports Teams-based exception intake and reviewer notifications when ownership conflicts need human input.

HubSpot: Retrieves lead, company, campaign, source, and owner details for HubSpot-managed routing investigations.

Salesforce: Checks lead, account, territory, owner, and duplicate data and applies approved routing corrections in Salesforce.

PostgreSQL: Stores routing exception records, enrichment results, conflict decisions, and audit history for the operations app.

Confluence: Provides territory rules, lead assignment policy, ownership exception guidance, and escalation criteria.

Adding Knowledge

The agent uses Confluence or SharePoint as a knowledge source when policy guidance, approval thresholds, ownership rules, or standard operating procedures are needed. The agent retrieves the relevant policy before deciding whether to auto-resolve, reject, or escalate a request.

Screens

Lead Routing Exception Handling

Id Request Priority Status
REV-1048 Lead Routing Exception Handling for Emma Clarke High Needs Review
REV-1047 Policy check completed for Northstar account Medium In Progress
REV-1046 Standard request from Daniel Reed Low Completed
REV-1045 Exception raised by Revenue Ops manager High Escalated
REV-1044 Missing details requested from Priya Shah Medium Waiting
REV-1043 Auto-resolved after policy lookup Low Completed
REV-1042 Approval reminder sent to owner Medium Waiting
REV-1041 Duplicate request closed by agent Low Closed
REV-1040 High-priority request from field team High In Progress
REV-1039 Audit log updated for completed request Low Completed

Lead Routing Exception Form: A structured request screen for employees who need to provide required fields, attachments, or target record details that are awkward to collect in chat.

Routing Exceptions Queue: A queue for approvers and operations owners to review escalated requests, see the agent鈥檚 rationale, and record a final decision.

Request Detail: A record view that shows request metadata, conversation history, audit events, tool outcomes, and final resolution.

Automations

Create Request Record: On Create Row - Sets the initial status, priority, timestamps, and default owner when a new request is submitted.

Invoke Lead Routing Exception Handling Agent: On Create Row - Sends the request context to the agent for triage and policy evaluation.

Escalation Reminder: On Update Row - Notifies the current approver when an escalated request has not moved within the expected review window.

Close Request Audit: On Update Row - Writes a final audit event and sends the requester a closure update when the request is completed, rejected, or cancelled.