Skip to content

Set Variable

Writes a value into the workflow execution context under a named key. Downstream nodes can then reference {{<this_node_id>.data.value}} to read it.

When to use

  • You need to compute a value once and reuse it in multiple downstream nodes.
  • You want to give an opaque chain of references a friendlier name to reference later (e.g. compute a customer ID in node A and read it everywhere else as {{customer_id.data.value}}).
  • You're stitching together values from multiple upstream nodes into a single place.

Configuration

FieldRequiredWhat it does
keyYesLogical name of the variable. Used for readability only — downstream refs use the node ID, not the key.
valueAny static or referenced value. Supports full {{...}} syntax including arithmetic on referenced numbers.

What it outputs

{
  key: "customer_id",
  value: <whatever you set>
}

Downstream references use the node ID: {{<node_id>.data.value}}.

When NOT to use it

If you only need the value in one downstream node, just reference the source directly with {{upstream_node.data.path}}. Set Variable is for sharing a value across multiple downstream consumers.

For transforming a value into a new shape, use Transform — it's purpose-built for field mapping, whereas Set Variable just stores whatever value you give it.