Skip to main content

Set Variable — variable.set

Assigns a new value to a declared variable, then continues to the next node.

  • Inputs: in (exec) — "Exec"; value (value) — "Value"
  • Outputs: out (exec) — "Next"
  • Config fields: none (same variable-bound-at-creation model as Get Variable; the Value pin's literal editor lives on the pin itself)

An unwired literal is formatted according to the variable's declared data type (a string variable gets JSON.stringify-ed, a Map/Set/WeakSet variable gets wrapped in new Map(...)/new Set(...)/new WeakSet(...), an error-typed variable gets wrapped in new Error(...) — see Error nodes — and so on) — a wired value is never reformatted, since it's already a proper expression.

// let target
counter = 1;

// const target — always its own scoped redeclaration, since const can't be reassigned
const counter = 1;

Usable both on the main canvas and inside a Function Graph.