Skip to content
Stand with Ukraine flag

Data processing

ThingsBoard Edge runs a full Rule Engine locally. Every message from a connected device passes through the rule engine before it is stored, forwarded, or acted upon, whether the Edge is online or offline.

The Edge Rule Engine mirrors the server Rule Engine in architecture and available node types. It uses an actor model: each rule chain and rule node runs as a separate actor, and messages flow between them as immutable objects.

The same node categories available on the server are available on Edge: filter, enrichment, transformation, action, and external nodes. The key addition is two Edge-specific action nodes: push to cloud and push to edge, which control data synchronization with the server. For details on how synchronization works, see Telemetry synchronization.

Edge includes a preconfigured Root Rule Chain that handles the most common scenarios without setup:

  • Saves device telemetry and attributes to the local database.
  • Generates alarms based on device profile alarm rules.
  • Forwards telemetry and attribute updates to the server via the push to cloud node.

You can extend the Root Rule Chain or replace it with a custom chain. The Root Rule Chain is the entry point for all device messages — every message starts here unless a device is configured to use a different rule chain via its device profile.

A rule chain template is a rule chain created on the server specifically for deployment to Edge instances. The template does not run on the server — it runs on the Edge after it is assigned. This lets you design and version processing logic centrally, then deploy it consistently across many Edge instances.

Starting with Edge 4.0, rule chains can also be created and edited directly on the Edge instance, without going through server templates. Changes made on Edge propagate back to the server automatically when the connection is available.

  • Filter: Use a script or message type filter node to pass only relevant messages downstream, like routing only telemetry with a temperature key to the push to cloud node.
  • Transform: Use a transformation node to reshape or enrich a message before forwarding it, like stripping sensitive fields before pushing to the server.
  • Act: Use action nodes to respond to device data in real time, like sending an RPC command back to the device when an alarm is created.
  • Route: Use a switch node to split message traffic by device type, message content, or entity attribute, and send each path to a different downstream chain.

The Rule Engine continues to process messages when the Edge is disconnected from the server. Devices are processed, alarms are raised, and data is written to the local database without interruption. Events destined for the server accumulate in the cloud event queue and are sent once the connection is restored. For details, see Telemetry synchronization.