Skip to content

DeviceBoard – RulesFlow & Rule Nodes User Guide

DeviceBoard – RulesFlow & Rule Nodes User Guide

DeviceBoard – RulesFlow & Rule Nodes User Guide

Version: 1.0

Audience: Hub Admins, Solution Engineers, Developers, Integrators

Purpose: Learn how to build data processing, automation, event routing, alarms, AI inference, and business logic workflows using RulesFlow and Rule Nodes.

1. Introduction to RulesFlow

RulesFlow is DeviceBoard’s event-driven logic engine that processes incoming telemetry, attributes, events, alarms, AI outputs, device actions, and external triggers.

It allows you to create visual workflows that define:

  • How telemetry is processed
  • How alarms are created/updated
  • How device state changes are handled
  • How AI models are triggered
  • How data is enriched, filtered, or transformed
  • How messages are routed to dashboards, databases, or external systems
  • How automations are executed

RulesFlow is a core component of the DeviceBoard backend engine.

2. What Can RulesFlow Do?

RulesFlow enables:

Data Transformation

Convert, normalize, filter, or map telemetry.

Conditional Processing

Run logic based on thresholds, conditions, or attribute values.

Alarm Automation

Create, update, clear alarms based on logic or AI results.

AI Inference

Invoke supervised or unsupervised AI models for predictions and anomaly detection.

Event Routing

Send messages to:

  • Dashboards
  • External systems
  • Notification channels
  • Databases

Device Command Automation

Trigger RPC commands automatically based on conditions.

Multi-Device and Asset Logic

Process data across related devices/assets through composite workflows.

3. RulesFlow Structure

3.1 Rule Nodes

A Rule Node is a processing block that performs a specific task.

Examples:

  • Telemetry Filter
  • Script Node
  • AI Inference Node
  • Alarm Node
  • Analytics Node
  • Enrichment Node
  • Forward Node
  • Kafka/MQTT/HTTP Integration Node

3.2 Links

Connections between nodes define the processing path.

Links can be:

  • Success Path
  • Failure Path
  • True/False Branch
  • Custom Labeled Outputs

3.3 Flow Types

A RulesFlow can process:

  • Telemetry Messages
  • Attribute Updates
  • Alarm Events
  • Lifecycle Events (device added/removed)
  • AI Model Results
  • Custom Application Events

4. RulesFlow Entry Points

RulesFlow typically begins with one of these triggers:

4.1 Incoming Telemetry Node

Starts processing when a device sends telemetry.

4.2 Incoming Attribute Update Node

Triggered when device or server attributes update.

4.3 Timer/Event Node

Fires periodically (5 sec, 1 min, custom interval).

4.4 External Webhook Node

For REST or webhook-based event ingestion.

5. Rule Node Categories

DeviceBoard includes a comprehensive set of Rule Node types. Below is the detailed catalog.

5.1 Input / Trigger Nodes

Telemetry Input Node

Captures raw telemetry from devices.

Attribute Update Node

Triggered when attributes change.

Lifecycle Event Node

Triggered when:

  • Device goes online/offline
  • Device gets added/removed
  • Reconnect events

Timer Node

Triggers on fixed interval to:

  • Recalculate KPIs
  • Run AI inference
  • Clear expired alarms
  • Fetch external data

External Event Node

Listens to:

  • Webhooks
  • API calls
  • External systems

5.2 Processing Nodes

Filter Node

Apply expressions such as:

temperature > 80 && vibration > 1.5

Script Node

Runs JavaScript/Python-style logic for:

  • Transformation
  • Computation
  • Formatting
  • Custom routing

Example:

msg.speed_kmh = msg.speed_mps * 3.6;
return msg;
    

Transformation Node

Convert:

  • Raw values → engineering units
  • JSON → object
  • Encoded payload → structured message

Enrichment Node

Attach:

  • Server attributes
  • Related device attributes
  • Asset metadata

Correlation Node

Combine data streams:

  • From multiple devices
  • From parent assets
  • From previous telemetry windows

5.3 AI Nodes

AI Inference Node (Supervised)

Uses trained supervised models to compute:

  • Predictions
  • Scores
  • Failure probability

AI Anomaly Detection Node (Unsupervised)

Automatically detects:

  • Health score
  • Anomaly score
  • Behavioral drift
  • Abnormal patterns

AI Post-Processing Node

Normalize or interpret raw model outputs.

5.4 Alarm Nodes

Create/Update Alarm Node

Generates or updates alarm based on logic.

Configuration:

  • Alarm Type
  • Severity
  • Condition
  • Alarm details template

Clear Alarm Node

Clears alarm when condition is resolved.

Acknowledge Alarm Node

Automatic acknowledgment when rules permit.

5.5 Action Nodes

RPC Command Node

Sends command to device automatically.

  • Restart machine
  • Open valve
  • Turn on lights
  • Adjust threshold

Attribute Write Node

Writes or updates server/shared attributes.

Notification Node

Sends:

  • Email
  • SMS
  • Webhook
  • Messaging service notifications

Example notification content:

