Skip to main content

Overview

Dynamic variables allow you to inject personalized data into your agent’s responses for each specific call. Using the {{variable_name}} syntax, you can create agents that adapt to different contexts while maintaining consistent conversation flows.

Common Use Cases

  • Personalized greetings: “Hello {{customer_name}}, thanks for calling!”
  • Context-aware responses: “I see you’re calling about order {{order_id}}
  • Dynamic routing: Transfer to different numbers based on {{department}}
  • Time-sensitive information: Reference {{appointment_date}} or {{deadline}}

Where Dynamic Variables Work

Dynamic variables can be used in:
  • Prompts: Agent instructions and personality
  • First message: Opening greeting
  • Tool configurations:
    • Custom function URLs
    • Tool descriptions
    • Property descriptions
  • Call handling:
    • Voicemail prompts and messages
    • Transfer call phone numbers
    • Warm transfer instructions
  • Webhook url

Add & test dynamic variables

1

Add dynamic variables in your prompts

Dynamic variables are placeholders surrounded by double curly braces. For example:
"Hello {{name}}, I understand you're interested in {{product_name}}. How can I help you today?"
2

Test your dynamic variables

Before deploying, test your dynamic variables using the web interface
3

Implement in production

For Outbound Calls

When using the Create Phone Call API, set your variables in the dynamic_variables field. Note that all values must be strings:
{
    "name": "John Smith",
    "product_name": "Premium Plan"
}
The spaces around the variable name will be trimmed when evaluating the variable.

Default Variables

OpenMic automatically provides these system variables - no configuration required:

Basic Date/Time Variables

VariableDescriptionExample
{{now}}Current UTC time in readable format”Oct 24, 2025 02:30 PM”
{{date}}Current UTC date”Oct 24, 2025”
{{time}}Current UTC time”02:30 PM”
{{month}}Current month name (UTC)“October”
{{day}}Current day of month (UTC)“24”
{{year}}Current year (UTC)“2025”

Timezone-Specific Variables

OpenMic supports comprehensive timezone variables with the following format: {{variable.timezone_suffix}}

US Timezones

SuffixTimezoneExample Variables
estUS/Eastern{{now.est}}, {{date.est}}, {{time.est}}
cstUS/Central{{now.cst}}, {{date.cst}}, {{time.cst}}
mstUS/Mountain{{now.mst}}, {{date.mst}}, {{time.mst}}
pstUS/Pacific{{now.pst}}, {{date.pst}}, {{time.pst}}
hstUS/Hawaii{{now.hst}}, {{date.hst}}, {{time.hst}}
akstUS/Alaska{{now.akst}}, {{date.akst}}, {{time.akst}}

European Timezones

SuffixTimezoneExample Variables
gmtEurope/London{{now.gmt}}, {{date.gmt}}, {{time.gmt}}
cetEurope/Paris{{now.cet}}, {{date.cet}}, {{time.cet}}
eetEurope/Athens{{now.eet}}, {{date.eet}}, {{time.eet}}
mskEurope/Moscow{{now.msk}}, {{date.msk}}, {{time.msk}}

Asian Timezones

SuffixTimezoneExample Variables
istAsia/Kolkata{{now.ist}}, {{date.ist}}, {{time.ist}}
jstAsia/Tokyo{{now.jst}}, {{date.jst}}, {{time.jst}}
kstAsia/Seoul{{now.kst}}, {{date.kst}}, {{time.kst}}
cst_asiaAsia/Shanghai{{now.cst_asia}}, {{date.cst_asia}}, {{time.cst_asia}}
sgtAsia/Singapore{{now.sgt}}, {{date.sgt}}, {{time.sgt}}
hktAsia/Hong_Kong{{now.hkt}}, {{date.hkt}}, {{time.hkt}}

Australian Timezones

SuffixTimezoneExample Variables
awstAustralia/Perth{{now.awst}}, {{date.awst}}, {{time.awst}}
acstAustralia/Adelaide{{now.acst}}, {{date.acst}}, {{time.acst}}
aestAustralia/Sydney{{now.aest}}, {{date.aest}}, {{time.aest}}

Other Global Timezones

SuffixTimezoneExample Variables
nzstPacific/Auckland{{now.nzst}}, {{date.nzst}}, {{time.nzst}}
fjtPacific/Fiji{{now.fjt}}, {{date.fjt}}, {{time.fjt}}
brtAmerica/Sao_Paulo{{now.brt}}, {{date.brt}}, {{time.brt}}
artAmerica/Argentina/Buenos_Aires{{now.art}}, {{date.art}}, {{time.art}}
eatAfrica/Nairobi{{now.eat}}, {{date.eat}}, {{time.eat}}
catAfrica/Harare{{now.cat}}, {{date.cat}}, {{time.cat}}
watAfrica/Lagos{{now.wat}}, {{date.wat}}, {{time.wat}}
sastAfrica/Johannesburg{{now.sast}}, {{date.sast}}, {{time.sast}}
trtEurope/Istanbul{{now.trt}}, {{date.trt}}, {{time.trt}}
israelAsia/Jerusalem{{now.israel}}, {{date.israel}}, {{time.israel}}
gstAsia/Dubai{{now.gst}}, {{date.gst}}, {{time.gst}}
utcUTC{{now.utc}}, {{date.utc}}, {{time.utc}}
All timezone variables follow the same format patterns as the basic variables (now, date, time, month, day, year) but adjusted for the specific timezone.

Handling Missing Variables

Default Behavior

When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact: Example:
  • Prompt: "Hello {{name}}, how can I help you today?"
  • If name is not provided: "Hello {{name}}, how can I help you today?"
  • If name is “John”: "Hello John, how can I help you today?"

Checking for Unset Variables

In Conversation Flow (Equations)

To check if a variable is set in conversation flow conditions:
Equation: {{name}} exists
Result: True if variable is set

In Prompts

To handle unset variables in your prompts, you can add conditional logic:
If {{name}} appears with curly braces, use a generic greeting.
Otherwise, greet the customer by name.

Best Practices for Missing Variables

  1. Use defensive prompting: Design prompts that work with or without variables
  2. Test thoroughly: Always test with both set and unset variables
  3. Document requirements: Clearly indicate which variables are required vs optional