Rule Chain Guide

A rule chain is a visual processing workflow that handles incoming messages such as telemetry data, alarms, or remote procedure calls. It allows you to define h

A rule chain is a visual processing workflow that handles incoming messages such as telemetry data, alarms, or remote procedure calls. It allows you to define how data should be filtered, enriched, transformed, and acted upon — both inside and outside the platform.

Each rule chain is made up of nodes, and these nodes are grouped into six main categories:

Node Types and Categories

1. Filter

Used to evaluate conditions and route messages accordingly. Filters typically return true or false and branch the flow

Examples:

  • Script: Evaluate conditions using JavaScript (e.g., temperature > 80)
  • Message Type: Route based on message type (e.g., telemetry, RPC, alarm)
  • Device Type Filter: Allow only messages from certain device types

2. Enrichment

Adds additional information to the message, such as metadata, attributes, or contextual data from related entities.

Examples:

  • Originator Fields: Adds info like device type, label, or location
  • Customer Attributes: Enrich message with attributes from the associated customer
  • Related Entity: Load and attach data from linked entities (e.g., asset, gateway)

3. Transformation

Changes the format, content, or structure of the message to make it compatible with other systems or to fit processing logic.

Examples:

  • Script Transformation: Use JavaScript to modify or enrich the payload
  • Change Originator: Switch message origin (e.g., from device to customer)
  • To Email Message: Prepare a message in email format

4. Action

Defines what the system should do when specific conditions are met.

Examples:

  • Create Alarm: Trigger an alarm based on a threshold
  • Clear Alarm: Remove an active alarm when normal conditions return
  • Log: Write data to platform logs for audit or debugging
  • Save Timeseries/Event/Attributes: Persist data in the database

5. External

Allows integration with third-party services or communication channels.

Examples:

  • REST API Call: Send HTTP requests to external systems (e.g., webhooks)
  • Send Email: Trigger email alerts or notifications
  • MQTT / Kafka: Push data to external message brokers

6. Flow

Used for routing, organizing, or linking different parts of the processing flow or even other rule chains.

Examples:

  • Switch Node: Route messages based on multiple conditions
  • Rule Chain Node: Forward the message to another rule chain
  • Input/Output Nodes: Define boundaries between chains
  • Flow Control: Add delay, retry, or message buffering logic

Building a Rule Chain: Step by Step

  1. Start with an Input node (e.g., Telemetry) to receive messages.
  2. Use Filter nodes to evaluate conditions and determine routing.
  3. Apply Enrichment and Transformation nodes as needed to prepare or modify data.
  4. Trigger Action or External nodes based on logic.
  5. Use Flow nodes to structure and scale the logic across multiple chains.

Example: High Temperature Alert Flow
  1. Input: Receive telemetry with temperature data
  2. Filter: Check if temperature > 80
  3. Enrichment: Add device name and location
  4. Action: Trigger alarm and send email notification
  5. Log: Store the event in platform logs
  6. Flow: Route to a secondary rule chain for escalation

This modular rule chain architecture allows powerful, real-time processing of IoT data with minimal or no coding. It’s ideal for automating alerts, integrating with other systems, and building smart workflows.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *