Skip to content
VisualAutomateDocs

Data

Key-value state

A store that survives the run, so a cursor, a dedupe set or a counter is still there next time.

Most automations need to remember something between runs: the last row they processed, the messages they have already answered, how many times something happened today. Every workflow has a key-value store for exactly that, already there, nothing to set up.

Scopes

ScopeShared by
Workflowevery run of one workflow, and everybody who works on it
Accountevery workflow on the account, for what belongs to more than one

The steps

StepWhat it does
GetRead the value under a key. A key that is not there is an answer, not an error: you get found: false and a fallback you choose.
SetStore a value under a key, optionally forgotten after a time you choose.
DeleteRemove a key.
ListThe keys that are stored, optionally under a prefix and with their values, ready to loop over.
IncrementAdd to a number, for counters.
Seen before?Whether a value has been seen before, and remember it if not. The one-step answer to "never handle the same thing twice".

From code

A step that runs code, the Code step or your own, reaches the same store through context.state:

const seen = (await context.state.get("seen")) ?? []
if (!seen.includes(input.id)) {
  await context.state.set("seen", [...seen, input.id])
}

Reading and fixing it by hand

State is written from inside runs, where nothing can be inspected while it happens. So the store has a panel: open Data in the dashboard, or the store panel on the canvas, to read what a run left behind, change it by hand, and run again.

Patterns

Was this page helpful?