Event Flow System

State Nodes Playbook

State nodes give Social Stream Ninja memory. Use them to build cooldowns, toggles, counters, throttles, participant lists, and prize draws that keep automations predictable.

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.
Remember: Add the State node first, give it a unique name, then select it from each matching operation. Without the base node, state actions have nothing to update.

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

!hello ──▶ Switch (ON?) ─▶ Send Reply ─▶ Set Gate: OFF ─▶ Delay 15s ─▶ Set Gate: ON

Build Steps

  1. Drop the switch node, name it “helloCooldown”, default ON.
  2. Connect your trigger → switch → actions.
  3. After your action, add Set Gate State (OFF) referencing “helloCooldown”.
  4. Add a Delay node (15 seconds).
  5. 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.

Auto increment: Every time a payload passes through the Counter node it adds 1 (unless you pause it with the “Only count when gate is true” option).

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

Any Message ─▶ Counter (name: hype5) ─▶ Condition (value % 5 === 0?) ─▶ Play Celebration

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.
Heads up: Throttles do not auto-reset when you edit the flow. Use 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 User and Forget User.
  • User Is Remembered.
  • Pick Random User.
  • Clear All Users or Reset State Node.
Participation Trigger ──▶ Remember User ······▶ User Memory: Entrants Draw Command ───────────▶ Pick Random User ···▶ User Memory: Entrants Reset Command ──────────▶ Clear All Users ·····▶ User Memory: Entrants

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.

See the dedicated User Memory guide for reviewed screenshots, a downloadable draw flow, TikTok eligibility, participation examples, and reset details.

06 · Problem Kits

Pick a scenario and follow the steps.

Command Cooldown

  1. Switch node named “commandCooldown”.
  2. Trigger → switch → reply.
  3. Set Gate OFF → Delay → Set Gate ON.
  4. Add a chat message “Cooldown active” on the false output if desired.

Limited Freebies

  1. Counter default 0, target 3.
  2. Increment after each redemption.
  3. When value ≥ 3, branch to “Sorry, all gone”.
  4. Use Reset action at the end of stream.

Viewer Toggle

  1. Switch named “overlayToggle”.
  2. !overlay on command → Set Gate ON.
  3. !overlay off command → Set Gate OFF.
  4. All overlay triggers pass through the switch.

Example Flow Charts

Trigger ─▶ Switch (overlayToggle) ─▶ If ON → Show Overlay └─false─▶ Notify moderator “Overlay disabled”
Redeem Reward ─▶ Counter ticketsSold ├─value < 50 ─▶ Approve Redemption └─value ≥ 50 ─▶ Deny + Refund points

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 meta so overlays know why a branch fired.
  • Export working patterns as templates so your team can re-import them later.
Keep experimenting! The new Event Flow Guide pairs with this playbook so you can master both logic and state layers.