Some blocks remember earlier messages: a count, the previous value, a window of values, the time of the last message. This page lists those blocks and explains how their memory behaves, which matters when you deploy changes.
How block memory works
| Rule | Detail |
|---|---|
| One memory per device | Unless you set key, these blocks keep a separate memory per message originator: each device has its own count, previous value or watch. Set key to msg.topic or another path to group differently. |
| Survives restarts | Memory and waiting messages are kept by the platform; a restart or a move to another worker does not lose them. Waits re-arm at their original due time. |
| Reset on settings change | A block keeps its memory across a deploy when its settings did not change. A block whose settings changed starts with an empty memory (messages it was holding are kept). A removed block, or one whose type changed, loses everything. |
| Kept while paused | A switched-off or paused flow keeps its blocks’ memory; a deleted flow loses it. |
| Size | At most 10,000 keys per block; beyond that the oldest key is forgotten. Held messages count against 16 MiB per block. |
| Tests | A test starts from an empty memory, or from a read-only copy of the live memory when you tick Start from the live state and context. A test never changes the live memory. |
So: when you change a Statistics window, its averages start from scratch; when you only rewire around it, they continue.
Counter
Counts messages per key, over all time or within a sliding window, and adds the count to the message.
| Setting | Meaning | Default | Values |
|---|---|---|---|
| n | The count that sends a copy to reached; empty or 0 = never | empty | 0 or more |
| window_ms | Count only the last this long; 0 = all | 0 | 0 to 7 days |
| reset_at_n | Start again from 0 when n is reached | off | on, off |
| key | Each key has its own count | msg.originator | a path |
| store | memory, or persist (kept in the flow’s persistent context) | memory | memory, persist |
Outputs: out (every message, with msg.count), reached (a copy when the count is n or more). msg.reset = true sets the key’s count to 0. Without reset_at_n, every message from the n-th on also goes to reached.
Example: “3 door openings within 10 minutes”: n 3, window_ms 10 min, reset_at_n on, reached → Raise alarm.
Delta
The difference between a number and the previous number of the same key: consumption from a meter, pulses since the last report.
| Setting | Meaning | Default | Values |
|---|---|---|---|
| input | The number | msg.payload | a path |
| output | Where the difference is written | msg.payload.delta | a path |
| period | Where to write the milliseconds since the previous value | none | a path |
| round | Decimals, applied first | none | 0 to 15 |
| on_negative | A drop (counter restart) | error | error (negative_delta), pass (written with its sign), zero |
| skip_zero | Pass a zero delta on unchanged, without writing it | off | on, off |
| key | Each key has its own previous value | msg.originator | a path |
| seed | The first message’s previous value | none (delta 0) | none, latest (the device’s stored latest value) |
| seed_key | The stored key to seed from (seed = latest) | up to 128 characters | |
| ts_path | Where the reading’s time is | the record time | a path |
Outputs: out, other (no value at the input path), error (not_a_number, negative_delta). After a drop, the new value becomes the baseline in every mode. Delta reads no database per message, so it is the efficient way to compute consumption.
Statistics
Count, sum, average, minimum, maximum, standard deviation, last value and rate over the last values or the last period, per key.
| Setting | Meaning | Default | Values |
|---|---|---|---|
| property | The number | msg.payload | a path |
| window | count (the last size values) or time (the last size ms) | count | count, time |
| size | Number of values, or the window in ms | 10 | count: 1 to 10,000; time: 1 ms to 7 days |
| outputs | Which figures | count, avg, min, max | any of count, sum, avg, min, max, stddev, last, rate |
| emit | each message, or once per full window (end_of_window) | each | each, end_of_window |
| key | Each key has its own window | msg.originator | a path |
msg.payload is replaced by the figure (one output chosen) or an object of figures. rate is values per second. A time window holds at most 10,000 values. After switching window to time, set size in milliseconds: the default 10 would be 10 ms. Error invalid_value “not a number”.
Example: hourly average sent once an hour: window time, size 3600000, outputs avg, emit end_of_window.
Watchdog
Notices when messages stop: if no message of a key arrives within the time, it sends a timeout message; when messages come back it reports that too.
| Setting | Meaning | Default | Values |
|---|---|---|---|
| ms | How long a key may be silent | 1 min | 100 ms to 7 days |
| key | Each key watched on its own | msg.originator | a path |
| repeat | Send timeout again every ms while silent | off | on, off |
Outputs:
timeout: a new message (a new run) withmsg.payload= the key,msg.topicof the last message,msg.timeout_ms, and the originator of the last message, so Raise alarm works on it.ok: the first message of a key after a timeout, unchanged.
Other messages are not passed on. The watch of a key starts with its first message: a device that never sends is not noticed (use an offline alarm rule for that; see Offline alarms). A late message (after an outage) neither feeds nor fires the watchdog, so a silence alarm is not cleared on old readings. Watching per device needs key set to the device: msg.originator (the default) or msg.metadata.deviceId.
Start / end
Marks the start and the end of a period of activity.
| Setting | Meaning | Default | Values |
|---|---|---|---|
| ms | Quiet time after the last message that ends the period | 1 min | 0 to 7 days |
| key | Each key has its own period | msg.originator | a path |
Outputs: start (a copy of the first message of a period, at once), end (the last message, ms after it arrived). Messages in between do not go out.
Variables as memory
For values several blocks or flows share, write variables with Set variable or Change and read them with paths:
| Store | Scope | Limit |
|---|---|---|
flow.x | This flow | 1 MiB per flow |
global.x | Every flow of the organisation | 4 MiB per organisation |
flow.persist:x, global.persist:x | The persistent store of the same scope | within the same limits |
A write over a limit fails with limit and keeps the old value. The editor’s Activity > Data tab shows the values and how full the stores are. See Action blocks.
Timers
For “if nothing cancels it within 10 minutes, do this” across flows, use the Timer action block with a Named timer trigger. See Action blocks and Trigger blocks.

