Node reference
Variable
Store a reusable value
Variable gives a value a name so later nodes on the path can reuse it. Use it for a setting, a message, or a useful part of an earlier result.
Try it step by step
- Keep the Aa type (Text), then add name with the value Builder in one Variable node.
- Connect a second Variable and add greeting with the value Hello, {{name}}!.
- Run and inspect the second output. Change Builder to another name and compare the next run.
Unable to play this video. Open the video file.
What to expect
The second node emits {"greeting":"Hello, Builder!"}. Its output contains the variables it creates, while earlier values remain available through expressions on that path.
Things to check
- Use the icon beside the name to choose Text, Number, Boolean, Object, List or Empty (null). Objects and lists use JSON. Use Text to enter expressions, including references to instruction, transaction or file values.
- Use an exact expression to preserve its value and type, including null, false, zero, empty strings, objects, and arrays. Embedding an expression in a sentence produces text.
- Use separate nodes when one new variable depends on another new variable. Parameters are resolved before a node executes.
- Use State when a value must survive into the next run.
Keep learning
Parameters
| Setting | Default | What it does |
|---|---|---|
| Variables | [] | Names and values to make available to later nodes on this execution path. |
| Node name | (empty) | Custom display name. References and connections keep their existing identifiers. |
Node name: Double-brace expressions are not resolved in this field.
Inputs
| Port | Value | Description |
|---|---|---|
in | any | Incoming value available to parameter expressions. |
Outputs
| Port | Value | Description |
|---|---|---|
out | object | An object containing the variables assigned by this node. |