> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vatel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> How variables work across your agent's flows

Variables let you store and pass data throughout a call. A variable is a named container that holds a value (like a customer's name, an order number, or a lookup result) and persists for the entire duration of the call. Variables can be set by various steps during the conversation or inside logic flows. Once a variable has been set, any subsequent step can read it, regardless of whether that step is in the conversation flow or a logic flow.

## Variable scope

All variables in Vatel are **call-scoped**, meaning they live for the duration of a single call and are shared across every part of the agent. When a variable is set at any point during a call (whether by an Extract Info step in the conversation, a Set Variables step in a logic flow, or a Webhook response), it is immediately available to every step that runs after it for the rest of that call.

If you write to the same variable name again, the new value overwrites the previous one. There is no separate "flow scope," and variables do not reset when a logic flow finishes. This means a logic flow can set a variable, and the main conversation flow can read that variable after the logic flow completes. It also means you should be careful about reusing variable names across different flows, since a later write will silently replace the earlier value.

## How to set variables

You can set variables through several mechanisms. Each one is suited to a different situation.

| Mechanism | How it works | When to use it |
| - | - | - |
| **Extract Info** | A conversation-flow node that listens for a specific piece of information in the caller's speech (such as a name, date, or account number) and stores it under the variable name you provide. If the caller repeats the information, the variable is overwritten with the latest value. | Use this when you need to capture a single, well-defined piece of information from what the caller says. |
| **Extract** | A node that uses the LLM to analyze the conversation transcript and pull out one or more structured fields (each with a name and data type). The extracted values are stored as named variables. | Use this when you need to pull multiple structured fields from the conversation at once, or when the information is spread across several turns of dialogue. |
| **Set Variables** | A node that lets you explicitly declare one or more key/value pairs. You type the variable name and its value directly. Values can be static text, numbers, or dynamic references to other variables. | Use this when you need to set a constant (like a default status), combine existing variables into a new value, or initialize variables at the start of a flow. |
| **Webhook / Integration** | When a Webhook or Integration node runs, its response is stored on that step's output. You can read individual fields from the response using the syntax `{{node.<id>.<field>}}`, where `<id>` is the node's ID shown in the editor and `<field>` is a key in the response body. | Use this to bring in external data, such as a customer record from your CRM or a balance from a billing API. |
| **Transform** | Takes one or more existing variables, maps or reshapes them into a new structure, and stores the result as a new variable. | Use this after a Webhook or Integration when you need to rename fields, flatten nested objects, or combine data from multiple sources into a single variable your conversation flow expects. |

## Referencing variables

To use a variable's value in a text field, prompt, or message, wrap the variable name in double curly braces. Any field in the editor that accepts dynamic values will resolve these references at runtime.

```
Hello {{caller_name}}, your order {{order_id}} is confirmed.
```

### Referencing node outputs

Every node in the editor also exposes its output as a variable you can reference. The syntax is `{{node.<id>.<field>}}`, where `<id>` is the node's identifier (shown on the node in the editor canvas) and `<field>` is the name of a key in that node's output. For nested fields, chain additional dots. For example, if a Webhook node with ID `lookup1` returns a JSON body containing `{ "customer": { "name": "Alice" } }`, you would write `{{node.lookup1.responseBody.customer.name}}` to access the customer's name.

### System variables

The platform provides built-in system variables (like `{{caller}}` for the caller's phone number) that use the same double-curly-brace syntax. See [System Variables](https://docs.vatel.ai/configure/system-vars) for the full list of what is available.

## InputVariable

Many fields throughout the editor accept an **InputVariable** rather than a plain string. An InputVariable is a structured way to define a single value that a node needs. When you configure an InputVariable, you decide whether the value is a fixed constant or whether it should be looked up from the call's variable scope at runtime. This flexibility lets you build flows that mix hardcoded settings with dynamic, call-specific data.

Each InputVariable has the following fields:

| Field | Type | Required | What it does |
| - | - | - | - |
| `name` | string | Yes | The parameter name. This is the label other nodes and steps see when they reference this value. For example, if you set `name` to `customer_id`, downstream steps can read it as `{{customer_id}}`. |
| `type` | `static` or `dynamic` | Yes | Controls whether the value is hardcoded or resolved at runtime. See the section below for details. |
| `dataType` | `string`, `number`, `boolean`, `object`, or `array` | Yes | Tells the platform what kind of data to expect. Choose `string` for text, `number` for numeric values, `boolean` for true/false flags, `object` for JSON objects, and `array` for lists. This matters for type checking and for guiding the LLM when the Extract step uses this variable. |
| `description` | string | Yes | A human-readable explanation of what this value represents (for example, "The caller's email address" or "Whether the customer has an active subscription"). The Extract step also uses this description to help the LLM understand what to look for in the conversation. |
| `required` | boolean | No | If set to `true`, the platform will treat this parameter as mandatory. If the value is missing at runtime, the step may fail or skip. Defaults to `false`. |
| `value` | any | No | The actual value, used only when `type` is `static`. Leave this empty for dynamic variables. |

### Static vs dynamic

When you set `type` to **static**, the value is a fixed literal that you define at configuration time. It never changes between calls. Use static values for constants, such as a sender email address, a fixed API endpoint, a default greeting, or a numeric threshold.

```json theme={null}
{
  "name": "sender",
  "type": "static",
  "dataType": "string",
  "description": "Sender email address",
  "value": "noreply@example.com"
}
```

When you set `type` to **dynamic**, the value is resolved from the call's variable scope at runtime. The platform looks for a variable whose name matches the `name` field and uses its current value. Use dynamic values when the data comes from something that happened during the call, such as a caller's name captured by an Extract Info step or a customer ID returned by a Webhook.

```json theme={null}
{
  "name": "customer_id",
  "type": "dynamic",
  "dataType": "string",
  "description": "Customer ID looked up earlier in the call"
}
```

For dynamic variables, leave the `value` field empty. The platform resolves the variable by matching its `name` against the call scope when the step executes. If no variable with that name has been set yet, the value will be empty (or the step may fail if `required` is `true`).

## Variable naming

Variable names should be lowercase with underscores (e.g. `caller_name`, `order_id`, `customer_tier`). Avoid spaces and special characters. Names are case-sensitive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.