DRAGOPS
DRAGOPS
DocumentationConceptsVariables

Variables

Store and retrieve values within a pattern execution using variables.

What are variables?

Variables let you store values that persist across nodes within a single execution. They act as named containers — you set a value at one point in your pattern and retrieve it later at another point.

When to use variables

Variables are useful when you need to:

  • Accumulate results across a loop (e.g., building a list of processed items)
  • Store intermediate values that multiple downstream branches need
  • Track state through complex flow control (e.g., counting iterations or flagging conditions)

If a value flows directly from one node to the next, pass it through wires instead. Variables are for cases where the data path is not a straight line.

Creating a variable

You define variables in the Inspector Panel on the left side of the editor. Each variable has:

  • Name — a unique identifier used by Get Variable and Set Variable nodes
  • Type — the pin type of the value (string, integer, boolean, object, etc.)
  • Default value — the initial value at the start of each execution

Using variables in your pattern

Two nodes work with variables:

Set Variable

Sets a variable to a new value. This node has an input data pin that accepts the value to store. Place it in your execution flow at the point where you want to update the variable.

Get Variable

Reads the current value of a variable. This is a pure node — it has no execution pins and evaluates inline whenever a downstream node needs the value.

Variable scope

Variables are local to a single execution. Each execution starts with the default values and any changes made by Set Variable are visible only within that execution.

  • Variables are not shared between concurrent executions of the same pattern
  • Variables are not shared between different patterns (use pattern calls with input/output pins instead)
  • Variable values are not persisted after the execution completes

Variable types

Variables support the same types as data pins:

TypeDefault value example
String""
Integer0
Float0.0
Booleanfalse
Object{}
Array[]
DateTimeCurrent timestamp

Variables vs wires

WiresVariables
Best forDirect node-to-node data flowStoring state across branches or loops
VisibilityExplicit in the graphDefined in Inspector Panel
ScopeBetween two connected pinsEntire execution
When to useValue goes from A to BValue is set in one place, read in another

In general, prefer wires for simple data flow. Use variables when the data path is indirect — through loops, branches, or when multiple unconnected nodes need the same value.

  • Nodes and pins — Get Variable and Set Variable are part of the node library
  • Type system — variable types follow the same rules as pin types
  • Executions — variable scope is tied to a single execution

On this page