Skip to main content
Prerequisites: Review Speak Nodes and Outcomes first.
Variables let your agent capture information from the conversation for use later: within the same call (branching with Outcomes, deciding Actions) and after the call (CRM updates, notes, automations). When they extract: Immediately after the caller’s latest reply and before outcome evaluation. That means your outcomes can reference fresh variable values right away. Add variables from the right panel of a Speak node. Open the node, scroll to Variables, and click Add variable.
Variables panel in the Agent Builder

Variables panel inside a Speak node

Fields

  • Name - A short, readable identifier you will reference in rules and prompts (for example budget, email, callback_time).
  • Source - Choose Current speak node or Conversation history.
    • Current speak node extracts only from the caller’s most recent turn, ignoring earlier context. Great for precise questions such as “What is your email?” when you only want the latest answer.
    • Conversation history searches the entire conversation for the best value. Useful when the caller may have mentioned it earlier or you want a fallback.
  • Extraction instructions - This is the heart of the variable. Write exactly what to extract and how to transform it. Be explicit about constraints, examples, and edge cases.
    Variable extraction editor

    Author extraction instructions

    Template you can copy
    Goal: Extract the <thing> the caller states.
    If multiple candidates: choose the most recent, high-confidence value.
    If absent or unclear: return an empty value (no placeholder text).
    Normalization: <how to clean or format, e.g., numbers only, lowercase email, trim spaces>.
    Do not invent values.
    
  • Format - Enforces the output type so downstream logic stays predictable.
    • Number - Numeric only (budgets, credit scores). The system requires a valid number.
    • Boolean - True/false values (consent, qualification).

Authoring examples

Budget (number)

Name: budget
Source: Current speak node
Extraction instructions: Extract the maximum home budget the caller states as a plain number in USD, with no commas or text. If a range is given (for example “200 to 250k”), choose the upper bound. If not provided, leave empty.
Format: Number
Use with: Rule outcome budget >= 250000 -> High-intent path.

Email (text)

Name: email
Source: Conversation history
Extraction instructions: Extract the caller’s email. Normalize to lowercase and remove spaces. If multiple addresses are present, choose the most recent. If none, leave empty.
Format: Text
Use with: Rule outcome email matches /.+@.+\\..+/ -> Collect address details.

Call-back permission (boolean)

Name: callback_ok
Source: Current speak node
Extraction instructions: Determine whether the caller has explicitly agreed to a call-back. Return true for clear consent like “Yes, call me later,” otherwise return false.
Format: Boolean
Use with: If callback_ok == true -> trigger Actions to create a follow-up task.

Re-extraction and overrides

  • Each time the agent visits a node that defines a variable, it retries extraction and overwrites the previous value if it finds a better one.
  • You can intentionally redefine variables later to refine accuracy (for example, asking the caller to confirm their email).
  • Prefer Current speak node for confirmations to avoid pulling older mentions from the conversation history.

AI-Generated Variables

Many times, you’ll want to create a variable that is generated by an AI model. For example, you might want to create a variable that contains the caller’s email address, or keywords that were mentioned based on the call transcript.

Validation patterns (pair with Outcomes)

Use rule checks to keep data clean:
  • Required: If email is empty -> loop back to re-ask (self-loop pattern; see Outcomes).
  • Ranges: credit_score between 300 and 850; budget >= 250000.
  • Flags from Actions: for example crm_lookup_found == true.

Troubleshooting

Variable extracting incorrect data
  • Make extraction instructions more specific and concrete
  • Switch from Conversation history to Current speak node for precision
  • Add examples of correct format in extraction instructions
  • Test with Test Agent to verify extraction
Variable always empty
  • Verify caller is actually providing the information
  • Check if variable source is set correctly (current vs history)
  • Ensure extraction instructions aren’t too restrictive
  • Review test call recordings for what was said
Wrong format being extracted
  • Confirm Format field matches expected type (Text/Number/Boolean)
  • Add explicit format requirements to extraction instructions
  • Use validation rules in Outcomes to catch errors
Variables conflicting with actions
  • Remember: variables extract before actions run in each node
  • Use separate nodes if you need action results to populate variables
  • See Actions for execution order
Common Mistake: Using vague extraction instructions like “Get their contact info.” Be specific: “Extract phone number in format +1-555-555-5555 from caller’s response. If not provided, leave empty.”

Best practices

  • Order of operations: Variables extract before outcomes, so branching logic always sees the latest values.
  • Be explicit: The more concrete your instructions, the higher the accuracy. Avoid vague wording.
  • Handle empty values: Plan what happens if the variable is missing (default branch, re-ask loop).
  • Name consistently: Use lowercase snake_case (for example credit_score, callback_time) so rules stay readable.
  • PII caution: Only capture the personally identifiable information you actually need.

See also

  • Outcomes - branch using the variables you extract
  • Speak nodes - where variables live and update
  • Actions - set or update variables via lookups and APIs
  • Transfer node - escalate when validation fails repeatedly
  • Testing - validate variable extraction with Test Agent
  • Glossary: PII - handling sensitive data responsibly