Routing configuration controls how calls flow between your agents. It defines which agent answers first, what triggers a transfer, and what happens when the target agent is unavailable. Each agent instance stores its routing rules in a routing_config JSON field.
In a multi-agent setup, one agent is designated as the primary and others as secondary:
The most common pattern is a Receptionist as primary and Customer Support as secondary. The Receptionist handles general inquiries, scheduling, and message taking, while routing support requests to the CS agent.
Transfer rules define when the primary agent should route a call to a secondary agent. Each rule consists of:
| Field | Description | Example |
|---|---|---|
| trigger | A unique identifier for this rule | support_request |
| keywords | Words and phrases that activate this rule | ["support", "help", "issue", "problem", "complaint"] |
| target_instance_id | The agent instance to transfer to | UUID of your CS agent instance |
| announce | What the agent says before transferring | "Let me connect you to our support team." |
When a caller uses language that matches the keywords, the primary agent recognizes the intent and initiates a handoff.
Example configuration with two transfer rules:
{
"primary_instance_id": "inst_receptionist_xxx",
"transfer_rules": [
{
"trigger": "support_request",
"keywords": ["support", "help", "issue", "problem", "complaint"],
"target_instance_id": "inst_cs_xxx",
"announce": "Let me connect you to our support team."
},
{
"trigger": "technical_request",
"keywords": ["bug", "crash", "error", "technical", "API", "not working"],
"target_instance_id": "inst_techsupport_xxx",
"announce": "Let me connect you to our technical specialist."
}
]
}To prevent circular transfers (Agent A sends to Agent B, which sends back to Agent A, and so on), the routing configuration includes a max transfers per call limit. The default is 3.
After reaching the maximum, any further transfer attempts result in escalation to the L3 human support number instead. This ensures callers never get stuck in a loop.
{
"max_transfers_per_call": 3
}When a call is transferred between agents, the conversation context can be shared with the receiving agent. Enable this with the share_context flag:
{
"share_context_on_transfer": true
}When enabled, the receiving agent gets a conversation summary: "The caller was transferred because they need help with [issue]. Here is what has been discussed so far: [summary]." This prevents callers from having to repeat their issue.
See Handoff System for details on how context is preserved during transfers.
When a secondary agent is unavailable (outside business hours), the routing configuration specifies what happens instead:
| Fallback Action | Behavior |
|---|---|
callback | The primary agent takes the caller's details and schedules a callback during business hours |
voicemail | The primary agent takes a message to be forwarded to the appropriate team |
transfer_to_other | The call is routed to a different agent that is currently available |
{
"after_hours_fallback": "callback",
"fallback_instance_id": null
}Tip: The callback fallback works best with the Callback Agent add-on, which automatically calls back customers during the next business window.
Routing configuration is set up through the My Agents section in your customer portal:
The routing rules are applied to the agent's system prompt and tool configuration automatically. For phone calls, transfer rules generate corresponding transfer_call tools that the AI can invoke during the conversation.
For Scenario C (two agents, two numbers), routing works differently. Instead of a persona switch within the same call, the primary agent uses native call transfer to route the caller to the secondary agent's phone number. This creates a new call leg:
Cross-number routing is configured by providing the target agent's phone number in the transfer rules, and the system generates the appropriate transfer_to_* tools with the phone number as the transfer target.
{
"role": "primary",
"primary_for_numbers": ["phone_number_id"],
"transfer_rules": [
{
"trigger": "support",
"keywords": ["support", "help"],
"target_instance_id": "...",
"announce": "Transferring you now."
}
],
"business_hours": {
"start": "09:00",
"end": "18:00",
"timezone": "Asia/Kolkata",
"days": [1, 2, 3, 4, 5]
},
"after_hours_fallback": "callback",
"max_transfers_per_call": 3,
"share_context_on_transfer": true,
"fallback_instance_id": null,
"callback_enabled": true
}A Product by BRTNeura Technology LLP
Last updated: 2026-03-05