blokboard/ Open beta

Node reference

Initialize State

Create missing State and keep saved values across runs

CoreData

Initialize State creates a saved value only when its key is missing. Later runs keep the existing value on this workflow and runtime.

Try it step by step

  1. Set Key to lastBalance and choose Empty as its initial type.
  2. Fetch a balance and use Update State after recording the report row.
  3. Run again. Initialization keeps the saved balance, ready to compare with the new observation.

What to expect

The output contains key and the current saved value. Existing values are never reset by initialization, including null, false, zero, empty text and empty lists.

Things to check

  • Read {{state.lastBalance}} wherever a node needs the latest saved balance. Earlier node outputs are snapshots.
  • Use the icon beside the key to choose a literal type, or Text for an expression. An exact expression preserves its value type.
  • Update State changes an existing value. Delete State removes it so initialization can create it again.
  • Initialization is atomic. It does not lock subsequent work against other branches or overlapping runs.

Keep learning

Parameters

SettingDefaultWhat it does
Key(empty)A name private to this workflow. Expressions can choose it dynamically.
Initial 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

PortValueDescription
inanyCreate the key if it is missing; otherwise keep its saved value.

Outputs

PortValueDescription
outobjectThe key and its current saved value.

out fields

FieldTypeDescription
keystringWorkflow-scoped State key.
valueunknownJSON-compatible State value.