On Timer Event in RCOM Gateway
The On Timer event in RCOM Gateway enables time-driven automation within workflows. It is typically used to delay execution or schedule downstream logic using an internal timer mechanism.
This article explains how the OnTimer event is generated, how to configure it using the StartTimer action in a workflow, and how to set up an Event Processor to respond to the timer’s completion.
Overview
The On Timer event is triggered when a timer, previously started by the StartTimer action in a workflow is completed. This is particularly useful when you want to introduce delays between actions or perform time-based processing inside the workflow engine, without relying on external triggers.
Workflow Flow
- A workflow includes a
StartTimeraction block. - The timer is assigned a unique name (
TIMER_NAME) and a duration in milliseconds. - After the timer finishes, the Gateway automatically emits an
OnTimerevent. - The event includes the
TIMER_NAMEas a payload. - An Event Processor listening for
OnTimerevents with matching timer names captures the event and triggers the corresponding follow-up workflow.
StartTimer Action
To initiate a timer, use the StartTimer action inside a workflow.
| Parameter | Description |
|---|---|
| TIMER_NAME | A unique string identifier for the timer (used later for matching the event). |
| DURATION | Timer duration in milliseconds. |
| GLOBAL_TIMER | Optional. If true, timer is global and not scoped to a workflow instance. |
Once started, the system waits asynchronously. When the time is up, it emits an event named OnTimer with the TIMER_NAME.
Setting Up an Event Processor
To respond to this timer-completion event, create a new Event Processor:
- Go to Settings > Client Settings > Event Processor.
- Click ➕ Create New.
- In the Event Source, select any value (mandatory, but irrelevant for this event type).
- Under Trigger Type, select On Timer.
- Under Trigger Config, set:
- TIMER_NAME: The name of the timer used in the
StartTimeraction.
- TIMER_NAME: The name of the timer used in the
Use the same TIMER_NAME string in both the workflow and the event processor’s Trigger Config to ensure proper matching.
✅ Example Use Case
Scenario: After detecting a new pallet, wait 10 minutes before re-checking its location.
-
Workflow A (triggered by tag read):
- Reads object info
- Starts a timer with
TIMER_NAME = delayedRecheck Duration = 600000(10 minutes)
-
Workflow B (triggered by
OnTimer):- Event Processor listens for
OnTimerondelayedRecheck - Re-checks the pallet’s position in the object group
- Sends an alert if the object is missing or incorrectly located
- Event Processor listens for