Skip to content

Variables & Context

Variables are named values that persist throughout a conversation session. They allow nodes to share data -- for example, an API Call node can store a response in a variable that a Condition node later evaluates.

Variable Types

Session Variables

Session variables are set during the conversation and persist until the session ends. Any node can read or write them.

VariableSet ByExample Value
user_nameSet Variable node"Jane Smith"
account_numberAPI Call response mapping"ACC-12345"
llm_responseLLM Response node output"Your order ships tomorrow."
kb_resultsKB Search node output[{content: "...", score: 0.92}]
intentCondition or classifier"billing_inquiry"

System Variables

System variables are automatically available in every session. They are read-only and prefixed with sys_.

VariableDescriptionExample
sys_user_idUnique identifier for the end user"usr_abc123"
sys_channelThe channel the conversation is on"web", "voice", "sms"
sys_languageDetected or configured language code"en", "es", "fr"
sys_tenant_idThe tenant that owns the bot"tnt_xyz789"
sys_bot_idThe bot handling the conversation"bot_456"
sys_conversation_idUnique ID for this conversation"conv_001"
sys_timestampCurrent UTC timestamp"2026-02-07T14:30:00Z"
sys_message_countNumber of messages in the session5
sys_page_labelPage or context label from the widget"pricing-page"

Using Variables in Nodes

Template Syntax

Reference variables in any text field using double curly braces:

Hello {{user_name}}, your account {{account_number}} is active.

Nested properties are accessed with dot notation:

Your order status is {{order_details.status}}.

In Condition Nodes

Condition nodes evaluate variables directly. You select the variable name, an operator, and a comparison value:

Variable: user_tier
Operator: equals
Value: "premium"

In System Prompts

LLM Response nodes can reference variables in the system prompt to provide context:

You are assisting {{user_name}} who has a {{user_tier}} account.
Their last order was {{last_order.id}} placed on {{last_order.date}}.
Answer based on their account context.

Setting Variables

Set Variable Node

The most direct way to assign a variable. You provide:

  • Variable Name: The key (e.g., greeting)
  • Value: A literal value, template expression, or JSON expression
Name: greeting
Value: Hello {{user_name}}, welcome back!

Node Output Variables

Many nodes automatically write to a configured output variable:

Node TypeOutput VariableContains
LLM ResponseConfigurable (default: llm_response)The generated text
API CallConfigurable (default: api_response)The parsed JSON response body
KB SearchConfigurable (default: kb_results)Array of matching chunks with scores
RAG QueryConfigurable (default: rag_results)Array of matching chunks with relevance scores
Collect InputConfigurableThe user's input text
Voice InputConfigurable (default: voice_input)Transcribed speech text
SalesforceConfigurable (default: sf_result)CRM query/operation result

API Response Mapping

API Call nodes support response mapping to extract specific fields:

json
{
  "order_status": "$.data.order.status",
  "delivery_date": "$.data.order.estimated_delivery",
  "item_count": "$.data.order.items.length()"
}

TIP

Use JSONPath expressions in response mapping to extract exactly the data you need from complex API responses.

Variable Scope and Lifetime

  • Variables are scoped to the conversation session. They are not shared across conversations.
  • Variables persist across flow transitions when using the Go to Flow node.
  • When a conversation ends (timeout, explicit end, or handoff), all session variables are discarded.
  • Variables are available in the conversation transcript for reporting purposes.

WARNING

Do not store sensitive data (passwords, full credit card numbers) in session variables. They appear in debug logs and conversation transcripts. Use the platform's encryption features for PII.

Debugging Variables

In the Testing panel, the Variables Inspector shows all current session variables and their values in real time as you step through a flow. This is the fastest way to verify that variables are being set correctly.

imageVariables Inspector panel in the test sidebar showing session variable names, values, types, and which node set them
The Variables Inspector during a test session
imageSend Message node config panel showing variable interpolation with {{user_name}} and {{account_number}} in the message text
Using variable interpolation in a message node

OmniBots AI Bot Platform