Using Variables in Your Voice Agent
Variables let you insert dynamic, caller-specific information into your agent's greetings, scripts, SMS messages, and actions. Instead of hard-coding details, use variables to personalize every interaction automatically.
Available on: All AI Voice Agent plans.
Available Variables
Caller Variables
| Variable | Source | Example value |
|---|---|---|
{{caller_name}} | CRM or conversation | "Sarah Chen" |
{{caller_number}} | Caller ID | "+1 (555) 123-4567" |
{{caller_company}} | CRM | "Acme Corp" |
Conversation Variables
| Variable | Source | Example value |
|---|---|---|
{{reason}} | Extracted from conversation | "Billing question about March invoice" |
{{summary}} | AI-generated after call | "Caller asked about invoice #1234..." |
{{appointment_details}} | Calendar integration | "Thursday, March 14 at 2:00 PM" |
{{disposition}} | Assigned by agent | "Qualified Lead" |
Agent Variables
| Variable | Source | Example value |
|---|---|---|
{{agent_name}} | Agent configuration | "Reception Bot" |
{{business_name}} | Agent role description | "Acme Dental" |
{{business_hours}} | Agent configuration | "Mon–Fri, 8 AM – 5 PM" |
Custom Variables (via Fetch Context)
Any field returned by your Fetch Context endpoint is available as a variable:
| Variable | Source | Example value |
|---|---|---|
{{account_status}} | Your API | "Active" |
{{plan}} | Your API | "Enterprise" |
{{recent_ticket}} | Your API | "Billing discrepancy — pending" |
Where to Use Variables
Greetings
"Hi {{caller_name}}, welcome back to {{business_name}}."
Call Flow Scripts
"I see you're on the {{plan}} plan. Let me help you with your {{reason}}."
SMS Messages (During and After Call)
"Hi {{caller_name}}, your appointment is confirmed for {{appointment_details}}."
System Prompts
"The caller's account status is {{account_status}}. If the account is suspended, transfer to billing immediately."
Fallback Behavior
When a variable has no value (e.g., {{caller_name}} for an unknown caller), the agent handles it gracefully:
- In greetings and scripts, the agent omits the variable and uses a generic alternative
- In SMS templates, empty variables render as blank — write templates that work without them
Tip: Write fallback-safe templates:
"Hi {{caller_name}}, thanks for calling {{business_name}}." Falls back to: "Hi, thanks for calling Acme Dental."
Related Articles
- Dynamic Greetings — context-aware opening lines
- Automated Follow-Up Messages — post-call SMS setup
- AI Voice Agent Actions — during-call and after-call actions
- Fetch Context Before Every Call — pre-call data retrieval