Variable

Store, retrieve, update, and delete workflow variables.

Set Variable

AI-generated

Summary

Store a variable value in the specified scope (local, workflow global, node local, cross-workflow, or Data Tables) with optional type parsing.

Inputs

  • scope (required) — Where to store the variable: Local (this execution), Workflow Global, Node Local, Custom Namespace, Cross-Workflow (Shared), or Cross-Workflow (Data Tables).
  • key (required) — The variable key. Supports expressions.
  • value — The value to store. Supports expressions.
  • valueType — How to interpret the value: Auto (preserve expression type), String, Number, Boolean, JSON, Array, or Object.
  • overwriteExisting — Whether to overwrite the variable if it already exists (default: true).
  • outputMode — How to construct the output item: Preserve Input + Add Result, Result Only, or Add / Update Field.
  • includeMetadata — Whether to store and expose createdAt/updatedAt/type metadata (supported for Workflow Global, Node Local, Custom Namespace, and Cross-Workflow scopes).

Output shape

A single record containing the result object (key, value, scope, operation) added to the output item.

For Local scope, the variable is persisted on the item JSON. For Cross-Workflow scopes, the value is serialized to JSON in a local file or Data Table. Metadata is only available when 'Include Metadata' is enabled and the scope is not Data Tables.

Examples

Example 1: Store a numeric counter in workflow global storage

Scope: Workflow Global, Key: counter, Value: 1, Value Type: Number

Example 2: Append a value to an array variable in the current execution

Scope: Local (This Execution), Key: history, Value: 2023-10-01, Value Type: Array

Example 3: Persist a user ID in a cross-workflow shared variable

Scope: Cross-Workflow (Shared), Key: user_id, Value: 12345

Links

Discussion