{{variable_name}} syntax, you can create agents that adapt to different contexts while keeping consistent conversation flows.
Common use cases:
- Personalized greetings:
Hello {{customer_name}}, thanks for calling! - Context-aware responses:
I see you're calling about order {{order_id}} - Dynamic routing: transfer to different numbers based on
{{department}} - Time-sensitive info: reference
{{appointment_date}}or{{deadline}}
Where Dynamic Variables Work
Dynamic variables can be used in:- Prompts — agent instructions and personality
- Begin message — opening greeting
- Tool configurations — custom function URLs, tool descriptions, property descriptions
- Call handling — voicemail prompts and messages, transfer call phone numbers, warm transfer instructions, webhook URLs
Setup
1
Add variables to your prompt
Use
{{variable_name}} wherever you want to inject data. A variable picker appears when you type {{ — filter by typing more characters, then select with Enter, click, or Tab.2
Set agent-level defaults (optional)
Configure default values in agent settings. Defaults are used as fallback when a variable is not supplied in the call request.
3
Pass variables in production
- Outbound calls
- Inbound calls
Set variables in the
retell_llm_dynamic_variables field of the Create Phone Call API:Default System Variables
UponAI provides these variables automatically — no configuration needed:Phone Call Variables
Chat Variables
Nested Variables
You can nest variables inside system variable names:my_timezone is set to America/Los_Angeles, this evaluates to {{current_time_America/Los_Angeles}} first, then resolves to the actual time.
Handling Missing Variables
When a variable has no assigned value, it remains as raw text with curly braces intact:- Set defaults at the agent level as fallback values
- Design prompts that work with or without variables
- Test with both set and unset variable states
- Document which variables are required vs optional