Skip to main content
This rule allows you to control how many consecutive shifts or days employees can work. It can be used to set both minimum and maximum limits on consecutive work periods, helping you balance employee workload and prevent burnout.

Rule schema

object
Used to set targets and limits on the number of consecutive shifts that an employee works.

Maximum consecutive shifts

To limit the maximum number of consecutive shifts or days an employee can work, use the max property in the targets object. With STRICT importance, this is a hard limit. With any other importance, it is a target: the solver will try to avoid days beyond the maximum.
The rule below strictly prevents employees from working more than 4 consecutive days. If an employee works on Monday, Tuesday, Wednesday, and Thursday, they must have at least one day off before working again.

Minimum consecutive shifts

To encourage employees to work a minimum number of consecutive shifts, use the min property in the targets object. This is treated as a target rather than a strict requirement, so the solver will try to achieve it but may not always succeed.
The rule below encourages employees to work at least 3 consecutive shifts when they do work. This helps create more predictable work patterns and reduces fragmentation.

Combining minimum and maximum

You can combine min and max in a non-strict rule to create a preferred range. Both targets are soft and use the rule’s importance. A strict rule containing min is rejected.
The rule below encourages employees to work between 3 and 5 consecutive days when they do work. The solver will try to avoid shorter groups and days beyond the maximum.

Filtering by employees and shifts

You can combine both employee and shift filters to create very specific rules for certain groups of employees working certain types of shifts.
The rule below strictly limits senior employees to a maximum of 2 consecutive intensive shifts, while other employees are not affected.

Metrics

The following status metrics are available for tracking on Consecutive rules:
Metric keyDescription
CONSECUTIVE.MIN_VIOLATIONSNumber of consecutive-work groups that are shorter than the configured minimum.
CONSECUTIVE.EXCESSIVE_DAYSTotal assigned days beyond the configured maximum across consecutive-work groups.