Overview
Use WarmTransferTask to execute an agent-assisted warm transfer. The task automatically manages the complexities of the transfer workflow, including dialing the supervisor, providing context, and merging the calls.
WarmTransferTask handles the following:
- Creating a separate room for the human agent.
- Dialing the supervisor/human agent using SIP.
- Playing hold music to the caller while connecting.
- Providing the human agent with conversation history and context.
- Disabling I/O for the caller during the transfer process.
- Providing tools for the human agent to:
connect_to_caller: Connect the human agent to the original caller.decline_transfer: Decline the transfer with a reason.voicemail_detected: Handle voicemail detection.
The task returns a WarmTransferResult data class with one field: human_agent_identity.
Agent-assisted warm transfer
Usage
For a basic example, see the following code snippet:
from livekit.agents.beta.workflows import WarmTransferTaskresult = await WarmTransferTask(target_phone_number=<supervisor-phone-number>, # Supervisor's phone numbersip_trunk_id=<outbound-trunk-id>, # Outbound trunk IDchat_ctx=self.chat_ctx, # Conversation history)
You can set the outbound trunk ID as an environment variable LIVEKIT_SIP_OUTBOUND_TRUNK:
export LIVEKIT_SIP_OUTBOUND_TRUNK=<outbound-trunk-id>
Parameters
For a full list of parameters, see the WarmTransferTask reference.
You can customize the behavior of WarmTransferTask by passing additional parameters:
stringRequiredThe phone number to dial for the warm transfer.
AudioSource | AudioConfig | list | NoneOptionalDefault: BuiltinAudioClip.HOLD_MUSICAudio to play while the caller is on hold. By default, plays BuiltinAudioClip.HOLD_MUSIC.
stringOptionalAdditional instructions for the transfer agent. These instructions are passed to the transfer (or supervisor) agent along with the conversation history and the default instructions.
listOptionalAdditional tools that can be used in the execution of the transfer task. These tools can be used in place of, or in addition to, the default tools.

