For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Login
HomeDocsAPI ReferenceMCP ServerChat SDKsRelease Notes
HomeDocsAPI ReferenceMCP ServerChat SDKsRelease Notes
  • Welcome
    • Getting started
    • Key concepts
    • Dashboard navigation
    • Agent logic
    • Improvement tactics
  • Knowledge
    • Content ingestion
    • Article management
  • Automation
    • Actions
    • Processes
    • Playbooks
    • Proactives
    • Greetings
    • Custom Instructions
    • Variables
      • Using Variables
      • Best practices
  • Setup
    • Persona
    • Languages
    • Redactions
  • Handoffs
    • Handoff management
    • Salesforce
    • Zendesk
  • Channels
    • Chat
    • Voice
    • Email
    • Social
    • Third party
  • Optimization
    • Testing
    • Conversations
    • Coaching
Login
LogoLogo
On this page
  • Overview
  • Use clear and specific variable names
  • Use Autocapture variables for conversational data
  • Use Global variables for values needed across multiple steps
  • Use Sensitive variables for confidential information
  • Use metavariables for environment and channel context
  • Minimize the size of stored data
  • Avoid re-asking for information unnecessarily
  • Use metadata for logged-in end user information
  • Test variable behavior with different end user identities
  • Keep your variable set organized
  • Common mistakes
  • Examples
AutomationVariables

Best practices

Previous

Persona

Overview
Next
Built with

Overview

Variables are essential for creating dynamic, personalized, and context-aware experiences. They allow your AI Agent to collect information from end users, track conversation state, and pass data into elements like Actions and Playbooks. This topic outlines best practices for designing, storing, and reusing Variables effectively, along with common pitfalls and examples of good variable usage.

Use clear and specific variable names

Choose names that describe what the variable stores, rather than generic labels. Clear naming helps both the AI Agent and future builders understand the variable’s purpose.

Good examples

  • user_email
  • shipping_address
  • account_tier

Avoid

  • value
  • input1
  • temp
Descriptive variable names improve Autocapture accuracy and makes them easier to maintain.

Use Autocapture variables for conversational data

Autocapture Variables perform best when the information is something the end user will naturally state during the conversation (such as email, phone number, or order number).

Use Autocapture when:

  • The target value will appear in the transcript
  • The context is natural (e.g., the end user says “My order number is 12345”)
  • You want the AI Agent to prompt only when needed

Avoid Autocapture when:

  • The end user might phrase the answer ambiguously
  • The information needs precise formatting
Autocapture works best in English and may not perform consistently in other languages.

Use Global variables for values needed across multiple steps

Global Variables persist and can be reused across Actions, Playbooks, Processes, and other elements.

They are ideal for:

  • Persistent end user details (e.g., order number)
  • Context used across multiple steps

Avoid storing:

  • Large API responses
  • Data that changes frequently
  • Sensitive details that do not need to persist
Variable reuse depends on identity continuity. To learn how the system determines whether an end user is returning, see Conversation identifiers and persistence.

Use Sensitive variables for confidential information

Sensitive variables should be used for personally identifiable or sensitive data.

Sensitive variables:

  • Are redacted in the dashboard
  • Are deleted automatically after 24 hours
  • Should be used for anything you do not want stored long-term

Use metavariables for environment and channel context

Metavariables give your AI Agent information about the end user’s device, browser, channel, and system state.

Common use cases:

  • Personalizing content based on language or timezone
  • Handling browser-specific behavior

Metavariables cannot be created manually. They are populated automatically or passed via setMetaFields() in your embed script.

Minimize the size of stored data

Variables can store up to 100,000 characters, but smaller values are better for performance and maintainability.

Best practices:

  • Store only the specific fields you need
  • Avoid storing large JSON responses
  • Parse and extract needed values before saving
Storing large payloads may cause the variable to exceed the size limit or impact the performance of your AI Agent.

Avoid re-asking for information unnecessarily

Before using a Capture block, check whether the value already exists.

Use Set Variable or Conditional block to:

  • Skip asking for information that has already been collected
  • Reuse verified data
  • Reduce friction and create smoother conversations

Use metadata for logged-in end user information

Avoid asking end users to repeat information that your system already knows. Use setMetaFields() to pass things like:

  • email address
  • account tier
  • subscription level

This ensures consistency and reduces effort for authenticated end users.

Test variable behavior with different end user identities

Variable persistence depends on how Ada recognizes end users. Test with:

  • Returning Web Chat end users
  • New private-mode sessions
  • Different devices and browsers
  • Email threads inside and outside the continuation window
  • Social channel interactions
Identity testing helps ensure variables behave correctly across channels and repeat visits. For more information, see Conversation identifiers and persistence.

Keep your variable set organized

Variable sets can grow over time! Keep them clean by:

  • Reviewing unused variables periodically
  • Maintaining clear descriptions
  • Grouping variables by use case
  • Standardizing naming conventions

Common mistakes

Here are some common errors that can impact performance or end user experience.

Storing too much data

Variables that store entire API responses or large JSON objects may exceed the character limit or become difficult to work with.

Relying too heavily on Autocapture

Autocapture may misinterpret ambiguous inputs or fail in non-English languages.

Using Global variables for sensitive data

Sensitive details should be stored only in Sensitive variables.

Assuming variables always persist

Variable reuse depends on identity, channel rules, and persistence settings. A new end user session may clear Global variable values.

Examples

Store only the fields you need

Correct

1{ "order_status": "shipped" }

Avoid

1{
2 "order_id": "12345",
3 "items": [...],
4 "shipping": {...},
5 "customer": {...},
6 "metadata": {...}
7}

Store only the fields you actually intend to use.

Use setMetaFields for logged-in end users

Correct

1setMetaFields({ email: user.email, account_id: user.id });

Avoid Asking the end user: “What is your email address?” for authenticated sessions.

Check before asking

Correct If user_email exists, no need to capture it in a variable.

Avoid Asking the end user for their email every time the process runs.


Have any questions? Contact your Ada team, or email us at help@ada.cx.