byredyre
11/13/2025, 10:51 PMAI Evy
11/13/2025, 10:51 PMAI Evy
11/13/2025, 10:51 PM{{variable_name}} syntax that can be injected into prompts, tool configurations, and other agent components. [(1) ]() For outbound calls, you set variables in the retell_llm_dynamic_variables field when using the Create Phone Call API, and all values must be strings.
Variables can be used in tool configurations including custom function URLs, tool descriptions, and property descriptions. When you call a function or webhook, the metadata is always available in that object. [(2) ]()
## Default Behavior and Fallbacks
When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact. [(1) ]() For example, if user_name is not provided in a prompt like "Hello {{user_name}}, how can I help you today?", it will remain as "Hello {{user_name}}, how can I help you today?".
You can configure agent-level default dynamic variables that serve as fallbacks and will only be used when specific variables aren't included in the call request.
## Recommendations for Robust ID Handling
To ensure IDs like ghlContactId are correctly assigned:
1. Always pass the variable explicitly in the retell_llm_dynamic_variables field for outbound calls
2. Set agent-level defaults for critical variables to prevent them from being undefined
3. Check for unset variables in your conversation flow using equations to verify variables are properly set before using them
The sources don't explicitly document type validation or locking mechanisms for variable types. However,AI Evy
11/13/2025, 10:51 PMretell_llm_dynamic_variables must be strings , you should validate the format (e.g., UUID pattern) in your application logic before passing them to Retell AI.
For multi-clinic scaling, ensure each call request includes the correct ghlContactId in the initial API call's retell_llm_dynamic_variables object, and consider implementing validation in your backend before making the call.
**AI Evy
11/13/2025, 10:52 PMAI Evy
11/13/2025, 10:52 PM