adityagupta_14737
12/10/2025, 4:38 AMAI Evy
12/10/2025, 4:38 AMAI Evy
12/10/2025, 4:39 AMretell_llm_dynamic_variables field when using the Create Phone Call API
- **For inbound calls**: Set via the inbound webhook response
- **Default values**: Configured at the agent level as fallbacks
If you need to store or update values during a conversation, the recommended pattern is to use custom functions to manage state—returning data from tool calls that then becomes part of the LLM's context for later use. [(2) ]()
You can also capture values at the end of a call using post-call variables in the call_analyzed webhook.AI Evy
12/10/2025, 4:39 AMAI Evy
12/10/2025, 4:39 AMadityagupta_14737
12/10/2025, 4:39 AMAI Evy
12/10/2025, 4:39 AMAI Evy
12/10/2025, 4:40 AMcall_ended or call_analyzed event types. [(1) ]()
For extracting specific values after a call ends, you have two main options:
1. **Post-Call Analysis Data**: Configure post_call_analysis_data on your agent to extract custom variables (string, number, boolean, or enum types) from the call transcript. This data becomes available in the call_analyzed webhook event. [(2) ]()
2. **Collected Dynamic Variables**: During the call, if you're using Conversation Flow, variables collected via nodes are available in the collected_dynamic_variables field in the webhook payload. [(3) ]()
The call_ended webhook payload includes fields like transcript, metadata, and retell_llm_dynamic_variables that were set for the call. [(1) ]()
Example webhook payload structure:
json
{
"event": "call_ended",
"call": {
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"collected_dynamic_variables": {
"last_node_name": "Test node"
}
}
}
, [(3) ]()
If you need custom data extraction after the call, define it in post_call_analysis_data when creating or updating your agent—this will be included in the call_analyzed webhook. [(2) ]()AI Evy
12/10/2025, 4:40 AMAI Evy
12/10/2025, 4:40 AM