For the complete documentation index, see llms.txt. This page is also available as Markdown.

Variables

Store and reuse data across your agent's workflows

Variables let you define reusable values that any node in your workflow can access. Use them to configure agent behavior, track conversation state, and personalize responses based on user input or system data. You can reference them in any text box using the {{variableName}} syntax.

What Is a Variable

A variable is a named key-value pair that stores data your agent can read and write during a conversation. Variables act as the shared memory between nodes — one node sets a value, and any downstream node can consume it to make decisions, personalize messages, or call external APIs.

Every conversation gets its own copy of variable values. Two users chatting with the same agent at the same time each have independent variable states, so one conversation never leaks data into another.

Variables can be overwritten at runtime unless marked as constant. You reference them anywhere in your workflows using the {{variableName}} syntax.

You can create and update variables in three ways, each suited to a different scenario:

Controlling Workflow Logic with Variables

Variables become especially useful when paired with a Flow Control node. The typical pattern is:

  1. An LLM or Variable node sets a value based on something that happened earlier in the conversation, for example, storing the user's selected department as {{department}}

  2. A Flow Control node reads that variable and branches the workflow into different paths depending on its value

  3. Each branch leads to a different sequence of nodes (e.g., one path for billing, another for technical support)

This lets you build workflows that adapt to each conversation. Instead of creating separate workflows for every scenario, you use variables to route users dynamically within a single workflow.

Variable Types

The platform supports five types of variables.

Type
Scope
Managed In
Persists After Session

Question

Single conversation

Question node

No

Session

Single conversation

Variable node / Built-in

No

Contact

Across sessions per contact

Variable node / Built-in

Yes

Static

Agent-wide defaults

Designer > AI Workflows > Variables

N/A — initializes per session

System

Platform-provided

Built-in

N/A — read-only

Question Variables

Automatically created when you add a Question node to a workflow. The user's answer is stored in a variable named after the question, making it available to any subsequent node in the same session.

Use for: capturing user input like names, email addresses, or selections without manually configuring a Variable node.

Session Variables

Scoped to a single conversation. The value initializes when the session starts and is discarded when the session ends.

Use for: temporary state like session_topic, conversation counters, or routing flags.

Contact Variables

Persists across sessions. The value is stored on the contact record and carries over to future conversations with the last assigned value. The platform includes several built-in contact variables; you can find the full breakdown in the reference section below.

Use for: user preferences, language selection, or any data that should survive between sessions.

Static Variables

Agent-level configuration values managed in Designer > AI Workflows > Variables. These act as defaults that initialize at the start of every conversation. Each conversation gets its own copy.

Use for: agent role definitions (agentRole), personality settings (agentPersonality), API tokens, or any value that should be consistent across all conversations.

Mark a static variable as constant to prevent workflows from overwriting it at runtime.

System Variables

Built-in, read-only values provided by the platform. Available in every workflow without creating them. See the full list in the System Variables Reference section below.

Referencing Variables

How you reference a variable depends on the node type. Look out for any place with the {x} symbol. Click it to open a selection drop-down that includes all available variables.

