Node reference
Update State
Change an existing saved State value
Update State replaces an existing saved value after work completes, so later steps and later runs can read it.
Try it step by step
- Initialize a key named batch with an empty List.
- Inside Sequential Iterate, set Update State Key to batch and Value to {{append(state.batch, iterate.output.item)}}.
- Read {{state.batch}} after Iterate done to use the completed list.
What to expect
The output contains key and its newly saved value. Updating a missing key fails; initialize it first.
Things to check
- State references read the latest saved values when the node starts. Read-modify-write is not atomic across concurrent paths; keep one shared batch on a sequential chain.
- Place checkpoint updates after the work they record succeeds.
- Choose Text for an expression, including one returning typed instructions. State does not preserve temporary file contents.
Keep learning
Parameters
| Setting | Default | What it does |
|---|---|---|
| Key | (empty) | A name private to this workflow. Expressions can choose it dynamically. |
| Value | (empty) | Choose a type for a literal value, or use Text for an expression. An exact expression keeps the referenced value and its type. |
| 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 | Replace the value of an existing State key. |
Outputs
| Port | Value | Description |
|---|---|---|
out | object | The key and its current saved value. |
out fields
| Field | Type | Description |
|---|---|---|
key | string | Workflow-scoped State key. |
value | unknown | JSON-compatible State value. |