Use typed workspace variables
Bind exact variable contracts and use atomic operations or revision guards for shared durable values.
Variables are durable named JSON values scoped to one workspace. They persist across runs and restarts and can be shared by workflows in that workspace. There is no global variable scope. Use Secrets/Connections for credentials instead of variables.
Create and bind#
Open Variables, choose the workspace and Add variable with name, declared type and initial value. Names are case-sensitive and unique within the workspace. Custom types require an exact published type version. Values validate without coercion; appropriate false, zero, empty string and null values are retained.
The list reads metadata only. Open a variable deliberately to inspect or edit its value. Scope/type are immutable; recreate deliberately to change them. Concurrent saves/deletes use the current revision and reject stale writes.
Read variable and Write variable nodes can use exact name lookup or Bind typed sockets. A binding captures the variable ID, workspace and declared type/version. Rename preserves that identity. Deleting and recreating the same name does not retarget an old binding; a cross-workspace copy needs deliberate rebinding.
New Read/Write instances use v2. Existing v1 pins retain their behavior until explicitly upgraded. Binding changes preserve wires/literals for validation rather than silently converting them. Receiving sockets still validate actual values.
Guard read/modify/write#
Read returns Value and Revision. Write accepts Value and optional Expected revision and returns the committed value/new revision. Connect the earlier revision when a later update must reject intervening edits.
const before = await context.variables.get({name:'Threshold'});
const after = await context.variables.set({
name:'Threshold', value:25, expectedRevision:before.revision
});
return {value:after.value, revision:after.revision};The executing workflow fixes workspace scope. These helpers are available to TypeScript/JavaScript workers; native bodies use dedicated graph nodes around their code instead.
Prefer atomic operations#
Increment adds a finite amount to a number. Append adds an Items array to an array. Compare and set checks current JSON equality then replaces the value. Update path changes an existing-container path using string keys/numeric indexes.
Each atomic operation reads, optionally checks revision, validates the entire result, allocates a revision and journals the transition in one transaction. Invalid comparisons or schemas leave value/revision unchanged. Update path does not merge objects or construct missing intermediate containers; array indexes must already exist.
Persistence and recovery#
Accepted writes commit immediately. A later node error, cancellation or retry does not undo them. Read the current value/revision after an uncertain outcome; automatically replaying an increment or append can duplicate it.
Values are finite JSON, limited to 1,000,000 UTF-8 bytes and 32 nested levels, with additional structure/count bounds. The installation supports at most 10,000 variables. Values are encrypted, while names/types/scope remain indexing metadata.
Ordinary workflow exports omit variable values. Preserve the database/key pair for recovery. Runtime transitions appear in run storage history. Use storage for keyed records, correlation and durable queue lifecycles rather than forcing every business object into a variable.
Source provenance
Reviewed against maintained source and topic documentation on 23 October 2026. This is a source snapshot; installed versions and provider access may differ.
docs/VARIABLES.mddocs/RUN-STORAGE-HISTORY.mddocs/TYPES-AND-VERSIONING.md