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

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:

  1. Add a Chat Command trigger set to the command death
  2. Add a Broadcaster Variable data node set to read your deaths variable
  3. Add a Math process node set to add 1
  4. Connect the Broadcaster Variable output to the Math node's first input
  5. Add a Number Data node set to 1 and connect it to the Math node's second input
  6. Add a Set Broadcaster Variable effect to write the result back to deaths
  7. Add a Generate Text node with the template Death count: {{0}}
  8. Add a Send Chat Message effect to display the count