Node reference
Set State
Save memory for future runs on this runtime
Set State saves one named value for future runs. Use it after successful work to remember what was processed.
Try it step by step#
- Set Key to lastProcessedId and Value to order-42.
- Connect Get State after it with Key set to lastProcessedId.
- Run and inspect the read result. Change the saved value to order-43 and run again.
What to expect#
Set State returns the saved key and value. Writing the same key replaces its previous value; it does not append to a history.
Things to check#
- An exact expression can save an object or array. Plain JSON-looking text stays text unless you create an actual object first.
- Place the write after the operation it records. Saving a checkpoint before that operation succeeds can make the next run skip unfinished work.
- 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) | A JSON-compatible value. An exact expression can store objects, arrays, or numbers. |
Inputs#
| Port | Value | Description |
|---|---|---|
in | any | Trigger that stores the configured value. |
Outputs#
| Port | Value | Description |
|---|---|---|
out | object | The key and value saved for this workflow. |
out fields#
| Field | Type | Description |
|---|---|---|
key | string | Workflow-scoped State key. |
value | unknown | JSON-compatible State value. |