Skip to content

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 ​

LayerJob
Rule engineTransform, branch, notify, forward, alarms, attributes, commands, downlink
Profile Alarm RulesDeclarative threshold / no-update detection on the device profile
SchedulerTimed shared-attribute / command jobs (not on the ingest path)
Integration HubVendor 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 RulesRule engine
WhereDevice profileGraph Create alarm node
Who is toldUsers page: escalation L1/L2/L3, email, Telegram groupsNotify node on the graph (email or Telegram id you type there)
WhenAfter the message is storedOnly 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 ​

NodePurpose
message_inEntry. Tick which message types this engine accepts
message_typeRoute by telemetry, attributes, lifecycle, RPC, or alarm
filterBranch on a value in the current message (true / false). It does not scan the alarm list
switchMulti-way branch
enrichIn-flow transform steps
mathNumeric derive
dedupeSuppress duplicates
delayPark-and-resume (Redis-durable when Presence Redis is up)
webhook / rest_callHTTP side effects (async by default)
notifyEmail / Telegram / SMS messaging
logServer log note. is filled from the message
deltaCurrent minus the previous reading
compare_previousTrue or false against the previous reading
windowAverage, min, max, or sum over a time window
key_quietA key has stopped arriving (fresh / quiet)
geofenceInside, outside, entered, or left a fence. A gps object with lat and lon is read as a point
related_actionAlarm, attribute, or command on a parent, child, or same-asset device
dropStop this message
create_alarmOpen an alarm
set_attributeWrite attributes
send_commandDevice command
integration_downlinkChirpStack/TTN downlink
engine_refCall another Started engine (nested, max depth 3)
related_entityAsset / 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).

support@autoconnecto.in · founder@autoconnecto.in · +91 92121 00555 · app.autoconnecto.in