Appearance
Rule Engines
Rule engines are graph automations bound to a device profile (or the tenant default). They are the primary transform and automation path on ingest.
Ingest order (confirmed)
rule engine → persist / realtime / profile Alarm Rules
Legacy data / attribute pipelines and profile calculated-fields stages are retired from the product path. Use Rule Engine nodes (enrich, math, script, filters, webhooks) for transforms. Profile Alarm Rules remain on the device profile for declarative thresholds.
Roles
| Layer | Job |
|---|---|
| Rule engine | Transform, branch, notify, forward, alarms, attributes, commands, downlink |
| Profile Alarm Rules | Declarative threshold / no-update detection on the device profile |
| Scheduler | Timed shared-attribute / command jobs (not on the ingest path) |
| Integration Hub | Vendor decode + device match; prefer Rule Engine for business logic |
UI
Create starts with three jobs: forward, alarm when a value crosses a limit, and alarm and notify. You fill the server address, the key and limit, and who is notified there. The graph is built from those answers.
- Rule Engines —
/rule-engines - Create — job form, then the editor
- Editor —
/rule-engines/:id- Advanced palette for the full node list. Log and Drop are added immediately. Every other node opens its settings first; Add to graph places it.
- Node cards are sentences (
temperature is above 80,Raise a MAJOR alarm). - Preview highlights the path that ran and fades the other nodes. Each step shows its note.
- Bind a Started engine on Device Profile → Automations.
- Optional tenant default when a profile has no engine.
Old URLs /data-pipelines and /attribute-pipelines redirect here.
Profile alarms and rule-engine alarms
| Profile Alarm Rules | Rule engine | |
|---|---|---|
| Where | Device profile | Graph Create alarm node |
| Who is told | Users page: escalation L1/L2/L3, email, Telegram groups | Notify node on the graph (email or Telegram id you type there) |
| When | After the message is stored | Only if the path reaches that node |
A plain threshold belongs on the profile. Use the rule engine when the condition is a different path (wait, two keys, then forward).
Profile alarm rules and a rule-engine alarm node both run. Do not copy the same threshold into both. A blank rule engine is valid. Telemetry is stored, and profile alarm rules still run, with no chain at all. A drop node is the only way a reading is not stored.
Message type
The Message type node routes by message kind: telemetry, attributes, lifecycle, RPC, alarm_created, alarm_cleared, and other. Tick alarm_created / alarm_cleared on Message in or the engine never sees those events. A filter after the alarm output can match severity, ruleName, or triggerKey.
Durability
Dedupe, throttle, create-alarm cooldown, filter hysteresis, and the previous reading used by change and compare nodes are stored so they survive a restart. Delay holds the reading until the wait finishes, then stores it. A quiet-key timer resumes on the quiet output.
Run preview does not keep that previous reading, so a second-sample branch is not shown there. Start the engine to see it on a live message.
Each save keeps a version. The editor can restore an earlier graph.
Math and script
Math is a formula: + - * / ( ) and abs, min, max, round, floor, ceil, sqrt, pow on numeric keys already in the message. Script is sandboxed JavaScript. metadata.messageType says whether the message is telemetry, attributes, lifecycle, RPC, or an alarm event.
Node types
| Node | Purpose |
|---|---|
message_in | Entry. Tick which message types this engine accepts |
message_type | Route by telemetry, attributes, lifecycle, RPC, or alarm |
filter | Branch on a value in the current message (true / false). It does not scan the alarm list |
switch | Multi-way branch |
enrich | In-flow transform steps |
math | Numeric derive |
dedupe | Suppress duplicates |
delay | Park-and-resume (Redis-durable when Presence Redis is up) |
webhook / rest_call | HTTP side effects (async by default) |
notify | Email / Telegram / SMS messaging |
log | Server log note. is filled from the message |
delta | Current minus the previous reading |
compare_previous | True or false against the previous reading |
window | Average, min, max, or sum over a time window |
key_quiet | A key has stopped arriving (fresh / quiet) |
geofence | Inside, outside, entered, or left a fence. A gps object with lat and lon is read as a point |
related_action | Alarm, attribute, or command on a parent, child, or same-asset device |
drop | Stop this message |
create_alarm | Open an alarm |
set_attribute | Write attributes |
send_command | Device command |
integration_downlink | ChirpStack/TTN downlink |
engine_ref | Call another Started engine (nested, max depth 3) |
related_entity | Asset / gateway context |
Message types: telemetry, attributes, device_inactive, device_active, rpc_response.
Links: success, true, false, failure, fresh, quiet, inside, outside, entered, left — one outbound per (node, relation). Drag from the coloured output into the grey dot on the next node.
Notifications from a rule engine
The notify node can email and/or message Telegram chat ids (or SMS when Brevo SMS is configured). For tenant-wide alarm Telegram, prefer the one-time Telegram ops group under Users → Alarm Escalation Settings (alarms post to the group automatically).
Kill switch
RULE_ENGINE_ENABLED=false skips the rule engine (passthrough).
