> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# AI phone agent handovers

> Hand a live caller to another AI phone agent when an agent finishes, mid-call from a workflow, or after a teammate ends their part of the call.

The **Transfer to AI phone agent** workflow step hands a caller who is still on the line to one of your AI phone agents. The call, its session and its transcript continue; the new agent greets the caller with its own first message.

You can use the step in three places:

| Where | When it runs | Typical use |
| - | - | - |
| **IVR Incoming Call** | When the menu reaches the step | Let an agent handle one branch of a menu, then return to it. See [Transfers to an AI phone agent](https://docs.open.cx/phone/call-flows.md#transfers-to-an-ai-phone-agent) |
| **Pre-Call Finished** | When an AI agent ends the call, or a teammate ends their part while the caller is still connected | A satisfaction survey or follow-up agent instead of hanging up |
| **AI tool workflows** | When the live agent calls the workflow during the conversation | Route a caller to a specialist agent, such as billing |

## Configure the step

* **Phone agent**: any phone agent in your organization. Map it from an earlier step to choose the agent while the call runs.
* **Context for the agent (optional)**: added to the agent’s instructions for this call only. The new agent does not see the conversation so far, so pass what it needs here, such as the reason for the call or a summary from an earlier step.

Outside IVRs the step returns:

| Outcome | Meaning |
| - | - |
| `switched` | The caller stays on the line and the chosen agent joins once the current agent leaves |
| `skipped` | The call is already being transferred, another step in the same run already switched it, or the chosen agent is the one ending its part. `reason` says which |
| `failed` | No live call is waiting on this workflow, the phone agent was not found, or your AI voice minutes limit is reached. `reason` says which |

## After an agent finishes: Pre-Call Finished

**Pre-Call Finished** runs just before a call ends. When it contains **Transfer to AI phone agent**, the hang-up is replaced: the caller stays connected, the current agent leaves, and the chosen agent joins.

The trigger’s **Ended by** field tells you who is ending their part:

* **AI agent**: an AI phone agent ended the call.
* **Teammate**: a teammate clicked **End call** while the caller was still connected, or their browser disconnected and they did not reconnect in time. This applies to incoming calls, both calls the AI handed off and calls that rang teammates directly.

Branch on **Ended by** to decide which endings get the new agent. For example, offer a survey only after teammate calls, or only when the call outcome is `completed`.

When a teammate’s part ends this way:

* The teammate leaves and starts their usual wrap-up. Live transcription of the teammate’s call stops when they leave.
* The session stays open and is assigned to the AI, so it leaves the teammate’s open sessions. It closes when the new agent ends the call.
* If the caller already hung up, or the agent cannot join, the call ends as it did before. An agent that has not reached the caller 20 seconds after the teammate left also ends the call, and the session goes back to the teammate.

The switch is skipped while the call is being transferred to a transfer destination, and when the chosen agent is the one ending the call. A survey agent that hangs up after its survey is not sent back in, so the same workflow can run for every call.

## Mid-call: AI tool workflows

Add the step to an **AI Trigger** workflow the agent can use, as described in [Actions And Workflows](https://docs.open.cx/phone/agent-config.md#actions-and-workflows). When the agent runs the workflow, it stops talking and the chosen agent takes over.

The workflow must wait for its result. A workflow set to run without waiting returns `failed`, because the agent has already moved on by the time the step runs.

## Recording and AI minutes

* AI voice minutes count for each agent only while it is on the call.
* If a recording of the call is already running, for example from an IVR, a teammate’s call or the agent before, it includes the new agent’s part, and the session keeps one recording of the whole call. Otherwise the new agent records according to its own **Record calls** setting.
* On a call answered by an IVR with **Keep IVR unrecorded** on, the new agent never starts a recording of its own, whether the IVR, a teammate or another agent handed it the caller.

## Test a handover

1. Build the workflow and activate it.
2. Place a test call and reach the point where the step runs: let the agent end the call, have a teammate click **End call**, or ask for what the tool workflow handles.
3. Confirm the new agent greets you, uses the context you passed, and that the session’s transcript continues in one session.
4. Repeat with the caller hanging up first, and confirm the call simply ends.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.