New: the AI firewall watches every module and explains each incident in plain words. See how it works

Routing and timing blocks

Reference of Switch, Gate, All of, Any of, Not, Split, Join, Sort, Batch, Delay, Debounce, Deduplicate, Rate limit, Only changes, Trigger, Detach and Link call.

These blocks decide where a message goes and when. Blocks that wait or hold messages keep them durably: a restart of the platform does not drop them. Unless a key is set, blocks that remember per key keep one memory per device (the message’s originator). Each block keeps at most 10,000 keys and holds at most 16 MiB of messages.

Switch

Routes a message by the value of one property. Each rule has its own output.

SettingMeaningDefaultValues
propertyThe value the rules testmsg.payloada path
rulesOne row and one output each: op, value (and value2 for between), optional Namenoneup to 16 rules
stop_firstSend only to the first matching ruleonon, off

Outputs: o0 … o15 (one per rule, labelled with the rule’s Name if set), else (shown as “otherwise”), error. Operators are those of Compare, plus between (from value to value2, both included) and expr (the rule’s own expression is true). With stop_first off, every matching rule gets the message.

Gate

Lets messages through while open, holds or drops them while closed.

SettingMeaningDefaultValues
initialState when the flow startsopenopen, closed
control_topicTopic of control messages; empty = nonegateup to 64 characters
conditionOptional expression: open only while trueemptyan expression
closedA message while closeddropdrop, queue
max_queueMessages kept when queueing32up to 1,000

Control messages have msg.topic equal to the control topic and msg.payload open (or true, 1, on), close (or false, 0, off), toggle or status; they are not passed on. Outputs: out, dropped (dropped while closed, or pushed out of a full queue), error. Example condition for working hours: number(fmt_time(now(), "%H")) >= 8 && number(fmt_time(now(), "%H")) < 18.

All of

Waits until messages with different keys (by default different topics) have all arrived within a window, then sends one message holding all their payloads.

SettingMeaningDefaultValues
window_msAll messages must be younger than this; 0 = no limit10 s0 to 24 h
keyWhere the key is read frommsg.topica path
min_inputsHow many different keys are needed22 to 16

Output out: the completing message with msg.payload = { key: payload, … }. Only the completing message goes out. What it collects is kept per device by default (group_by: originator, or flow).

Any of

Passes every message; optionally drops repeats of a key.

SettingMeaningDefaultValues
dedup_msDrop a message whose key passed less than this ago; 0 = pass all00 to 24 h
keyThe key for the repeat checkmsg.topica path

Not

Replaces msg.payload with its logical opposite, true or false. false, null, 0, "" and not-a-number become true; everything else (including "0", "false", [], {}) becomes false. No settings.

Split

One message per part of msg.payload: per array element, per object key, per line of text, or per fixed-size chunk.

SettingMeaningDefaultValues
modeauto (element, key or delimiter) or length (chunks)autoauto, length
delimiterWhere text is cut; \n new line, \t tab\nup to 16 characters
lengthChunk size in elements or characters11 to 65,536

Each part carries msg.parts (id, index, count, type, key …) for Join. Error queue_full above 10,000 parts.

Join

Collects messages into one.

SettingMeaningDefaultValues
modeauto rebuilds what Split cut; manual builds from any messagesautoauto, manual
buildWhat to build (manual)arrayarray, object, string
joinerBetween text pieces\nup to 16 characters
keyObject key of each messagemsg.topica path
countSend after this many messages; 0 = no count00 to 10,000
timeout_msSend what has arrived this long after the first message; 0 = wait00 to 24 h

msg.complete (any value) sends a manual group at once. Set count, timeout_ms or msg.complete in manual mode, or the group only goes out at the 10,000-message cap.

Sort

Sorts a list (array mode: property, optional field) or the messages of a group made by Split or Batch (messages mode: key, timeout_ms). Settings: order asc/desc, numeric on/off (without it, "10" sorts before "9"). Error queue_full over 10,000 elements.

Batch

Sends messages on in groups.

SettingMeaningDefaultValues
modeBy number or by timecountcount, interval
countMessages in a group101 to 10,000
overlapMessages of the last group sent again with the next00 to count − 1
interval_msTime from the first waiting message until the group goes out1 s1 ms to 24 h

Each message of a group gets msg.parts; a Join in auto mode then makes one list.

Delay

Holds each message, then sends it on unchanged.

SettingMeaningDefaultValues
msWait1 s0 to 7 days
ms2Upper end of a random waitempty0 to 7 days
from_msgTake the wait from msg.delayoffon, off
max_pendingMessages waiting at once1,0001 to 100,000
on_newqueue: each waits its own time; restart: a new message drops the waiting ones of its keyqueuequeue, restart
keyKey for restartmsg.originatora path

msg.reset = true drops every waiting message. Error queue_full when max_pending is reached.

Debounce

One message per burst.

SettingMeaningDefaultValues
msQuiet time that ends a burst500 ms0 to 24 h
edgetrailing: the last message after the quiet time; leading: the first at oncetrailingtrailing, leading
keyEach key debounced on its ownmsg.originatora path

Deduplicate

One message per period and key, however many arrive.

SettingMeaningDefaultValues
strategyfirst, last, or all (one message whose payload lists every { payload, metadata })firstfirst, last, all
window_ms (Period)Starts with the first message of a key60 s1 s to 24 h
keyOne pack per valuemsg.originatora path
timemessage (the reading’s own time, from ts_path or the record time) or arrivalmessagemessage, arrival
ts_pathWhere the reading’s time is (time = message)the record timea path
max_pendingMessages kept per key for all1001 to 1,000
msg_typeMessage type of the all resultthe first message’s typeup to 64 characters

The result carries msg.metadata.dedup with count, start and end. With Time message, a flushed backlog gives one result per period of device time.

Rate limit

At most n messages per period and key.

SettingMeaningDefaultValues
nMessages per period11 to 10,000
per_msThe sliding period1 s1 ms to 24 h
modeOver the limit: drop, latest (keep only the newest), queuedropdrop, latest, queue
max_queueMessages waiting per key321 to 1,000
keyEach key has its own limitmsg.originatora path

Outputs: out, dropped. Use it in front of an SMS, mail or outside call.

Only changes

Passes a message only when its value changed since the last one passed.

SettingMeaningDefaultValues
propertyThe valuemsg.payloada path
modechange, deadband (by at least value), deadband_pct (by at least value % of the last value)change
valueThe dead band00 or more
keyEach key has its own last valuemsg.originatora path
firstLet the first value of a key passonon, off

The new value is compared with the last value that passed, so slow drift is reported once it adds up.

Trigger

Sends a first message, waits, then sends a second.

SettingMeaningDefaultValues
firstSent at once: the message itself, nothing, or a value for msg.payloadthe message
thenSent after the wait: nothing, the message, or a valuenothing
msWait1 s0 to 7 days
extendA new message while waiting restarts the waitoffon, off
keyEach key has its own waitmsg.originatora path

msg.reset = true cancels the wait of that key.

Detach

The rest of the branch runs separately, so the device’s next message does not wait for it. Use it before a slow branch. After it, message order is not guaranteed. No settings.

Sends the message to a Link in (or with flow:<slug>, to another flow’s Flow input) and waits for the answer from a Link out in mode return.

SettingMeaningDefaultValues
targetThe Link in namerequired
timeout_msWait for the answer30 s1 ms to 1 h
returnsNamed returns of the target; each becomes an outputnone

Outputs: out (the answer), one per named return, timeout (no answer in time; the original message), error (invalid_value no such link, queue_full, unknown_return, loop). Calls nest at most 16 deep; a call into its own call stack fails with loop.