anton333_50203
07/15/2025, 1:51 PMAI Evy
07/15/2025, 1:51 PMAI Evy
07/15/2025, 1:51 PM{{requested_app}} variable example, here's how the process works:
Where you can use dynamic variables:
- prompt
- begin message
- tool call description
- custom tool call properties description
- voicemail setting (both prompt and static text)
- transfer call function number
- warm transfer setting (both prompt and static text)
Setting up your custom variable:
1. Add the variable to your prompts using the double curly brace syntax :
json
"Hello {{user_name}}, I understand you're interested in {{requested_app}}. How can I help you today?"
2. For inbound calls, you supply dynamic variables through the Inbound Call Webhook . Your webhook response should include the dynamic_variables field [(2) ]() :
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
07/15/2025, 1:51 PM{{variable_name}}) [(3) ]()
- You can test your dynamic variables using the web interface before deploying [(1) ]()
The agent will reference your {{requested_app}} variable throughout the conversation once it's set via the webhook response, allowing personalized responses based on the data you provide.AI Evy
07/15/2025, 1:51 PMAI Evy
07/15/2025, 1:51 PManton333_50203
07/15/2025, 1:56 PMAI Evy
07/15/2025, 1:56 PMAI Evy
07/15/2025, 1:56 PMjson
{
"call_inbound": {
"override_agent_id": "agent_12345",
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}
For outbound calls, dynamic variables are set in the retell_llm_dynamic_variables field when using the Create Phone Call API, where all values must be strings [(1) ]() :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
If you need to store and reference information gathered during the conversation (like appointment times) , you would typically handle this through your function/tool call logic and potentially update external systems, but not through dynamic variables which are set at call initialization.AI Evy
07/15/2025, 1:56 PMAI Evy
07/15/2025, 1:56 PManton333_50203
07/15/2025, 1:58 PMAI Evy
07/15/2025, 1:58 PMAI Evy
07/15/2025, 1:59 PM{{requested_app}} and use conditional logic in your prompt :
Step 1: Configure agent-level default dynamic variables
Set a default value like "TBD" or "not yet specified" .
Step 2: Use conditional logic in your prompt
json
"Hello {{user_name}}, {% if requested_app == 'TBD' %}I'll help you find the right appointment time.{% else %}I understand you're interested in {{requested_app}}.{% endif %} How can I help you today?"
## Approach 2: Inbound Call Webhook for Known Information
If you have some information about the caller beforehand (from CRM, previous interactions, etc.) , you can set {{requested_app}} through the inbound call webhook [(2) ]() :
Step 1: Configure inbound call webhook
Your webhook receives the caller information:
json
{
"event": "call_inbound",
"call_inbound": {
"agent_id": "agent_12345",
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
Step 2: Look up caller data and respond
Based on from_number, look up previous appointment requests and respond:
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"dynamic_variables": {
"customer_name": "John Doe",
"requested_app": "Monday 3 December at 14:40"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
07/15/2025, 1:59 PM{{variable}} throughout the conversation [(1) ]() .
**Key limitation**: When a dynamic variable is not assigned a value, it will remain unchanged in the output as {{requested_app}} rather than being replaced .
Dynamic variables are most effective when you have the data available at call initiation, not for information collected during the conversation.AI Evy
07/15/2025, 1:59 PMAI Evy
07/15/2025, 1:59 PManton333_50203
07/15/2025, 2:01 PMAI Evy
07/15/2025, 2:01 PMAI Evy
07/15/2025, 2:02 PM{{variable}} syntax [(1) ]() .
The key distinction is:
**Function/Tool Call Responses**: The data from your example response is processed by the LLM in the context of that specific function call. The agent can use this information to formulate its next response, but this data doesn't become a dynamic variable that persists throughout the conversation [(2) ]() .
**Dynamic Variables**: These are set at call initiation and can be referenced throughout the conversation using {{variable_name}} syntax. For inbound calls, they're set through the Inbound Call Webhook response structure [(3) ]() :
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}
So in your example, the information from the function response ("status": "available", "message": "The requested appointment time is available.", etc.) is available to the LLM for generating the immediate response, but it doesn't get stored as a persistent {{requested_app}} variable that can be referenced later in the conversation.AI Evy
07/15/2025, 2:02 PMAI Evy
07/15/2025, 2:02 PManton333_50203
07/15/2025, 2:05 PMAI Evy
07/15/2025, 2:05 PMAI Evy
07/15/2025, 2:05 PMdynamic_variables field [(1) ]() or through the retell_llm_dynamic_variables field for outbound calls [(2) ]() , but these are different from function/tool call responses.
For your specific question about whether an agent can recall "Monday 3 December at 14:40" later in the conversation after receiving it in a function response - I don't have documentation that explains how or where this information is stored internally within Retell AI's system.AI Evy
07/15/2025, 2:05 PMAI Evy
07/15/2025, 2:05 PMAI Evy
07/15/2025, 2:12 PM