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:
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:
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

Timezone-Specific Variables

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

US Timezones

European Timezones

Asian Timezones

Australian Timezones

Other Global Timezones

All timezone variables follow the same format patterns as the basic variables (now, date, time, month, day, year) but adjusted for the specific timezone.

Session / call metadata

Calendar variables

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:

In Prompts

To handle unset variables in your prompts, you can add conditional logic:

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