Two types of variables, common mistakes, and how to reference them.

Two Types of Variables

Input Variables

Passed into the agent at the start of the call.
  • Example: name, amount_due, account_number
  • Use in greeting: “Hi [[ name ]], calling about your account ending in [[ account_number ]]“

Output Variables

Capture the outcome of the call.
  • Example: payment_confirmed, callback_scheduled, customer_hostile
  • Set at call end: disposition = callback_scheduled

Common Mistakes

  1. Referencing undefined variables — Don’t use a variable unless it’s been set or passed in.
  2. Forgetting to set output variables — Always set output variables at call end so you know what happened.
  3. Using variables in conditions without checking if set — Add a guard: “If [[ variable ]] is set and equals X…”

How to Reference Variables

Use double brackets: [[ variable_name ]] In instructions: “Greet the user with their name: ‘Hi [[ name ]], calling about your account.’” In conditions: “If [[ payment_status ]] is ‘completed’, thank them and end the call.” Safe reference with guard: “If [[ callback_time ]] is set, confirm: ‘Your callback is scheduled for [[ callback_time ]].’ If [[ callback_time ]] is not set, ask: ‘When would you like us to call back?’”

Variable Naming Convention

Use lowercase with underscores: callback_time, issue_type, payment_confirmed Avoid: CamelCase, spaces, special characters.