Flow Stores
The flow engine makes various data stores available to flows during their execution.
- Unless otherwise specified, stores are usually key-value structures, like JSON objects
- Stores can be read with variable expressions and JavaScript
- Stores, if writable, can be updated with JavaScript.
- Store values can be anything that serializes to JSON
- Stores are transient, which means they live for the duration of a flow’s execution
Store Quick Reference
Store | JS | Expression | Write | Availability | Conditions |
---|---|---|---|---|---|
Metadata | $meta | ${meta:key} | ❌ | All flows | 🟢 |
Variables | $vars | ${vars:key} | ❌ | All flows | 🟢 |
Data | $data | ${data:key} | 🟢 | All flows | 🟢 |
Web | $web | ${web:key} | 🟢 | Web flows | 🟢 |
Brand | $brand | ${brand:key} | 🟢 | Web flows | ❌ |
Input metadata | $inmeta | ${inmeta:key} | ❌ | All flows Task flow conditions | ❌ |
* Input | $in | ${in:key} | ❌ | All flows Task flow conditions | ❌ |
* Output | $out | n/a | 🟢 | JS-capable nodes | ❌ |
* Last | $last | n/a | ❌ | Conditions only (Task & Web flows) | 🟢 |
* These three stores may either be JSON objects, or arrays of JSON objects
Metadata store
The metadata store makes details about runtime context available to use within flows. When the flow engine executes a flow, it populates this store during the initialization phase, so its content is always available.
JavaScript access: $meta
Expression access: ${meta:some-key}
Writable: ❌ No
Flows: All flows
The metadata store contains:
When a flow is run by a once-off schedule trigger, the metadata store contains additional details about the scheduling flow:
When a flow is run by an event trigger, the metadata store contains additional details about the triggering event:
See the events reference for what these fields mean.
Variables store
The variables store contains flow variables, which in turn may contain matching server variables. This store is populated by the flow engine before a flow begins execution.
JavaScript access: $vars
Expression access: ${vars:some-key}
Writable: ❌ No
Flows: All flows
Data store
The data store is a general purpose, writable store to persist arbitrary data during flow execution. It is empty by default.
JavaScript access: $data
Expression access: ${data:some-key}
Writable: 🟢 Yes
Flows: All flows
The data store can be manipulated in JS Code nodes. For example:
Web store
The Web data store contains input from form elements in web flow UI - specifically from block inputs in steps.
JavaScript access: $web
Expression access: ${web:some-key}
Writable: 🟢 Yes
Flows: Web flows only
It is a writable store, so step handlers may populate it with default values at the start of a flow, or update it based on some logic.
Note that the content of this store is shared with web flow clients in browsers.
Brand store
The Brand data store is a special-purpose store used for basic branding of the web flow client UI. It is populated by “Brand” node type in web flows.
JavaScript access: $brand
Expression access: ${brand:some-key}
Writable: 🟢 Yes
Flows: Web flows only
This functionality will be replaced by flow settings during an upcoming release.
Input store
The input store is available in JS Code and JS Condition nodes, and contains the input data that the engine pushed into the node’s input channel.
JavaScript access: $in
Expression access: ${in:some-key}
Writable: ❌ No
Flows: All flows, but only in JS Code and JS Condition nodes
Input metadata store
In addition to the input store, Javascript-capable nodes have access to the input metadata store, which describes details about the content of the node’s input data. This metadata is the useful subset of details that the flow engine generates about data it processes within a flow’s execution.
JavaScript access: $inmeta
Expression access: ${inmeta:some-key}
Writable: ❌ No
Flows: All flows
The input metadata store contains:
Output store
The output store is available in JS Code and JS Condition nodes. By default, it is a copy of the node’s input store, but can be manipulated or changed, as long as it contains an object ({}
), which can be empty.
JavaScript access: $out
Expression access: n/a
Writable: 🟢 Yes
Flows: All flows, but only in JS Code and JS Condition nodes