Skip to main content

Variables

Variables let you store values that persist across your flow — and in some cases, across multiple flow executions.

Flow Variables​

Flow variables are scoped to a single flow. They reset each time the flow runs.

Use cases:

  • Temporary values used within a single execution
  • Intermediate results passed between branches
  • Counters that reset each run

How to use them:

  1. Define variables in the flow's variable panel
  2. Read them with the Flow Variable data node
  3. Write them with the Set Flow Variable effect node

Broadcaster Variables​

Broadcaster variables are persistent — they survive across flow executions and are stored in the database. They are shared across all of a broadcaster's flows.

Use cases:

  • Persistent counters (death counter, sub counter)
  • Toggle states that carry over between streams
  • Storing user preferences or accumulated data

How to use them:

  1. Read them with the Broadcaster Variable data node
  2. Write them with the Set Broadcaster Variable effect node

Variable Types​

Variables can store:

  • String — Text values
  • Number — Numeric values
  • Boolean — True/false values
  • Lists — a list of one of the above
  • Custom types — your own object types, as single values or lists. See Custom Types.
  • Text Style — one of your text styles, picked from tiles. See below.

The type is set when the variable is created and determines what kind of data it can hold. A custom-typed variable's fields are addressable in {{template}} tokens by path — e.g. {{broadcaster.champion.username}} reads the username field of your champion variable.

Text Style Variables​

Flow variables, overlay variables and streamer variables can be type Text Style. The value is picked from style tiles, and the variable always holds a style.

Set Streamer Variable, Set Overlay Variable and Set Flow Variable take a Text Style value from a connected node. Their own value field is disabled and says "Connect a Text Style node". Use a Text Style Data node.

Overlay widgets can follow a streamer or overlay variable of this type, and redraw when a flow changes it. See Linking a style to a variable.

Example: Death Counter​

Here's how you'd build a persistent death counter:

  1. Add a Chat Command trigger set to the command death
  2. Add a Change Broadcaster Variable effect, set the Variable to deaths, the Operation to Add, and the Amount to 1
  3. Connect the trigger to the effect's Activate input
  4. Add a Generate Text node with the template Death count: {{0}} and connect the effect's Value output to it
  5. Add a Send Chat Message effect to display the count

Change Broadcaster Variable adds in one step on the server, so two deaths at the same moment both count.