Skip to main content

Every Nth

Runs on: Frontend (Chatbox). Chatbox Flow Editor only.

Counts the messages passing through and sends every Nth one to Pass, the rest to Fail. The counter resets when the browser source refreshes. Use it to alternate layouts, or chain several with different offsets to rotate through variants.

Inputs​

NameTypeDescription
inputanyAny value, typically the chat message from an upstream node.

Outputs​

NameTypeDescription
passanyThe input value, forwarded on every Nth message.
failanyThe input value, forwarded on all other messages.

Configuration​

  • N (2-5): The number of messages in one cycle.
  • Offset (0 to N-1): Which position in the cycle passes. With N=3, Offset 0 passes message 1 and Offset 1 passes message 2.

Example​

To rotate three variants, chain three Every Nth nodes in series, all with N=3 and offsets 0, 1 and 2, and connect each Pass to a different Select Variant effect.