01 · Quick Orientation
State tools have an object that owns the value and operations that read or change it:
State Node
- Lives on the canvas.
- Holds the value (ON/OFF, count, timestamps, or users).
- Gate, Counter, and Rate Limiter can run in the normal event path.
- User Memory is a shared hub referenced by other nodes.
State Action
- Placed downstream.
- Reads or changes the stored value (set ON, add +1, remember, draw, reset, etc.).
- Can live anywhere in the flow—just pick the matching node name.
02 · On/Off Switch (Gate)
The switch is a boolean guard. When ON, messages pass through; when OFF, the flow halts at this node.
Best for
- Cooldowns for chat commands.
- Manual toggles (enable/disable overlays).
- Maintenance windows (pause features during BRB scenes).
Key Actions
Set Gate State— flip ON or OFF.Reset State Node— revert to default (usually ON).
Example: 15s Cooldown
Build Steps
- Drop the switch node, name it “helloCooldown”, default ON.
- Connect your trigger → switch → actions.
- After your action, add Set Gate State (OFF) referencing “helloCooldown”.
- Add a Delay node (15 seconds).
- Add another Set Gate State (ON) for “helloCooldown”.
03 · Counter
Counters track numbers across messages. They increment automatically when a message flows through, and you can adjust values manually with actions.
Use Cases
- Every Nth chatter triggers a prize.
- Track progress to a community goal.
- Store points redeemed via commands.
Actions
Increment Counter— add or subtract custom amounts.Set Counter Value— jump to a specific number.Reset State Node— revert to the default start value.
Example: Celebrate Every 5 Messages
Inside the Condition node, compare state.hype5.value or simply use the built-in “Trigger when value matches Target” option from the Counter node’s properties.
04 · Rate Limiter (Throttle)
The throttle remembers timestamps and refuses new events until the rate you specify is respected.
Great When You Need
- “Only five raffle entries per minute.”
- “One API call per 10 seconds.”
- “Drop alerts if the overlay is already busy.”
Configuration
- Set the maximum events allowed.
- Choose the time window (seconds).
- Decide whether to queue or discard overflow.
Reset State Node if you need a clean slate during testing.
05 · User Memory
User Memory owns one named list of unique people. Remember users when they participate, check that list on later messages, remove a person, choose a random winner, or clear only that list.
Best for
- Gift-based or badge-based eligibility.
- Remembering viewers who liked, entered, or participated.
- Unique-entry prize draws.
- Separate lists for separate campaigns.
Operations
Remember UserandForget User.User Is Remembered.Pick Random User.Clear All UsersorReset State Node.
Solid teal wires carry events. Dashed purple links show which shared memory an operation uses. Each User Memory has its own count, persistence mode, and reset policy, so clearing one list does not affect another.
06 · Problem Kits
Pick a scenario and follow the steps.
Command Cooldown
- Switch node named “commandCooldown”.
- Trigger → switch → reply.
- Set Gate OFF → Delay → Set Gate ON.
- Add a chat message “Cooldown active” on the false output if desired.
Limited Freebies
- Counter default 0, target 3.
- Increment after each redemption.
- When value ≥ 3, branch to “Sorry, all gone”.
- Use Reset action at the end of stream.
Viewer Toggle
- Switch named “overlayToggle”.
!overlay oncommand → Set Gate ON.!overlay offcommand → Set Gate OFF.- All overlay triggers pass through the switch.
Example Flow Charts
07 · Troubleshooting & FAQ
| Symptom | Likely Cause | Fix |
|---|---|---|
| Set Gate State action won’t save. | No matching switch node exists (or the names differ). | Add the switch node first and confirm the dropdown references it. |
| Counter never increments. | The flow bypasses the counter node or the gate is false. | Make sure the trigger wire passes through the counter and the gate output is true. |
| Throttle blocks everything forever. | Window too strict or leftover state from testing. | Relax the limit and drop a Reset State Node action before retesting. |
| A User Memory operation has no dashed link. | No target memory is selected. | Choose the named memory in the operation's properties or drag its purple side connector onto the memory. |
| Guide buttons don’t open. | Running inside the extension without web_accessible resources updated. | Ensure actions/state-nodes-guide.html ships via manifest and reload the extension. |
Testing Checklist
- Use the Event Flow “Send Test Event” tool to simulate commands.
- Temporarily shorten cooldowns (2 seconds) or lower counter targets while verifying.
- Reset state nodes between tests so you are not reading stale data.
- Label branches (e.g., “false → cooldown active”) so you can follow the path visually.
08 · Next Steps
Combine state nodes with the rest of the Event Flow toolkit:
- Use logic gates (AND/OR/NOT) before a switch to decide who can toggle it.
- Store state-driven metadata under
metaso overlays know why a branch fired. - Export working patterns as templates so your team can re-import them later.