Stand with Ukraine flag
Try it now Pricing
PE Edge
Documentation > Scheduler > Scheduler vs Rule Chain
Getting Started
Devices Library Installation Architecture API FAQ
On this page

Scheduler vs. Rule Chain Templates - When to Use Each One

Overview

ThingsBoard Edge allows different types of automation events—Scheduler and Rule Chain events.

The Scheduler event is periodic task performed automatically, such as telemetry and attribute update or RPC commands, etc. For more details on this feature, see the ThingBoard Platform Scheduler documentation and the Edge Scheduler documentation.

Doc info icon

The scheduler feature is supported only in the Professional Edition.

A Rule Chain allows you to perform automated tasks based on incoming data or events. These tasks are performed by rule nodes, which are the building blocks of the Rule Chain. For example, when a device sends temperature data that reaches the threshold, the Rule Chain processes it and creates an alarm notification. Read more about Rule Engine and Rule Chain Templates in the corresponding documentation.

Edge-Specific Considerations

  • Rule Chain templates and Scheduler events cannot be created or modified directly on ThingsBoard Edge. They must be set up in ThingsBoard Cloud and synced to Edge.
  • Once Rule Chain templates and Scheduler events are synchronized to Edge instance, they run entirely at the edge, independent of internet connection.
  • Both Scheduler events and Rule Chain templates execute locally on the Edge.

The Comparison Matrix

comparison-matrix

When to Use Each One?

  • Scheduler:
    • Time-based triggers are required;
    • A periodic or scheduled automation that is independent of device data.
  • Rule Chains:
    • Real-time reaction to events or telemetry;
    • Complex logic, or external API calls are required;
    • Local incoming data, attribute updates, alarms, etc., processing.

Using Both Features

To create enhanced automation logic on your Edge, use both Scheduler events and Rule Chain templates.

both-features-logic

Use Case

To turn off devices (e.g., pumps) every night at 7 PM and alert if they’re still running 10 minutes later, configure two Scheduler events and modify the Rule Chain template.

  • The first scheduler event will send command { “action”: “stop_pump” } to stop the pump every night at 7 PM. Select Send RPC Request to Device as the Event type.
  • The second scheduler event will send command { "action": "check_pump_status" } to check the pump status every night at 7:10 PM. Enter "Custom" as the Event type and "Other" as the Message type.
  • In the Rule Chain template:
    • The first scheduler event (turn off pump) enters the rule chain as RPC Request to Device. It comes into Message Type Switch, routed via the "RPC Request to Device" link to the "rpc call request" node.
    • The second scheduler event (check pump status) enters the rule chain as a custom message. The "check pump status" script confirms that the message is the second scheduler event. Then, the "originator telemetry" node fetches pumpStatus. The "check pump status script" checks if it's still "ON". If it is, the rule chain template triggers the alarm.

Next steps