Skip to content

Using Scheduled Rules

A normal rule reacts immediately: as soon as its condition evaluates to true, its action runs. A scheduled rule is different. It also has a condition and an action, but it only runs after a point in time is reached, rather than the instant its condition becomes true. This makes scheduled rules the right tool whenever something should happen later or repeatedly.

Typical uses are:

  • Send a reminder after three days of inactivity.
  • Create a "Check Passport" lifecycle case exactly one year after a person was created.
  • Perform a world-check every day for every open case.

How a scheduled rule is built

A scheduled rule combines the same two elements as a normal rule with a timing element:

  1. Condition — decides which cases or instances the rule applies to, written in RuLa just like a normal rule's condition.
  2. Schedule — decides when the action runs: after a fixed amount of time has passed, and/or after a reference date, and whether it runs once or repeats.
  3. Action — what happens when the rule fires, for example sending an email, assigning a value, or starting a new case.

Only cases that match the condition are considered. For each of those, the schedule determines the moment the action is executed.

Example: reminder after three days of inactivity

Suppose a case that has been sitting in a 'Waiting for Documents' state for three days should trigger a reminder email. The condition selects the relevant cases:

CASE.state = waiting_for_documents

The schedule is set to fire three days after the case entered that state, and the action sends the reminder. Because the reminder should only be sent once per case, the schedule is configured to run a single time rather than repeat.

Example: yearly re-check

To create a "Check Passport" case one year after a person was created, the condition selects person instances, the schedule fires one year after the creation date, and the action starts the lifecycle case. Setting the schedule to repeat yearly turns this into a recurring review.

Tip

Keep the condition as specific as possible. A scheduled rule is evaluated against many cases over time, so a condition that is too broad can trigger the action in cases you did not intend.