Repository navigation
Heartbeat
An optional fixed-interval tick that makes the node emit a full state snapshot on output 2 (Query) at a regular cadence while a cycle is active — the node reporting in without being asked.
Heartbeat Interval + Heartbeat Units in the edit dialog
(see Configuration). 0 (the default) disables the feature.
Each tick produces a normal Query-output message — identical in shape
to the response to a query command, distinguishable only by
msg.source: "internal" (a requested query is "external"). The
snapshot carries the full envelope: current count, effective limit,
windowRemaining, state, the disabled flag, ignored-message tracking —
everything on Output Messages. Its payload base is the last counted
message, per the standard clone lineage.
- Starts the moment a counting cycle begins — the first counted message.
-
Keeps ticking through
countingand straight through Cooldown. -
Stops whenever the node returns to
idle: a window expiry (fixed close or sliding decay to zero), astop, areset, a cooldown ending — or a Trigger with no cooldown configured, which lands on idle directly. -
No ticks while idle. An idle node is silent; if you need a
liveness signal even when nothing is counting, an inject node sending
queryon an interval does exactly that.
Once started, the heartbeat ticks on its own independent, fixed wall-clock schedule. It is not affected by:
-
setwindoworsetcountlimitchanging the cycle underneath it - Candidates being blocked by cooldown or the disabled flag
- Sliding-mode decay changing the count
This makes the tick stream a reliable metronome: a monitoring flow can alarm on a missing tick as evidence that Node-RED (or the flow) is unhealthy, independent of what the node itself is doing.
One exception: after a Persistence restore, the heartbeat restarts fresh from the restore moment rather than resuming the original schedule — the first post-restore tick lands one full interval after startup.
-
Watching sliding decay. In sliding mode the count can drop with
no message and no event (Window Modes). A heartbeat is the
natural way to observe the decaying count without polling: each tick
reports the current
countand when it will next change (windowRemaining). - Watchdogging long windows. A 6-hour window with a 15-minute heartbeat gives external monitoring continuous evidence the cycle is alive and progressing.
-
Live cooldown display. Ticks during cooldown carry
cooldownRemaining— wire output 2 to a dashboard for a countdown.
The two look similar and are entirely different. Status Reporting (Configuration) drives only the text label under the node on the canvas and never produces a message. Heartbeat produces real messages on output 2 and never touches the label. Enable either, both, or neither independently.
Getting Started
Reference
Features
Examples
Test Script Coverage
Support