Ciaran
06/10/2026, 8:42 AMAI Evy
06/10/2026, 8:42 AMAI Evy
06/10/2026, 8:42 AMAI Evy
06/10/2026, 8:42 AMAI Evy
06/10/2026, 8:42 AMCiaran
06/10/2026, 8:45 AMAI Evy
06/10/2026, 8:45 AMAI Evy
06/10/2026, 8:45 AMcall_analyzed webhook.
The sources cover dynamic variables, which allow you to inject personalized data into your agent's responses using the {{variable_name}} syntax. [(1) ]() These can be used in prompts, begin messages, tool configurations, and other settings. For inbound calls, you can supply dynamic variables through the inbound call webhook. [(2) ]()
However, the sources don't explicitly document whether variables set during a conversation flow execution can be retrieved in the call_analyzed webhook payload, or how to programmatically set variables from within specific flow branches.
I'd recommend checking the webhook payload documentation or reaching out to Retell AI support to confirm whether this approach is supported and how to implement it.
Potentially helpful resources:
- [Dynamic Variables]()
- [Inbound webhook]()
Would you like me to try providing a general answer based on common patterns, or would you prefer to contact support for definitive guidance on this specific use case?AI Evy
06/10/2026, 8:45 AMAI Evy
06/10/2026, 8:45 AMCiaran
06/10/2026, 4:11 PMAI Evy
06/10/2026, 4:11 PMAI Evy
06/10/2026, 4:11 PMtool_calls field of the call_analyzed webhook payload, or whether searching for an 'agent_swap' substring would reliably detect agent transfers.
The webhook documentation shows that the call_analyzed event is triggered when call analysis is complete and includes the full call data including the call_analysis object. [(1) ]() The call_analyzed webhook payload contains the call object with all fields except initially, then includes call_analysis when analysis completes.
However, the available sources don't explicitly document:
- Whether agent swap/transfer actions are recorded in tool_calls
- The specific naming convention or structure for agent swap entries
- How to reliably detect if an agent swap occurred from the webhook payload
I recommend:
- Examining an actual call_analyzed webhook payload from a call where you know an agent swap occurred to see if and how it appears in tool_calls
- Contacting Retell AI support to confirm the recommended approach for detecting agent swaps in webhook data
This would give you definitive guidance on whether your proposed approach of checking for 'agent_swap' substrings in tool_calls is the correct method.AI Evy
06/10/2026, 4:11 PMAI Evy
06/10/2026, 4:11 PMCiaran
06/10/2026, 4:14 PMAI Evy
06/10/2026, 4:14 PMAI Evy
06/10/2026, 4:14 PMagent_id field behaves in the call_analyzed webhook when an agent transfer occurs, or how the "Post Call Analysis Setting" and "Webhook Setting" options you mentioned affect which agent's ID appears in the webhook payload.
The available sources show that agents have various webhook configuration options including webhook_url and webhook_events fields [(1) ]() [(2) ]() [(3) ]() , but they don't explicitly document:
- Whether the agent_id in the webhook reflects the initial agent or the transferred agent
- How the "Only transferred agent" vs "Both this agent and transferred agent" settings affect the webhook payload structure
- Whether you receive separate webhooks or a combined payload when "Both" is selected
Your current configuration ("Only Transferred Agent" for post-call analysis and "Only this agent" for webhook) seems contradictory and may not give you the behavior you're looking for.
I recommend:
- Testing your current setup to see which agent_id appears in the call_analyzed webhook after a transfer
- Trying "Both this agent and transferred agent" for the webhook setting to see if you receive information about both agents
- Contacting Retell AI support for definitive guidance on how these settings affect the webhook payload structure
This would clarify whether the webhook will show agent_456 in your example scenario.AI Evy
06/10/2026, 4:14 PMAI Evy
06/10/2026, 4:14 PMCiaran
06/10/2026, 4:19 PMAI Evy
06/10/2026, 4:19 PMAI Evy
06/10/2026, 4:20 PMcall_analyzed webhook will be sent from the transferred agent's webhook endpoint, and the agent_id in the webhook payload should reflect the transferred agent (agent_456 in your example) . [(1) ]()
This configuration allows you to specifically capture post-call analysis and webhook events from the agent that ultimately handled the call after the transfer, which is exactly what you need to determine that an agent swap occurred.AI Evy
06/10/2026, 4:20 PMAI Evy
06/10/2026, 4:20 PM