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:
- Define variables in the flow's variable panel
- Read them with the Flow Variable data node
- 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:
- Read them with the Broadcaster Variable data node
- Write them with the Set Broadcaster Variable effect node
Variable Types
Both flow and broadcaster variables can store one of three types:
- String — Text values
- Number — Numeric values
- Boolean — True/false values
The type is set when the variable is created and determines what kind of data it can hold.
Example: Death Counter
Here's how you'd build a persistent death counter:
- Add a Chat Command trigger set to the command
death - Add a Broadcaster Variable data node set to read your
deathsvariable - Add a Math process node set to add
1 - Connect the Broadcaster Variable output to the Math node's first input
- Add a Number Data node set to
1and connect it to the Math node's second input - Add a Set Broadcaster Variable effect to write the result back to
deaths - Add a Generate Text node with the template
Death count: {{0}} - Add a Send Chat Message effect to display the count