byredyre
10/29/2025, 10:50 PMAI Evy
10/29/2025, 10:50 PMAI Evy
10/29/2025, 10:50 PM{{customer_name}} [(1) ]() [(2) ]() [(3) ]() [(4) ]()
- {{user_number}} [(5) ]()
Custom Dynamic Variables:
You can define your own custom dynamic variables using the retell_llm_dynamic_variables object [(1) ]() [(2) ]() [(3) ]() [(4) ]() . For example:
json
{
"customer_name": "John Doe"
}
Collected Dynamic Variables:
The collected_dynamic_variables object stores variables collected during the call, such as:
json
{
"last_node_name": "Test node"
}AI Evy
10/29/2025, 10:50 PM{{first_name}}. For dynamic variables specific to your use case, you'll need to define them in the retell_llm_dynamic_variables object when creating or updating calls [(1) ]() [(2) ]() [(3) ]() [(4) ]() .
**AI Evy
10/29/2025, 10:50 PMAI Evy
10/29/2025, 10:50 PMbyredyre
10/29/2025, 10:51 PMAI Evy
10/29/2025, 10:51 PMAI Evy
10/29/2025, 10:51 PMretell_llm_dynamic_variables field . All values must be strings :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
2. Review Your Agent Configuration
You can set default values for dynamic variables at the agent level in your agent settings . These serve as fallback values when specific variables aren't included in the call request .
3. Test in the Dashboard
Before deploying, test your dynamic variables using the web interface . This allows you to verify that variables like {{user_name}} or {{first_name}} are working correctly.
For Your First Name Variable:
There is no built-in {{first_name}} variable - you need to define it yourself . In your prompts or SMS nodes, you would use syntax like:
"Hello {{first_name}}, thanks for calling!"
Then when creating calls via API, include:
json
{
"first_name": "Sarah"
}
[(2) ]()
System Variables (Pre-defined) :
Retell does provide some default system variables that require no configuration, including {{current_time}}, {{user_number}}, {{agent_number}}, and {{call_id}} [(1) ]() .
Dynamic variables can be used in prompts, begin messages, tool configurations, SMS content, and webhook URLs [(1) ]() [(3) ]() .AI Evy
10/29/2025, 10:51 PMAI Evy
10/29/2025, 10:51 PMbyredyre
10/29/2025, 11:38 PMAI Evy
10/29/2025, 11:38 PMAI Evy
10/29/2025, 11:38 PMfirst_name or last_name variables in Retell AI. [(1) ]()
However, Retell AI provides several default system variables that are automatically available without configuration:
Time & Calendar Variables:
- {{current_time}} - Current time in America/Los_Angeles
- {{current_time_[timezone]}} - Current time in specified timezone (e.g., {{current_time_Australia/Sydney}})
- {{current_calendar}} - 14-day calendar in America/Los_Angeles
- {{current_calendar_[timezone]}} - 14-day calendar in specified timezone
Session Variables:
- {{current_agent_state}} - Current state name (for multi-state agents)
- {{previous_agent_state}} - Previous state name (for multi-state agents)
- {{session_type}} - Session type, voice or chat
- {{session_duration}} - How long the session has been running
Phone Call Variables (phone calls only) :
- {{direction}} - Call direction, inbound or outbound
- {{user_number}} - User's phone number
- {{agent_number}} - Agent's phone number
- {{call_id}} - Current call session id
- {{call_type}} - Call type, web_call or phone_call
Chat Variables (chat sessions only) :
- {{chat_id}} - The unique identifier for the current chat session
For custom fields like first_name or last_name, you need to define them yourself in the retell_llm_dynamic_variables object when creating calls. [(2) ]() [(1) ]() All values must be strings. [(1) ]()AI Evy
10/29/2025, 11:38 PMAI Evy
10/29/2025, 11:38 PM