Rule Types
Counter Rules
Count and limit occurrences within a planning period.Working Days
Limit total working days:Days Idle
Ensure minimum days off:Weekends Idle
Guarantee free weekends:Requires weekend definition in options to specify what constitutes a weekend.
Shift Type Limits
Limit specific shift types using tags:Maximum Consecutive Days
Cap the number of consecutive working days:Counter Types
DAYS_IDLE and WEEKENDS_IDLE require a period (either a fixed from/to range or a duration) to be specified — without one, the rule is silently ignored and never affects the schedule.Period Scoping
By default, rules apply to the entire planning period. Scope rules to specific periods:Fixed Period
Fixed-Length Windows
period.duration splits the planning horizon into consecutive, non-overlapping blocks of the given length, starting at the horizon’s start date (e.g. P3D over a 14-day horizon produces four 3-day blocks plus one 2-day clamped block). Each block is scored independently:
Sequence Rules
Limit consecutive occurrences without specifying a period window.Consecutive Working Days
Employees work between 2 and 4 consecutive days before a day off.
Maximum Consecutive Days
Conditional Rules
Trigger a rule when another rule’s threshold is exceeded. Example: If 20+ hours of night shifts within 72 hours, then require 2 days idle:max to trigger on “N or more”; use min to trigger on “fewer than N”.
Rule Properties
Rule type:
COUNTER or SEQUENCEWhat to count or sequence (see tables above)
Minimum count or sequence length
Maximum count or sequence length
Filter rule to specific shift tags
Time scope with
from/to dates, or a fixed-length duration that tiles the planning horizon into non-overlapping blocksConditional rule triggered when this rule is exceeded. The
then rule always inherits the parent rule’s resolved period window (including any rolling-window expansion); any period set directly on the then object is ignored.Common Rule Patterns
40-hour work week
40-hour work week
Maximum 5 consecutive days
Maximum 5 consecutive days
At least 2 weekends off per month
At least 2 weekends off per month
Max 2 night shifts per week
Max 2 night shifts per week