Define minimum rest periods between shifts for employees.
This rule allows you to enforce minimum rest periods between different types of work. It works by defining what triggers a cooldown (starts) and what should be avoided during that cooldown period (ends). This is useful for ensuring employees have adequate rest between demanding shifts, preventing burnout, and complying with labor regulations.
Labels for the rule. Labels can be used to group rules together. For example, if multiple rules are related to the same shift type, they can all be labeled with the same label.
string (enum: NONE | VERY_LOW | LOW | MEDIUM | HIGH | ...)
required
The importance of the rule. The higher the importance, the more it will be taking the rule into account. Under strict importance, the rule may never be violated.
Used to indicate how to apply the label filters. For example, if set to ANY, entities that have any of the specified labels will be included. Default: “ANY”.
Defines filtering for specific work that the rule should be applied to. For example, it can be used to apply the rule only to work carried out in specific roles.
List of days in the schedule. Each day will become one period. By default, each period will last the entire day. If a startTime and/or endTime are specified, these will apply to each period.
If true, the startTime and endTime will be applied to each individual day in the period. If false, the startTime will apply to the first day and the endTime will apply to the last day. Default: false.
The number of days between the start of each period. If not specified, this defaults to the value of daysPerPeriod, creating non-overlapping consecutive periods. Setting daysBetweenStarts to 1 will create a sliding window of periods.
If true, the startTime and endTime will be applied to each individual day in the period. If false, the startTime will apply to the first day and the endTime will apply to the last day. Default: false.
Used to indicate how to apply the label filters. For example, if set to ANY, entities that have any of the specified labels will be included. Default: “ANY”.
Used to indicate how to apply the label filters. For example, if set to ANY, entities that have any of the specified labels will be included. Default: “ANY”.
The simplest use case is to require a minimum rest period between any two shifts. This ensures employees have adequate time to recover between work periods. When you omit the starts and ends sections, the rule applies to all shifts.
The rule below requires a minimum of 12 hours of rest between any two shifts. After an employee finishes any shift, they cannot start another shift until at least 12 hours have passed.
You can define cooldowns that only apply between specific types of shifts. For example, you might want a longer cooldown after night shifts before morning shifts.
The rule below requires at least 16 hours of rest after a night shift before an employee can work a morning shift. This helps ensure employees have adequate time to adjust their sleep schedule.
Instead of specifying the cooldown in hours, you can specify it in days. This is useful for ensuring employees have full days off between certain types of work.
The rule below requires at least 2 days without a shift after working a weekend shift before an employee can work another weekend shift. This helps distribute weekend work more evenly among employees.
You can create more complex cooldown rules by combining different shift types in the starts and ends sections. This allows you to model sophisticated rest requirements.
The rule below requires at least 48 hours of rest after working any intensive shift (like emergency shifts or long shifts) before an employee can work another intensive shift. This helps prevent employee burnout from demanding work.
While cooldown rules are often used with STRICT importance to enforce mandatory rest periods, you can also use them with other importance levels to encourage, but not strictly require, rest periods.
The rule below encourages, but doesn’t strictly require, at least 10 hours of rest after a night shift before an employee can work a morning shift. The solver will try to achieve this, but may violate it if necessary to satisfy other rules.
You can also target specific shifts by their IDs, giving you fine-grained control over which shifts trigger cooldowns and which shifts are restricted during cooldown periods.
The rule below requires at least 8 hours of rest after a specific early morning shift (shift-1) before an employee can work a specific evening shift (shift-2). This is useful when you have specific shift pairs that should not be scheduled too close together.
You can also limit a cooldown rule to apply only to work carried out in specific roles.
The rule below requires a minimum of 16 hours of rest between any two shifts worked in role role-1. Shifts worked in other roles are not considered by this rule.