faizan_53123
12/09/2025, 12:52 PMAI Evy
12/09/2025, 12:52 PMAI Evy
12/09/2025, 12:52 PMWhen user states his name and phone number, please extract the information by calling the `extract_user_details` function.
For setting dynamic variables before a call starts, you would need to:
- Use the retell_llm_dynamic_variables field in the [Create Phone Call API](/api-references/create-phone-call) for outbound calls [(2) ]()
- Supply them via the [Inbound Call Webhook](/features/inbound-call-webhook) for inbound calls
- Set default values at the agent level as a fallbackAI Evy
12/09/2025, 12:52 PMAI Evy
12/09/2025, 12:52 PMfaizan_53123
12/09/2025, 1:02 PMAI Evy
12/09/2025, 1:02 PMAI Evy
12/09/2025, 1:02 PMcall_ended webhook fires and POSTs the call object to your endpoint, which includes the retell_llm_dynamic_variables that were used during the call. [(2) ]()
Sample payload structure:
json
{
"event": "call_ended",
"call": {
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"transcript": "...",
...
}
}
If you need to capture values extracted during the call, use the Extract Dynamic Variables tool to save them as dynamic variables, then access them in the call_ended or call_analyzed webhook payload. [(3) ]()
For storing custom data after a call, you would typically:
1. Receive the webhook payload on your server
2. Process and store the relevant data (transcript, extracted variables, metadata) in your own backend/database
The webhook itself is for receiving call data, not for setting variables back into Retell after the call ends. [(8) ]()AI Evy
12/09/2025, 1:02 PMAI Evy
12/09/2025, 1:02 PMfaizan_53123
12/09/2025, 1:09 PMAI Evy
12/09/2025, 1:09 PMAI Evy
12/09/2025, 1:09 PM+12137774445)
Option 2: SDK/API
javascript
const response = await retellClient.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
}) ;
[(2) ]()
Option 3: Batch Calls
- Navigate to the Batch Call tab and click "Create Batch Call" [(3) ]()
- Upload a CSV with phone numbers
### Web Calls
Use the Web SDK to create browser-based calls:
javascript
await retellWebClient.startCall({
accessToken: createCallResponse.access_token,
}) ;
[(4) ]()
Make sure your phone number is properly configured with an outbound_agent_id, or use override_agent_id in your request. [(9) ]()AI Evy
12/09/2025, 1:09 PMAI Evy
12/09/2025, 1:09 PMfaizan_53123
12/09/2025, 1:10 PMfaizan_53123
12/09/2025, 1:10 PMAI Evy
12/09/2025, 1:10 PMAI Evy
12/09/2025, 1:10 PMcall_ended webhook:
1. Use the Extract Dynamic Variables tool during the conversation to save values extracted from user responses as dynamic variables
2. Receive them in the call_ended webhook payload — the retell_llm_dynamic_variables field will contain all dynamic variables that were set or extracted during the call [(2) ]()
Sample call_ended webhook payload:
json
{
"event": "call_ended",
"call": {
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"transcript": "...",
...
}
}
The webhook is for receiving call data after completion — you cannot set new variables back into Retell via the webhook response. Your server receives the payload, then you process and store the relevant extracted variables in your own backend/database.AI Evy
12/09/2025, 1:10 PMAI Evy
12/09/2025, 1:10 PMfaizan_53123
12/09/2025, 1:47 PMAI Evy
12/09/2025, 1:47 PMAI Evy
12/09/2025, 1:47 PMText, Number, Enum, or Boolean
Variable Types available:
- Text – Any word or sentence (e.g., "headache", "John Smith")
- Number – A numeric value (e.g., 42, 98.6)
- Enum – A value from a predefined list (e.g., "Yes", "No", "Maybe")
- Boolean – True or false
What you can do with extracted variables: [(2) ]()
- Reference collected data anytime during the call
- Pass dynamic variables to webhooks, CRMs, or integrations
- Personalize workflows in real time
This works in both Single/Multi Prompt agents and Conversation Flow agents.AI Evy
12/09/2025, 1:47 PMAI Evy
12/09/2025, 1:47 PMfaizan_53123
12/09/2025, 1:50 PMAI Evy
12/09/2025, 1:50 PMAI Evy
12/09/2025, 1:50 PMBefore ending the call, extract the relevant information by calling the `extract_call_summary` function.
The extracted values will then be saved as dynamic variables and included in the retell_llm_dynamic_variables field of your call_ended webhook payload.
This way, the values are captured during the call (just before it ends) and are available in your webhook for processing in your backend.AI Evy
12/09/2025, 1:50 PMAI Evy
12/09/2025, 1:50 PMfaizan_53123
12/09/2025, 1:51 PMAI Evy
12/09/2025, 1:51 PMAI Evy
12/09/2025, 1:52 PMretell_llm_dynamic_variables field is included in both call_ended and call_analyzed webhook events. [(1) ]()
The webhook payload contains the call object, which includes the retell_llm_dynamic_variables field:
json
{
"event": "call_ended",
"call": {
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
...
}
}
Since both call_ended and call_analyzed webhooks POST the call object to your endpoint, and the call object contains retell_llm_dynamic_variables, the extracted dynamic variables will be available in both webhook events.
The call_analyzed webhook is triggered after post-call analysis completes and includes additional fields like call_analysis with sentiment, summary, and custom analysis data. [(2) ]() , [(4) ]()AI Evy
12/09/2025, 1:52 PMAI Evy
12/09/2025, 1:52 PMfaizan_53123
12/09/2025, 2:00 PMAI Evy
12/09/2025, 2:00 PMAI Evy
12/09/2025, 2:00 PMAICallCompleted: true at call completion using the Extract Dynamic Variables tool:
1. Add an Extract Dynamic Variable Tool to your agent with:
- Variable Name: AICallCompleted
- Variable Type: Boolean
- Description: Set to true when the call is completed [(1) ]()
2. Update your prompt to instruct the agent to call the extraction function right before ending the call. For example:
Before ending the call, extract the call completion status by calling the extract function and set AICallCompleted to true.
The extracted AICallCompleted: true value will then be included in the retell_llm_dynamic_variables field of your call_ended and call_analyzed webhook payloads.
Important: When referencing the variable in your tool description, use the {{variable_name}} format to ensure it's properly passed. [(4) ]()AI Evy
12/09/2025, 2:00 PMAI Evy
12/09/2025, 2:00 PMfaizan_53123
12/10/2025, 4:48 AMAI Evy
12/10/2025, 4:48 AMAI Evy
12/10/2025, 4:48 AMAICallCompleted variable to true. [(1) ]()
Since you're using a Boolean variable type, the agent will extract and save true as the value for AICallCompleted when that function is called.
One important note: Retell AI passes dynamic variables as strings, not native booleans. [(2) ]() So when you receive AICallCompleted in your webhook, it may come through as the string "true" rather than a boolean true. Make sure your backend handles this accordingly.AI Evy
12/10/2025, 4:48 AMAI Evy
12/10/2025, 4:48 AMAI Evy
12/10/2025, 4:52 AMfaizan_53123
12/10/2025, 4:52 AMend_call() to hang up the call
SO can you please update this? my extract Dynamic variable function name is 'call_completion_status' and the variable name is callCompleted.AI Evy
12/10/2025, 4:52 AMWhen the intake is completed and the user does not have any further questions, first call the function `call_completion_status` to set callCompleted to true, then call the function `end_call() ` to hang up the call.
[(1) ]()
This ensures the agent extracts and saves the callCompleted variable before hanging up, so it will be included in your call_ended webhook payload under retell_llm_dynamic_variables.AI Evy
12/10/2025, 4:52 AMAI Evy
12/10/2025, 4:52 AM