ScheduleEventWithRandomOffset
Rule
Changed on:
7 Aug 2026
Overview
Schedule an event for the same entity using a randomized delay within a configurable percentage range around a base delay.Before using this rule in your workflow, confirm that:- Your scenario has a genuine concurrent execution risk
- Introducing additional latency is acceptable
| Plugin Name | Core Reference Module |
|---|---|
| Namespace | [[account.id]].core |
- that other Modules are built upon
- or that can be included in your own Workflows
UI Description
Do {eventName} after {delay}, randomly increased or decreased by {offsetPercentage} percent
Accepts
- All orchestration entities
Actions
- This rule produces a SendEventAction
Rule parameters
| Name | Type | Description |
`eventName` | `String` | The name of the scheduled event to be triggered |
`delay` | `TimePeriod` | Base delay, in seconds, before the event is triggered |
`offsetPercentage` | `Integer` | Maximum percentage by which the base delay may be randomly increased or decreased |
Event attributes
This rule does not require any specific event attributes. Any attributes from the currently executing event are propagated to the scheduled event.
Exceptions
- "Delay must be present and non-negative" - thrown when
`delay`is null or less than 0 - "Offset percentage must be non-negative" - thrown when
`offsetPercentage`is null or less than 0 - "Offset percentage must be less than or equal 100%" - thrown when
`offsetPercentage`is greater than 100
Configuration example
1{
2 "name": "[[account.id]].core.ScheduleEventWithRandomOffset",
3 "props": {
4 "delay": 30,
5 "eventName": "SourceOrder",
6 "offsetPercentage": 60
7 }
8}
9
10// The offset is 18 seconds (30 × 60%), so the actual delay is selected randomly from the inclusive range of 12 to 48 seconds.Detailed Technical Description
This rule produces a SendEventAction. The event produced will have the same context and event attributes as the currently executing event, but will be named using the value provided in the`eventName` parameter and scheduled with a randomized delay derived from the `delay` and `offsetPercentage` parameters.The rule executes the following steps:- Reads
`delay`and`offsetPercentage`from the rule props. - Validates both values:
`delay`must be present and non-negative;`offsetPercentage`must be non-negative and no greater than 100. An`IllegalArgumentException`is thrown if either condition is violated. - Computes an offset in seconds:
`round(delay × offsetPercentage / 100)`. - Selects a uniformly distributed random integer from the inclusive range:
`[delay − offsetSeconds, delay + offsetSeconds]`. - Calls
`EventUtils.scheduleEvent`with the selected actual delay. The resulting event is scheduled at now + actual delay seconds.