Dynamic Delay - Rule Engine

We’re excited to release the new Dynamic Delay feature within the Rule Engine.

When using a Delay block within your rule, you’ll now be presented with four different options for determining the length of the Delay:

  • Input (default)
  • Variable
  • Random
  • Expression

Input

The Input option is the default and is what you are familiar with today. It enables you to enter a fixed number of seconds that you want the rule to delay for.

Variable (Premium)

The Variable option enables you to select a numeric variable that you’d like to use as the value in your delay. This is particularly helpful if you have another rule which sets the variable – for example, using conditions or an expression to determine what the value of the variable should be and thus how long the delay should be.

Random

The Random option enables you to enter a minimum and maximum value and will delay the rule execution for a random about of time between those two values. For example, if you leave the defaults of 30 - 90 seconds, the rule will delay a random amount of time between those two values.

For more advanced control over random values, including the ability to select from a subset of random values, you can use a calculation in an expression.

Expression (Premium)

The Expression option enables you to input an expression directly in the Delay card. This is mostly a convenience method as instead of having to explicitly create and set a variable in advance, this enables you to directly use the result of an expression as the input to the delay.

Keep in mind that the result of your expression must be a numeric output value otherwise the delay will effectively be treated as a 0 second delay and the block will be skipped (rather than throwing an error and stopping the execution of the rule).

The Date Functions are particularly interesting in this context as they enable some really neat features with delays. For example, you might run a rule every day at 12:00 AM (00:00) that calculates how many seconds there are until an event should happen - the result being a scheduled execution of an event.

2 Likes

Already using in some of my rules.

Thanks Josh. A nice add,

1 Like