Skip to content

# Delay Action

The Delay action delays the execution of the actions that follow it in the activity. You can delay execution relative to the current time (that is, the exact time at which this Delay action is encountered), or relative to the time at which the activity started (that is, the time the first action in the Activity was evaluated).

You can use the result of a variable/expression as the delay time by wrapping it: `${{ expression }}`. The interior may be a variable name or an expression. For example, to create a random delay between 5 and 15 seconds: `${{ 5 + random()*10 }}`.

## Counter-Reactions

Delayed actions in a rule-based reaction are run unless/until the rule's "counter-reaction" is started. The counter-reaction is the reaction for the opposite state of the rule; that is, the counter-reaction to a rule's set state is the reset reaction, and the counter-reaction to the reset state is the set reaction. For example, let's say you have a rule with a set reaction that turns on a light, delays 60 seconds, and then turns off the light. If the rule resets during the delay period, and there are actions in the reset reaction, then set reaction is aborted (and therefore never turns off the light) before the reset reaction is started.

If the counter-reaction contains no actions, the running reaction is not affected and will complete as expected.

Updated: 2021-Mar-08