Repository navigation
Input Messages
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, andstopare 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
switchor 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.
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:
-
Cooldown — while in
cooldownstate (see Cooldown). - 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.
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.
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. Unlikestop, 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.
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".
Blocks candidates from being counted, in any state.
- An in-flight window is not wiped — it keeps running and
expires/decays naturally (the resulting
windowexpiredcarriesdisabled: true). - Every command still works while disabled.
- Redundant disable (already disabled):
ignored: true.
Re-allows counting.
- Has no effect on an active cooldown — the two are independent blocking conditions.
- Redundant enable (not disabled):
ignored: true.
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 inmsg.countLimitSetso a downstream flow can see what was rejected. -
Lowering the limit to at or below the live count fires the Trigger
immediately. The
countlimitsetevent dispatches first, then thetriggeredevent. 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.
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 ofmsg.setwindow. - Invalid values (zero, negative, non-numeric):
ignored: true, with the attempted value echoed inmsg.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 | 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.
Getting Started
Reference
Features
Examples
Test Script Coverage
Support