Skip to content

Input Messages

mchristegh edited this page Jul 10, 2026 · 2 revisions

The node has one input, and every incoming message falls into exactly one of two categories:

  • A control command — the payload is one of the seven recognized command strings below. Commands are case insensitive (STOP, Stop, and stop are identical) and are never counted.
  • A count candidate — anything else. The node does not inspect the payload beyond command recognition: a timestamp, a sensor reading, a boolean, an object — all count equally. Filtering belongs upstream in a switch or threshold node.

Every message — command or candidate, accepted or blocked — produces an event on one of the outputs. See Events for the full vocabulary and Output Messages for the envelope.

When a count candidate is blocked

Two independent conditions block a candidate. A blocked candidate is discarded (not counted, not queued) and routed to output 3 as a counted event with msg.ignored: true:

  1. Cooldown — while in cooldown state (see Cooldown).
  2. Disabled — while the disabled flag is set, in any state.

Blocked candidates are tracked in msg.ignoredCount / msg.lastIgnoredTime, which reset when a new counting cycle begins.

Command reference

stop

The universal escape hatch.

  • While counting: wipes the count, returns to idle.
  • During cooldown: cancels the cooldown immediately — the only way to cut a cooldown short.
  • While idle: nothing to stop — ignored: true.

reset

Wipes the count back to zero but stays armed — the next candidate becomes count 1 of a fresh cycle.

  • While counting: genuine reset, returns to idle.
  • During cooldown: ignored: true. Unlike stop, reset does not cancel a cooldown.
  • While idle: nothing to reset — ignored: true.

stop vs. reset: while counting they do the same thing. The difference is cooldown: stop cancels it, reset bounces off it. Use reset when you want to clear a count without the risk of accidentally releasing a cooldown gate.

query

Returns a full state snapshot on output 2. No side effects, works in every state. msg.source is "external" on the response; a Heartbeat tick produces the identical snapshot with source: "internal".

disable

Blocks candidates from being counted, in any state.

  • An in-flight window is not wiped — it keeps running and expires/decays naturally (the resulting windowexpired carries disabled: true).
  • Every command still works while disabled.
  • Redundant disable (already disabled): ignored: true.

enable

Re-allows counting.

  • Has no effect on an active cooldown — the two are independent blocking conditions.
  • Redundant enable (not disabled): ignored: true.

setcountlimit

Sets the count limit for the current and all future cycles.

  • Required property: msg.setcountlimit — a whole number ≥ 1.
  • Invalid values (zero, negative, fractional, non-numeric): ignored: true, with the attempted value echoed in msg.countLimitSet so a downstream flow can see what was rejected.
  • Lowering the limit to at or below the live count fires the Trigger immediately. The countlimitset event dispatches first, then the triggered event. That Trigger has no completing message of its own, so it clones the last counted message instead.
  • Works in any state; while idle or in cooldown it simply takes effect for the next cycle.

Example inject configuration: payload = string setcountlimit, plus a message property msg.setcountlimit = number 2.

setwindow

Sets the window duration for the current and all future cycles.

  • Required property: msg.setwindow — a positive number, in milliseconds by default.
  • Optional property: msg.setwindowunits — "milliseconds", "seconds", "minutes", or "hours" (singular or plural, any case) to override the units of msg.setwindow.
  • Invalid values (zero, negative, non-numeric): ignored: true, with the attempted value echoed in msg.windowSet.
  • A live cycle is re-evaluated immediately, and the consequences are mode-dependent — fixed mode re-anchors from the original window start (a now-elapsed window expires the cycle right away); sliding mode re-prunes every live message (if all age out, that is a decay to zero). Details on Window Modes.

Example inject configuration: payload = string setwindow, plus msg.setwindow = number 10 and msg.setwindowunits = string seconds.

Command summary table

Command Genuine effect in ignored: true when
stop counting, cooldown idle
reset counting idle, cooldown
query every state never
disable any state (sets the flag) already disabled
enable any state (clears the flag) not disabled
setcountlimit any state invalid value
setwindow any state invalid value

There are no redundancy checks on setcountlimit/setwindow — setting the same value again is treated as a genuine change.

Clone this wiki locally