On this page
Variable
Workflow reference | Variable expressions
Kind: Variable
Configuration object: variable
Use Variable to store a typed value for later steps or read an established value. Variables belong to one workflow run and can be used across nested containers subject to dependency validation.
Inputs
A setter can receive data connections. It chooses its stored value in this order:
- Evaluate
valueExpressionwhen configured. - Otherwise, store the incoming combined value when there are incoming connections.
- Otherwise, parse
valueJson.
A getter has no incoming data connections. It reads its named variable after the writer has completed. Expressions can also read the variable directly through variable.
Configuration
| Property | Default | Usage |
|---|---|---|
name |
"value" |
Static, case-sensitive binding name. |
mode |
Auto |
Auto, Get, or Set. |
valueJson |
"null" |
Valid JSON text used by an unconnected setter without a value expression. Must remain valid even when another source is selected. |
valueExpression |
Unset | Optional expression whose typed result is stored by a setter. |
Auto selects Set when the node has incoming edges, otherwise Get when it has outgoing edges. An unconnected Auto node is a savable draft and requires an explicit mode before execution.
Every variable has exactly one writer node in the complete hierarchy. Setters cannot have outgoing data connections; getters cannot have incoming data connections. Wire consumers from a getter or use a variable expression.
The runtime infers writer-to-reader scheduling dependencies. Data wiring and those dependencies must stay acyclic. A skipped writer causes dependent readers to be skipped. A writer in a loop can update the same run-scoped variable on successive iterations, while a reader outside that container waits for the container to finish.
Outputs
A setter stores a deep copy and produces no data output; its completed-output text is empty. A getter returns a copy of the current typed value. An unset variable is an error, while a variable deliberately set to JSON null is a valid value.
For setters receiving several inputs, select a named input with valueExpression to retain its structure. Without that expression, the stored value is the combined join text.
Example
Add the following two fragments to the same workflow. The inferred variable dependency orders them without a connection from the setter:
{
"id": "set-threshold",
"name": "Set approval threshold",
"kind": "Variable",
"variable": {
"name": "threshold",
"mode": "Set",
"valueJson": "1000"
}
}
{
"id": "get-threshold",
"name": "Read approval threshold",
"kind": "Variable",
"outputName": "threshold",
"variable": {
"name": "threshold",
"mode": "Get",
"valueJson": "null"
}
}
Connect the getter to a consumer or configure a Condition argument as {"function":"variable","value":"threshold"}. Variables reset for a new run and are separate from browser library settings or durable storage.