Handoffs
Write the condition that moves a call from one agent to the next, and set what happens when a flow call ends.
An edge in a flow is one handoff: the agent at source may
pass the live call to the agent at target. Each edge carries a required condition
in plain language, and that sentence is the only thing the agent routes on.
{
"edges": [
{
"id": "triage-to-billing",
"source": "triage",
"target": "billing",
"label": "billing",
"condition": "the caller asks about an invoice, a refund, or a payment they already made"
},
{
"id": "triage-to-scheduling",
"source": "triage",
"target": "scheduling",
"label": "scheduling",
"condition": "the caller wants to book, move, or cancel an appointment"
},
{
"id": "billing-back-to-triage",
"source": "billing",
"target": "triage",
"label": "back to triage",
"condition": "the caller's question turns out not to be about billing at all"
}
]
}| Field | Rule |
|---|---|
id | Yours, unique within the flow. |
source, target | Node IDs in the same flow. Edges are directed: add the reverse edge if the call should be able to come back. |
label | Short human name for the handoff, unique among the edges leaving its node. |
condition | Required. Plain language describing the caller situation that should trigger this handoff. |
Writing a condition
At call time the condition becomes the description of the handoff tool the model sees. Write it as the situation the caller is in, not as an instruction to the agent: "the caller asks about an invoice or a payment" routes better than "use this to transfer to billing".
Two rules make the difference between a flow that routes crisply and one that dithers:
- Make sibling conditions disjoint. Every edge leaving the same node competes on its condition alone. If two of them could describe the same sentence from a caller, narrow both until they cannot.
- Describe the trigger, not the destination. The receiving agent's name means nothing to the agent doing the routing; the caller's words are what it has to work with.
If nothing matches, nothing happens: the agent stays where it is and keeps talking. A handoff is something the conversation earns, not a timer.
Edges replace transfer_agent
For the duration of a flow call, each member agent's
system_tools.transfer_agent
configuration is replaced by the edges leaving its node. It is a
replacement, not a merge: a target or allowed_targets list on the agent has
no effect inside a flow, and an agent that is a leaf in the graph — no outgoing
edges — gets no agent-handoff tool at all, even if its own configuration
defines one.
Nothing is written back to the agent. Dial the same agent directly and its own
transfer_agent configuration applies exactly as it always did. Archive the
flow and no agent has changed.
The rest of system_tools is untouched. Transfers to a human — warm or cold —
scheduled callbacks, and ending the call all stay under the member agent's own
control, and a caller transferred to a human leaves the flow the same way they
would leave a single-agent call.
What the receiving agent inherits
What it inherits is the conversation: it picks up from what has already been said and carries on, in the same call, on the same transcript. It does not greet the caller again: there is no hold, redial, or second answer.
What the receiving agent brings is its own: prompt, voice and pipeline, tools, guardrails, pronunciation, and turn-taking settings all come from that agent's deployed version. What it inherits is the conversation and the call itself — the same call record, the same transcript, the same recording, and the same after-call treatment, which the flow owns rather than any one agent.
What a handoff leaves behind
| Where | What you see |
|---|---|
| Transcript | The earlier agent's turns, then a row with kind: agent_handoff at the moment control passed — on voice and text calls alike. See call transcripts and webhook rows. |
| Transfer history | A record with kind: agent, method: handoff, and the new agent's slug as destination — GET /v1/calls/{id}/transfers. |
| Tool activity and trace | The handoff tool's invocation, and a handoff event on the call's trace. |
| Browser SDK | A handoff event — { fromAgent?, targetAgent?, reason?, ts }. |
| Webhooks | One call.completed delivery for the whole call, not one per agent. |
Because the call never splits, analytics count it once: one call, one duration, one outcome, however many agents spoke during it.
Limits
Every node must name an active agent in the same workspace, and every edge must
name nodes that exist and carry a non-empty condition; a graph that breaks any
of those is rejected when you save it, with the offending field paths named in
one 422 validation_failed response.
Cycles are allowed — a "back to triage" edge is normal and useful. Each handoff costs the caller a beat, so a graph where the call bounces between two agents is usually a sign that the two conditions overlap.
See also
Flows · Transfers & call actions · Pointing calls at a flow · Calls