Variables
Personalize agent responses with dynamic information.
You can use ${variable_name} to insert insert dynamic information in prompts, messages and API inputs.
System variables
These are default variables and can be accessed by every agent.
|
Variable |
Description |
Example |
|---|---|---|
|
${currentTime} |
Current time in agent timezone |
12:30 PM |
|
${currentDate} |
Current date in agent timezone |
Monday, June 19, 2025 |
|
${currentDateISO} |
Current date in ISO 8601 format |
2025-06-19 |
|
${currentTimeISO} |
Current date time in ISO 8601 format |
2025-07-07T13:35:15.154Z |
|
${timeOfDay} |
Time of day like morning, afternoon, etc. |
Hi, good ${timeOfDay} |
|
${caller} |
Caller’s phone number |
+918960904324 |
|
${callee} |
Callee’s phone number |
+918960904324 |
|
${callSid} |
Unique id of the call |
|
|
${humanContext} |
Human transfer window based instructions for agent |
Task variables
When creating an outbound calling task, you can provide user specific context to the agent using context variables.
-
CSV upload: Add columns for the information you want the agent to use, and reference them in your prompts using the format
${column_header}. For example, if your CSV has headers likecustomer_nameandorder_id, you can reference them as${customer_name}and${order_id}within the agent prompt. -
Create task API: Pass a context object containing any custom keys you need, and reference those keys in the agent prompt with
${key_name}."context": { "customer_name": "Aditi", "booking_id": "12345678" }
Where can I use these variables?
Intro message
To address the callee by their name. (Ex: Hi, am I speaking with ${name}?)
To greet the caller. (Ex: Good ${timeOfDay}. How may I help you today?)
API Inputs
Use ${caller} in the pre call API endpoint to fetch information about the caller from CRM or any database just before the call starts.
Prompt
Reference information from pre call API or task context in the prompt to guide agent behaviour.
Example: Reschedule Order Delivery
## Customer and order information
customer name - ${name}
failed delivery date - ${last_delivery_date}
reason for failed delivery - ${reason}
customer address - ${address}
- Confirm the reason for failed delivery and collect new delivery date.
Remember, variables are replaced with actual values before going to the LLM, so write instructions that will still make complete sense post-substitution.
Variable: ${customerType}
Possible values: "regular" or "premium"
Instruction:
- If ${customerType} is premium then use path A else path B.
How LLM will receive it:
- If regular is premium then use path A else path B.
Unclear instruction post variable substitution
Instruction:
- Customer type : ${customerType}
- If customer type is premium then use path A else path B.
How LLM will receive it:
- Customer type : regular
- If customer type is premium then use path A else path B.
Clear instruction post variable substitution