Node reference
Get State
Read this workflow's memory on the current runtime
Get State reads a value saved by an earlier step or run of the same workflow on the same runtime. Use it to remember a checkpoint or a previous result.
Try it step by step#
- Set Key to greeting and run Get State before anything has saved that key.
- Add Set State with the same key and the value Hello, then a second Get State.
- Run the workflow twice and compare the first read in each run.
What to expect#
A missing key returns {"key":"greeting","found":false,"value":null}. After saving, it returns found: true and value: "Hello".
Things to check#
- Check found to distinguish a missing key from a saved null value.
- State belongs to the workflow and runtime. An imported copy starts with its own State, and moving execution to another runtime does not move stored values.
Keep learning#
Parameters#
| Setting | Default | What it does |
|---|---|---|
| Key | (empty) | A name private to this workflow. Expressions can choose it dynamically. |
Inputs#
| Port | Value | Description |
|---|---|---|
in | any | Trigger that reads the configured workflow State key. |
Outputs#
| Port | Value | Description |
|---|---|---|
out | object | The stored value and whether the key exists. |
out fields#
| Field | Type | Description |
|---|---|---|
key | string | Workflow-scoped State key. |
value | unknown | JSON-compatible State value. |
found | boolean | Whether this workflow has the key. |