Type {{VariableName}} in the text editor or use the autocomplete option after typing {{ . Alternatively, click on the variable {x} button in the text editor toolbar to search all variables.

Select the variable from the drop-down. No manual syntax needed

The Variables Table

Navigate to Designer > AI Workflows > Variables to manage static variables for your agent. This is where you define the default values that initialize at the start of every conversation. The table comes pre-populated with a set of default variables that every new agent inherits automatically.

Creating a Static Variable

1

Add a Variable

Go to Designer > AI Workflows > Variables and click Add Variable.

2

Configure the Variable

Give a descriptive name for the variable and an initial value. The description explains what the variable is for and is visible to all team members. Change the variable to constant if you want to lock its value at runtime.

3

Submit

Click Submit. The variable appears in the table and is immediately available in your workflows.

Manage Static Variables

Edit or delete the variables using the action buttons. Click on any variable to open the edit menu.

Variable description

Optional text used for documentation and team collaboration

Constant variable

Lock a variable's value so workflows cannot overwrite it at runtime

Multiple languages

Secondary languages inherit from the primary; edits are only allowed with the primary language selected

Using the Variable Node

The Variable node lets you set or update a variable mid-workflow. The variable is created or updated the moment the node executes — any node that comes after it in the workflow can read the new value.

Name

The key of the key-value pair. Select an existing variable from the dropdown or type a new name to create one on the fly.

Value

The value to assign. This can be a static string, a number, or a reference to another variable using {{variableName}}.

Description

Explains the variable's purpose (optional, but recommended for team visibility).

Storage Type

Choose between session (scoped to the current conversation) or contact (persists across sessions). This determines the variable type.

Setting Variables from LLM Nodes

LLM nodes can write directly to variables when you configure the response format as JSON. This turns the LLM into a decision-maker that extracts structured data from a conversation and stores it for downstream nodes to use.

To set this up:

  1. In the LLM node configuration, set the response format to JSON

  2. Define the expected JSON structure in the LLM prompt, for example, instruct it to return {"department": "billing", "urgency": "high"}

  3. Map each JSON property to a variable in the Extract Parameter section: department maps to {{department}}, urgency maps to {{urgency}}.

Once the LLM node executes, the mapped variables are available to every node that follows.

If you do not enable JSON response format, the LLM output is not automatically saved to any variable. JSON mode is required for the variable mapping to appear.

Session Variables Reference

Session-scoped variables initialize when a conversation starts and remain available until the session ends. Some come from agent-wide defaults like static variables; others are populated by platform features such as mid-conversation authentication.

Variable
Description

{{agentPersonality}}

Specifies how the agent responds in terms of tone of voice (e.g. friendly or formal) and presentation style (e.g. detailed vs brief), and other personality characteristics

{{agentRole}}

Specifies the role of the agent in broad terms, e.g. their function and the company that employs them

{{Auth.authenticatedAt}}

Authentication timestamp in milliseconds

{{Auth.email}}

Authenticated user's email

{{Auth.email_verified}}

Whether the user's email is verified

{{Auth.family_name}}

Authenticated user's last name

{{Auth.full_name}}

Authenticated user's full name

{{Auth.given_name}}

Authenticated user's first name

{{Auth.name}}

Authenticated user's display name

{{Auth.phone}}

Authenticated user's phone number

{{Auth.phone_verified}}

Whether the user's phone is verified

{{Auth.provider}}

Authentication provider name

{{Auth.sub}}

Authenticated user's subject identifier

{{Auth.<claim>}}

Any additional claim listed in Additional Claims on the agent's Security page

System Variables Reference

The platform provides built-in system variables you can use in any workflow without creating them.

Variable
Description

{{sessionId}}

The session identifier

{{userId}}

The user identifier

{{workspaceId}}

The workspace identifier

{{BotId}}

The bot's identifier

{{deploymentId}}

The deployment identifier

{{deploymentChannel}}

The deployment channel

{{isVoiceSession}}

Whether the current session is in voice input mode (resets to false after 3 consecutive typed messages)

{{messageId}}

The message identifier

{{userTextMessage}}

The user's latest text message

{{sessionHistory}}

The session transcript

{{detectedLanguage}}

The user's most recently detected language. Requires the Language Detection plugin.

{{Today}}

Today's date

{{TodayDayOfTheWeek}}

Today's day of the week

{{Now}}

Current time

{{NowInMilliseconds}}

Unix timestamp in milliseconds since epoch

{{CurrentDate}}

Current date in YYYY-MM-DD format (bot's time zone)

{{CurrentDateLongForm}}

Current date in long format, e.g. Tuesday, August 06, 2024 (bot's time zone)

{{CurrentDatetimeISO8601}}

Date and time in ISO 8601 format (bot's time zone)

{{CurrentDatetimeISO8601_UTC}}

Date and time in ISO 8601 format (UTC)

{{CurrentYear}}

Current year in YYYY format (bot's time zone)

{{CurrentMonth}}

Current month in MM format (bot's time zone)

{{CurrentDay}}

Current day in DD format (bot's time zone)

{{CurrentHour}}

Current hour in hh format (bot's time zone)

{{CurrentMinute}}

Current minute in mm format (bot's time zone)

{{CurrentTime12h}}

Current time in 12h format (bot's time zone)

{{CurrentTime24h}}

Current time in 24h format (bot's time zone)

{{Timezone}}

The bot's time zone identifier

{{TimezoneOffset}}

The UTC offset of the bot's time zone

{{missedQuestionsCount}}

Missed questions count in the current session

{{consecutiveMissedQuestionsCount}}

Consecutive missed questions in the current session

{{WebchatFullUrl}}

The webchat full URL

{{WebchatOrigin}}

The webchat origin URL

Contact Variables Reference

Variable
Description

{{UserInfo.email}}

User's email

{{UserInfo.firstName}}

User's first name

{{UserInfo.lastName}}

User's last name

{{UserInfo.fullName}}

User's full name

{{UserInfo.language}}

User's language

{{UserInfo.salutation}}

User's salutation

Best Practices

  • Name variables descriptively: agentRole and agentPersonality are clear; var1 and temp are not

  • Mark configuration values as constant: tokens, IDs, and role definitions should not change at runtime

  • Use session variables for temporary state: anything that only matters during a single conversation belongs in a session variable

  • Use contact variables sparingly: only store data that genuinely needs to persist across sessions

  • Add descriptions to every variable: the Variables table is shared by your team, so descriptions prevent confusion

  • Keep system variables in mind: check the built-in list before creating a custom variable that duplicates existing data

Last updated