jhon1212_jhones
11/01/2025, 12:07 PMAI Evy
11/01/2025, 12:07 PMAI Evy
11/01/2025, 12:07 PMretell_llm_dynamic_variables field :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
All values in retell_llm_dynamic_variables must be strings .
### 2. Extract Variables During the Call
You can extract and store dynamic variables live during the conversation [(2) ]() . Your agent can automatically save information like names, emails, IDs, and preferences .
Variable types you can collect include :
- Text: Names, addresses, feedback
- Numbers: Ages, quantities, prices
- Boolean: Yes/no decisions, preferences
- Enum: Predefined lists (services, products, etc.)
### 3. Reference Variables in Your Agent
Use the {{variable_name}} syntax in your prompts, begin messages, tool configurations, and other settings [(1) ]() . For example:
"Hello {{user_name}}, I understand you're interested in {{product_name}}. How can I help you today?"
### 4. Retrieve Collected Variables
After the call, you can retrieve collected dynamic variables using the Get Call API [(3) ]() . The response includes a collected_dynamic_variables field :
json
{
"collected_dynamic_variables": {
"last_node_name": "Test node"
}
}
This works in both single, multi-prompt, and conversation flow agents [(2) ]() .AI Evy
11/01/2025, 12:07 PMAI Evy
11/01/2025, 12:07 PMjhon1212_jhones
11/01/2025, 12:09 PMjhon1212_jhones
11/01/2025, 12:09 PMAI Evy
11/01/2025, 12:09 PMAI Evy
11/01/2025, 12:09 PMjson
{
"agent_id": "agent_12345",
"retell_llm_dynamic_variables": {
"user_id": "uid_67890",
"customer_name": "John Doe"
}
}
The retell_llm_dynamic_variables field allows you to pass your UID and any other variables you need .
### Setting Up the Webhook
Configure the inbound webhook URL when creating or updating your phone number [(2) ]() :
json
{
"inbound_webhook_url": "<https://example.com/inbound-webhook%22>
}
## Using the UID in Your Agent
Once passed via the webhook, you can reference the UID throughout your agent using the {{variable_name}} syntax [(3) ]() :
- In prompts: "Processing request for user {{user_id}}"
- In tool configurations and descriptions
- In custom function URLs
The UID will be available for the entire call session and can be used to trigger actions, look up data, or pass to other systems via tool calls [(3) ]() [(4) ]() .
---
**AI Evy
11/01/2025, 12:09 PMAI Evy
11/01/2025, 12:09 PMjhon1212_jhones
11/01/2025, 12:15 PMAI Evy
11/01/2025, 12:15 PMAI Evy
11/01/2025, 12:16 PMbooking_1_uid and booking_2_uid as dynamic variables, you can reference them using the {{variable_name}} syntax :
- {{booking_1_uid}} for the first booking
- {{booking_2_uid}} for the second booking
### Step 3: Pass UIDs to Your Next Function
When the caller confirms which booking to modify, your agent can call the cancel/reschedule function with the appropriate UID using dynamic variables in the tool configuration .
## Key Points
- All values in dynamic variables must be strings
- Dynamic variables work in tool configurations, custom function URLs, and tool descriptions
- The spaces around variable names will be trimmed when evaluating the variable
This approach allows you to capture UIDs from one function's response and pass them to subsequent functions during the same call session.AI Evy
11/01/2025, 12:16 PMAI Evy
11/01/2025, 12:16 PM