Skip to content

Heartbeat

mchristegh edited this page Jul 15, 2026 · 1 revision

An optional fixed-cadence status snapshot on output 3 (Query), identical in shape to a query response but with msg.source: "internal". It exists for watchdogs and dashboards: a flow that wants to notice silence can't rely on event-driven outputs, because a dying system stops producing events.

Configuration

Heartbeat Interval plus units; 0 (the default) disables it.

Behavior

  • Runs continuously from deploy. Unlike this node's timer siblings — where the heartbeat is scoped to an active run — this node has no bounded "run," and its idle problems are exactly what a watchdog needs to see: stuck in waiting, sources gone stale, quorum lost. The very first ticks, before any reading arrives, show consensusState: "waiting" with a null aggregate — that's a feature.
  • Nothing disturbs the schedule. Readings, commands, disable, staleness, quorum changes — the heartbeat ticks through all of it on its own fixed wall-clock interval.
  • Stops only when the node closes (redeploy or Node-RED shutdown). After a persisted restore it restarts fresh rather than resuming its original schedule — see Persistence.
  • Ticks clone the most recent accepted reading's message (there is no live triggering message), so your payload/topic context rides along; before any reading, the base is empty.

Typical wiring

A downstream trigger node (or similar watchdog pattern) set to fire if no message arrives within a couple of heartbeat intervals gives you dead-man's-switch monitoring of the whole sensor group; the snapshot's msg.freshCount, msg.quorum, and msg.sources breakdown tell a dashboard which sensor is the problem.

The heartbeat never appears on output 4, and query events never appear anywhere but output 3 — see Output Messages.

Clone this wiki locally