Skip to main content

Data Flows, Timers and Geofences

Flows define how incoming data is processed in the IoT platform and determine which functionality should handle an IoT node update event. There are four standard flows commonly used:

  • Default Flow – Standard functionality: Translator Service, Location Service, Calculations, Rule Engine, and Channels.
  • General Timer – Standard functionality plus the ability to start and stop a unique timer per IoT node.
  • General Geo Query – Standard functionality plus geo queries to check whether an IoT node is inside or outside a geofence. This flow is recommended for tracking use cases.
  • General Timer and Geo Query – Combines timers and geo queries. Useful in tracking scenarios where timers are needed in addition to geofence logic, for example, to allow a tracker to exit a geofence only during specific time periods.

Flows are essentially sets of instructions and can be customized to suit a specific use case. They may also include transform functions, which are custom pieces of code that can be uploaded to the platform and executed inside the flow within a secure, sandboxed environment.

Flows also allow the IoT platform to efficiently handle high-frequency data by bypassing certain functionality and storing incoming data directly in the database.
Custom flows can be uploaded through the APIs. If you need a custom flow, please contact your support representative.

Each connector has a default flow, but the flow can still be individually assigned per IoT node.

Flow is not supported on legacy connectors found in New Device in Devices.

Default Flow

default flow

Default: This is the flow used when no configuration changes are made.

Data enters via the connector → Translator Service (executes all translators on the IoT node) → Calculations → Location Service.
If the device’s position has changed, it will be updated. The data is then distributed to the channels, database, and rule engine.

General Timer Flow

general timer flow

The General Timer Flow is identical to the Default Flow, but after the Location Service, data is also sent to the Scheduler. To manage the scheduler just add the translator general-timer and configure it's settings. It works similarly to an alarm translator with flexible threshold supervision settings but adds a delay before triggering an alarm (timerExpired field).

general timer flow

Example use cases:

  • Trigger an alarm if a door remains open for more than 5 minutes.
  • Allow temperature to exceed a threshold for 10 minutes before sending an alarm.

Setup:

  1. Change the device flow to General Timer.
  2. Add the general-timer translator using Select Many.
  3. Configure the settings of the general-timer translator.
  4. Use timerStart, timerStartedAt and timerExpired in visualization in views and dashboards or as trigger in eventual rules.

General Geo Query Flow

general geo query flow

The General Geo Query Flow is identical to the Default Flow, but after the Location Service, data is sent to the Geo Query feature.
This flow should only be used for tracking use cases.

The Geo Query checks if a tracker device’s WGS84 coordinates are:

  • Entering a geofence (access: enter)
  • Updating position inside a geofence (access: inside)
  • Leaving a geofence (access: exit)

A geofence is essentially a polygon area definition. The logic for handling geofence events resides in a translator on the associated IoT node.

The standard translator is general-geofence, which:

  • Keeps track of devices inside a geofence.
  • Tracks the total number of devices.
  • Provides data that can be used in rules (e.g., notifications when devices enter or exit geofenced areas).

For more advanced logic, you can develop a custom Geo Query translator.

Setup steps:

  1. Set the flow of tracker devices to General Geo Query.
  2. Create generic nodes using New Device for each planned geofence.
  3. Add the general-geoquery translator to the geofence nodes (at creation or later with Select Many).
  4. Create geofences in the Map or in a map widget on a Dashboard. Associate each geofence with its corresponding geofence node.
  5. Create rules to monitor enter/exit events on the geofence nodes.

Note: In the standard Geo Query Flow, trackers themselves are not aware of whether they are inside or outside a geofence.
All logic is handled by the geofence nodes and their translators.
If the tracker itself must be aware, you need either a customized flow or an "Additional Device Update" from the translator on the geofence-associated nodes.

General Timer and Geo Query Flow

general timer and geo query flow

This flow combines the functionality of General Timer and General Geo Query.

It is useful when a device enters/exits a geofence but should only be allowed to remain in that state for a certain duration.

Example use case:

  • A “Limit Zone” where only a certain number of trackers may remain inside or outside for a maximum period of time.

Currently, there is no standard translator for associated geofence nodes in this flow, so a custom translator must be created.

The translator should use the following fields:

  • timerStart: Set to true to start or reset the timer, and false to stop it.
  • timerDelay: The timer duration in milliseconds.
  • timerStartedAt: The UTC timestamp when the timer started. Clear this field when the timer stops.
    Primarily used for visualization in views to indicate that the timer is running.

When the timer expires, the field timerExpired will be returned. This can then be used in the Rule Engine to trigger notifications.