DocumentationConcepts
On this page

Flow State

Store explicitly written business values across Runs without changing the workflow definition.

Flow State stores business values explicitly written by Code. Values belong to a Flow and its execution source, draft or live. Draft testing therefore has a separate state scope from production execution.

Read and write values

export default async function (inputs, context) {
  const previous = await context.state.get("lastProcessedId");
  await context.state.set("lastProcessedId", inputs.id);
  return { previous };
}

get returns an independent JSON value or null. set(key, null) deletes the value. insert writes only when a key is absent, delete removes a key, and list returns sorted keys.

Keys contain 1–256 UTF-8 bytes. Values must be JSON. The deployment owns quotas; read its reported limits instead of assuming unlimited storage.

Write timing

Writes persist immediately as side effects. A later Task failure or canceled Run does not roll them back. Publishing, rolling back, or editing a Revision does not copy or reset State.

State is separate from arbitrary node results, Variables, and Run logs. Use it for explicit business state, not as a secret store or an implicit channel to every past invocation.

Inspect and clear

Use the deployment’s Flow State management interface and select draft or live explicitly. Clearing Live immediately affects later production executions. Inspect the scope and business consequences before clearing it.

See Code for runtime capabilities and technical contracts for exact limits and management methods.

Sources

Search