The Agent Swap node (type: "agent_swap", node list label Agent Transfer) hands the conversation to another agent when the flow reaches it. The call keeps its call_id, transcript and collected variables; the new agent's prompt or flow, tools and settings take over. It works the same way as the Agent Transfer function, at a fixed point instead of when the LLM decides.
Configure#
- Add an Agent Transfer node.
- Optional Instruction: what to say before switching.
- Pick the Agent.
- Keep current voice is on by default. Turn it off to switch to the new agent's voice.
- Connect Swap failed.
How it runs#
- The instruction, if any, is spoken and played out.
- The call switches to the new agent. A multi-prompt agent starts in its starting state; a flow agent starts at its start node.
- The new agent generates the next reply.
- If the switch fails, the flow follows Swap failed, or stays in the node when it is not connected.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
type |
"agent_swap" |
||
agent_id |
string | Target agent | |
agent_version |
integer | latest | API only |
keep_current_voice |
boolean | true |
|
instruction |
{type, text} |
Optional | |
edge |
edge | Swap failed |
{
"id": "node_to_billing_agent",
"type": "agent_swap",
"name": "Billing specialist",
"agent_id": "agent_9d1e...",
"keep_current_voice": true,
"instruction": { "type": "static_text", "text": "Let me bring in our billing assistant." },
"edge": { "id": "edge_swap_failed", "destination_node_id": "node_take_message", "transition_condition": { "type": "prompt", "prompt": "Swap failed" } }
}Gotchas#
- The target agent continues mid-call. Write its prompt (or start node) to pick up from a handover rather than greet.
- The swap is recorded as an
agent_swapevent on the call, and the call record points at the new agent from then on.