Device ${deviceName} reported abnormal temperature: ${temperature}

Dashboard Event Node

Updates widgets or dashboards.

5.6 External System Nodes

  • HTTP Node – Send HTTP POST/GET to external system
  • MQTT Node – Publish to an external MQTT broker
  • Kafka Node – Produce messages into Kafka stream
  • Database Node – Write data to external SQL/NoSQL storage
  • Webhook Node – Send outbound webhook

5.7 Output Nodes

Success Node

Terminates successful processing path.

Failure Node

Captures errors for debugging.

6. Building a RulesFlow – Step-by-Step

6.1 Step 1: Create a New RulesFlow

Navigate to:

Hub Admin → Automation → RulesFlow → Create New

Enter:

  • Name
  • Description
  • Flow Type (telemetry, attributes, orchestration)

6.2 Step 2: Add Input Node

Pick an entry node:

  • Telemetry Input
  • Attribute Input
  • Timer
  • External Event

Example:

Telemetry Input Node will start processing whenever a device sends data.

6.3 Step 3: Add Processing Logic

Add nodes such as:

  1. Filter Node → temperature > 80
  2. Transformation Node → convert units
  3. AI Inference Node → predict failure probability
  4. Alarm Node → create/clear alarms
  5. RPC Node → send shutdown command

6.4 Step 4: Link Nodes

Connect nodes using success/failure/conditional branches.

6.5 Step 5: Deploy RulesFlow

Assign to:

  • Device Model
  • Asset Model
  • Individual device (optional)

All devices of the model will now use this flow.

7. RulesFlow for Digital Twins

RulesFlow automatically maintains Digital Twin intelligence:

  • Updates twin attributes
  • Computes derived values
  • Generates alarms
  • Calculates health score
  • Updates virtual telemetry
  • Processes inter-device relationships

Example:

Twin.running_hours = compute(msg.timestamp);
Twin.efficiency = msg.output / msg.input;
  

8. Example RulesFlow Use Cases

8.1 Example 1 – Temperature Alarm

  1. Telemetry Input
  2. Filter Node → temperature > 80
  3. Alarm Node → Create “High Temperature Alarm”

8.2 Example 2 – AI Prediction + Auto Shutdown

  1. Telemetry Input
  2. AI Inference Node → failure_prob
  3. Filter Node → failure_prob > 0.7
  4. RPC Node → send shutdown command
  5. Alarm Node → Create critical alarm

8.3 Example 3 – Gateway Data Normalization

  1. Telemetry Input
  2. Script Node → decode Modbus registers
  3. Transformation Node → engineering units
  4. Enrichment Node → add metadata
  5. Output Node

8.4 Example 4 – Asset Aggregation

  1. Timer Node
  2. Correlation Node → fetch all child device telemetry
  3. Transformation Node
  4. Attribute Write Node → update asset-level KPIs

8.5 Example 5 – Notification Workflow

  1. Alarm Event Node
  2. Notification Node → email
  3. Notification Node → webhook
  4. Output

9. Assigning RulesFlow to Device Models

Each Device Model contains a field:

“RulesFlow Mapping”

When a RulesFlow is assigned to a Device Model:

  • All devices of that model use the flow
  • Alarm rules are automatically applied
  • Telemetry is processed consistently
  • AI models are triggered automatically

This ensures reusable logic.

10. Monitoring and Debugging RulesFlow

DeviceBoard provides tools to debug flows:

10.1 Debug Panel

Shows:

  • Incoming messages
  • Node execution results
  • Outputs from script nodes
  • Errors/exceptions
  • Alarm evaluation logs

10.2 Message Tracing

Trace the exact route a message took through the flow.

10.3 Node Statistics

Visual counters for:

  • Messages processed
  • Errors
  • Execution time

11. RulesFlow Best Practices

✔ Keep flows modular

Split large workflows into multiple smaller, reusable flows.

✔ Use Device Models for consistency

Avoid per-device custom flows unless necessary.

✔ Use AI nodes cautiously

Heavy models should be triggered based on conditions or timers.

✔ Use enrichment nodes

Pull metadata only when required.

✔ Implement error handling

Always connect failure outputs.

12. Troubleshooting RulesFlow

  • ✔ Check filter conditions
  • ✔ Ensure RulesFlow assigned to Device Model
  • ✔ Verify telemetry keys
  • ✔ AI model not deployed
  • ✔ Incorrect mapping of inputs
  • ✔ Missing data fields
  • ✔ Device offline
  • ✔ Incorrect RPC method
  • ✔ ABAC restriction
  • ✔ Wrong URL
  • ✔ Timeout
  • ✔ Authentication failure

13. Summary

RulesFlow in DeviceBoard enables:

  • ✔ Real-time telemetry processing
  • ✔ Automation and orchestration
  • ✔ AI inference and anomaly detection
  • ✔ Alarm management
  • ✔ Data transformation and enrichment
  • ✔ Control actions and RPC automation
  • ✔ External system integrations
  • ✔ Digital Twin intelligence

It is one of the most powerful components of the platform and enables fully customizable IoT logic pipelines.