Overview
Dynamic variables let you write one reusable agent prompt and fill in customer-specific details when a call or chat starts. Use variables in prompts with double curly braces:Where variables work
You can use dynamic variables in:- Voice agent system prompts
- Voice agent first messages
- Per-call prompt overrides
- Chat agent prompts
context object.
Voice prompts and first messages support the full nested
contact object, including custom contact metadata. Chat prompts currently support workspace variables and flat contact aliases such as contact_name, contact_first_name, contact_company, and contact_phone.Syntax
You can chain defaults and transforms:
Built-in variables
Contact variables
Use the nestedcontact object for customer details:
Custom contact fields
Custom fields on a contact are stored inmetadata and can be referenced from voice prompts and first messages with {{contact.metadata.<key>}}.
For example, a contact with this metadata:
phone, first_name, email, company, job_title, language, and tags are mapped to normal contact fields. Unrecognized columns are stored as contact metadata using the original column header as the key.
For a CSV like:
policy_type, renewal_date, or account_manager when possible. They are easier to read in prompts and safer to reuse across imports and API-created contacts.
Contact create, update, and bulk-create API requests can also set metadata directly:
{{contact.metadata.policy_type}} for reusable contact data, or pass policy_type in per-call context if you want to reference it as {{policy_type}}.
Agent and persona variables
Date and time variables
Workspace variables
If your workspace has saved template variables, you can use them directly:Pass custom variables for one call
When creating a call, include acontext object. Each key becomes available in the prompt.
JavaScript example
Variable precedence
If the same variable name exists in multiple places, more specific values win:- System date/time variables
- Workspace variables
- Persona data
- Contact data
- Conversation data
- Per-call
contextvariables
context variables have the highest priority. Avoid custom keys named contact, persona, conversation, or memory unless you intentionally want to override those namespaces.
Best practices
- Use
{{contact.first_name|default:there}}instead of assuming every contact has a name. - Use clear, snake_case custom variable names such as
policy_type,appointment_time, orcase_reason. - Keep context values short and specific. Long background information belongs in memory, knowledge, or mid-call context injection.
- Do not put secrets, API keys, or credentials in prompt variables.
- For scheduled calls, pass all required per-call context when creating the call.

