https://retellai.com/?utm_source=discord&utm_medium=seo logo
Post Call Analysis Boolean
# ❓・ai-evy-support
c
@AI Evy Post Call Analysis Boolean. We have a boolean where it says 'The user wants a callback' but if I call and end instantly, that's false? The user hasn't even said anything?
a
Thanks for tagging me @Ciaran. I'll look through relevant sources and get back to you shortly.
### Answer I understand your concern about post-call analysis returning values for calls where no actual conversation occurred. Retell AI will not populate custom post-call analysis fields for calls that were not connected or where no conversation took place. [(1) ]() This is the expected behavior—if you call and end instantly without any spoken interaction, the post-call analysis fields should remain empty rather than being set to false or any other value. However, there have been reported cases where post-call analysis was hallucinating results even when calls didn't connect. [(2) ]() In one example, a user reported that despite a 7-second call with no pickup (just ring time) , the post-call analysis was completely populated with fabricated information. If you're seeing a boolean field being set to "false" on calls with no conversation, this appears to be inconsistent with the documented behavior. The system should leave these fields unpopulated rather than assigning them values. [(1) ]() To verify: Check whether the field exists in your webhook response before using it, as the documentation recommends. If the field is being populated when it shouldn't be, this may be a bug worth reporting to Retell AI support.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Post Call Analysis Overview](https://docs.retellai.com/features/post-call-analysis-overview) [[2] Hallucinating post call analysis](https://discord.com/channels/1186424376300679209/1447261090458112173) ​
c
@AI Evy If instead of using post call analysis for this... Could I do something where if it goes down a certain branch within the conversational flow, I set a variable, would I be able to retrieve this variable from call_analyzed webhook?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific information about setting variables within conversational flow branches and retrieving them from the
call_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?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy So... In the webhook (call_analyzed), we need to know if the agent swapped to another agent. Would I do this by looking in "tool_calls" and picking one out where it contains the substring of 'agent_swap'. That would imply it's moved to another agent right?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer I don't have specific documentation that confirms whether agent swap operations appear in the
tool_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.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy How do we know from the call_analyzed webhook that the agent swapped? Is there a way so that when the webhook comes to us, the agent_id is the transferred agent? i.e: I ring +447909090900 connected to agent_123-> Call transfers to another agent_456. In the webhook, will I be able to see it's for agent_456? I see theres these options... Post Call Analysis Setting Select which agent's analysis fields to include in the call history. Only transferred agent Both this agent and transferred agent Webhook Setting Select which agent's webhook endpoint to use for sending call updates. Only transferred agent Both this agent and transferred agent Only this agent Currently, I have Only Transferred Agent and Only this agent....
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer I don't have specific documentation that details how the
agent_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.
​ To learn more, see the sources I considered: [[1] Get Voice Agent](https://docs.retellai.com/api-references/get-agent) [[2] Create Voice Agent](https://docs.retellai.com/api-references/create-agent) [[3] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy FYI, you can set it to be Webhook Settings to be the only transferred agent. Then you'll get the webhook just from that transferred agent 🙂
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Thanks for sharing that insight! That's helpful information for others who need to track agent transfers through webhooks. To clarify based on the documentation: when you configure the Webhook Setting to "Only transferred agent," the
call_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.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.