Shift Scheduler Blog
How to Use Scheduling Rules in Shift Scheduler

Scheduling rules are the instructions that tell Shift Scheduler how your roster should be built.
They turn real staffing policies into guidance for AI scheduling: who can work, who should avoid certain shifts, how rest should work, and which requirements are more important than others.
The short version:
- Write rules in plain language.
- Use normal rules for preferences and goals.
- Use Must rules only for requirements that cannot be broken.
- Put the most important normal rules higher in the rule order.
- If the roster does not match your expectation, adjust the rule order or add more specific rules.
What Scheduling Rules Are
Scheduling rules are saved roster rules for your workspace.
They help the scheduler understand constraints such as:
- Maximum consecutive work days
- Rest after difficult shifts
- Person-specific availability
- Skill or staffing requirements
- Limits on weekly or daily hours
In staff scheduling, every roster is a tradeoff. A manager may want full coverage, low overtime, employee preferences, legal rest, and a stable rotation at the same time. Sometimes all of these goals fit together. Sometimes they conflict.
Scheduling rules tell the AI scheduling system which goals matter and how strongly they should influence the result.
How To Define A Rule In Plain Language
You do not need to write formulas or configure numeric penalties manually.
Use simple sentences that describe what should happen in the roster. Good shift scheduling rules usually answer at least one of these questions:
- Who does the rule apply to?
- Which shift, day, location, or situation does it describe?
- Is it a preference or a strict requirement?
- What should the scheduler do when the rule applies?
Examples:
Nobody should work more than 5 consecutive days.After a night shift, give the person at least one day off.Do not schedule junior staff on closing shifts.Keep each person under 40 hours per week.
These rules are clear because they describe a real scheduling behavior. The scheduler can use them to compare possible rosters.
Normal Rules Vs Must Rules
Shift Scheduler has two practical types of Scheduling rules: normal rules and Must rules.
| Rule type | Best use | How it behaves |
|---|---|---|
| Normal rule | Preferences, business preferences, preferred patterns | Treated as a soft rule. The scheduler tries to satisfy it, but may break it if another higher priority goal matters more. |
| Must rule | Legal requirements, safety requirements, true business blockers | Treated as a hard constraint. Use it only when the rule should not be broken. |
Most roster rules should start as normal rules.
Normal rules are better for preferences such as "prefer mornings" or "avoid too many late shifts". These goals matter, but they may need to bend when coverage is tight.
Must rules should be reserved for requirements that are not optional. Examples include legal rest rules, safety requirements, required skills, or rules where breaking the rule would make the roster unacceptable.
This behavior is the same for the main rule types the scheduler can enforce: rest after a shift, maximum hours, location eligibility, unavailable dates, cannot-work-with rules, must-work-with rules, blocked shifts, rotations, weekly alternating patterns, maximum consecutive days, and a monthly minimum of weekends off. If the rule is normal, breaking it adds a penalty. If the rule is a Must rule, the scheduler treats it as a hard constraint.
If too many rules are marked as Must rules, the schedule can become impossible to fill. A strict set of hard constraints may leave open shifts unassigned because the scheduler is not allowed to break any of them.
Why Rule Order Matters For Penalties
Rule order matters for normal rules because normal rules are soft rules.
When normal rules conflict, Shift Scheduler uses penalties to decide which roster is better. A roster that breaks an important normal rule receives a stronger penalty than a roster that breaks a lower priority normal rule.
You control this priority by dragging normal rules into order.
For example, suppose these normal rules are listed in this order:
Nobody should work more than 5 consecutive days.Anna don't want friday shifts if not necessary.
If the scheduler cannot satisfy every preference at once, it will try harder to protect the consecutive-days rule than Anna's friday preference, because the consecutive-days rule is higher in the rule order.
What Makes A Good Scheduling Rule
A good scheduling rule is specific, testable, and realistic.
Use this checklist:
- One rule should describe one scheduling idea.
- Mention the person, group, shift type, location, or date when it matters.
- Use numbers when the limit is numeric.
- Use Must rule only when breaking the rule is unacceptable.
- Avoid vague words when a clearer limit is possible.
Good rules help the scheduler make the same kind of decision a manager would make.
Weak rules make the system guess.
Weak Rules Rewritten As Good Rules
| Weak rule | Better rule |
|---|---|
Do not overwork people. | Nobody should work more than 5 consecutive days. |
Nights are hard. | After a night shift, give the person at least one day off. |
Keep hours normal. | Try to keep each person under 40 hours per week. |
Do not put new people in bad shifts. | Do not schedule junior staff alone on closing shifts. |
Good Rules For Common Scheduling Problems
Rest And Fatigue
Use these rules when the roster should protect recovery time:
After a night shift, give the person at least one day off.Nobody should work more than 5 consecutive days.One person can't work more than 12 hours per day
Rest rules can be normal or Must rules. A normal rest rule adds a penalty when it is broken, so the scheduler can still fill a shift if coverage is tight. A Must rest rule is hard and should be used when the rest period represents law, safety, or a non-negotiable policy.
Use an explicit number of days. "Two days off after a night shift" is stored as rest.days: 2, which means both calendar dates D+1 and D+2 are kept free after a matching shift on D. The saved interpretation shown beside the rule should contain the same number as the rule text.
Fairness Is Automatic, But Allocation Fairness Can Be A Rule
Do not add broad total-hour fairness rules such as:
Balance total hours across all available people.
This usually makes no difference as a Scheduling rule. Shift Scheduler already tries to make the roster fair automatically by balancing total hours across available people and balancing shift-template mix when people can work the same templates.
You can, however, add allocation fairness for a specific set of days in the week. Use this when the problem is not total hours, but who receives work on certain days.
Examples:
Make weekend allocation fair.This balances Saturday and Sunday work.Make Friday, Saturday, Sunday allocation fair.This balances work across Friday, Saturday, and Sunday.Make allocation throughout the week fair.This balances work across Monday through Sunday.
Allocation fairness uses worked hours, not just shift count. When it is a normal Scheduling rule, its strength follows the rule's position in the rule order, so moving the rule higher makes that allocation goal more important.
An exact free-weekend quota is also supported directly. For example, use Everybody needs at least 2 weekends off per month. A complete weekend is Saturday and Sunday with no regular work shift on either day; Time Off does not count as work. A weekend belongs to the calendar month containing its Saturday, and the scheduler checks that full month even when you generate only part of it. Use allocation fairness when you want weekend work spread evenly, and use the monthly weekends-off rule when each person needs a specific minimum.
Coverage And Skills
Use these rules when a shift requires a certain person type:
Every night shift must include at least one senior employee.Do not schedule junior staff alone on closing shifts.Each weekend shift should include at least one person trained for cash handling.
Skill and safety requirements are often good Must rules. Softer staffing preferences can stay normal.
What To Do When The Roster Is Not What You Expected
If the generated roster does not match your expectation, do not assume the scheduler ignored you. Usually the rule set needs more detail, a different order, or fewer hard constraints.
Try these steps:
- Move the most important normal rule higher.
- Move less important preferences lower.
- Add a missing rule that explains the expectation.
- Split a broad rule into smaller, clearer rules.
- Rewrite vague rules with concrete limits, people, shift types, or dates.
- Mark only truly non-negotiable requirements as Must rules.
- Check whether there are enough available people to satisfy the rules.
For example, if weekends are not distributed the way you expected, add a specific allocation fairness rule:
Make weekend allocation fair.
If the issue is Friday through Sunday, use:
Make Friday, Saturday, Sunday allocation fair.
Also check whether the right people are available for those days, whether dislikes/preferences are set correctly, and whether you need a concrete rotation or staffing rule.
If someone works too many difficult shifts in a row, add or move a rule like:
Nobody should work more than 5 consecutive days.
If the scheduler assigns someone after a night shift and that should not happen, add or mark as Must:
After a night shift, give the person at least one day off.
The best workflow is iterative. Generate a roster, review the result, adjust Scheduling rules, then generate again.
Rule Order Example
Imagine you care about rest, a concrete night-shift rotation, and Anna's morning preference.
This order says rest matters most:
Nobody should work more than 5 consecutive days.Follow a day shift, night shift, two days off rotation.Prefer Anna on morning shifts when possible.
This order says Anna's preference matters more than the rotation pattern:
Nobody should work more than 5 consecutive days.Prefer Anna on morning shifts when possible.Follow a day shift, night shift, two days off rotation.
Both are valid. The better order depends on what you expect from the roster.
If your roster looks technically correct but feels wrong, the rule order is one of the first things to adjust.
FAQ
What are Scheduling rules in ShiftScheduler.ai?
Scheduling rules are saved instructions that guide AI scheduling and staff scheduling decisions. They describe roster rules such as rest limits, preferred shifts, skill requirements, rotation patterns, and other constraints.
Are normal rules the same as Must rules?
No. Normal rules are soft rules. The scheduler tries to satisfy them, but it can trade them off. Must rules are hard constraints and should be used only for requirements that cannot be broken.
Why does the order of rules matter?
Rule order matters because earlier normal rules receive stronger penalty priority. When two soft rules conflict, the scheduler tries harder to protect the rule that appears higher in the list.
Do I need to set numeric penalties?
No. You do not manually set numeric penalties in the Scheduling rules UI. You set normal rule priority by dragging rules into the right order. The numeric table below documents the internal solver scores and priorities used by Shift Scheduler.
Should I add a rule to balance hours or spread weekends fairly?
Do not add a broad total-hours rule. Shift Scheduler already balances total hours automatically, and a rule like Balance total hours across all available people usually does not change the generated roster. If you want fairness over a specific part of the week, use allocation fairness, for example Make weekend allocation fair, Make Friday, Saturday, Sunday allocation fair, or Make allocation throughout the week fair. If every person needs a guaranteed minimum instead, use a direct quota such as Everybody needs at least 2 weekends off per month.
What should I do if the roster is wrong?
Adjust the Scheduling rules. Reorder normal rules, add missing rules, make vague rules more specific, split broad rules into smaller rules, and use Must rules only for non-negotiable requirements.
What are good shift scheduling rules?
Good shift scheduling rules are specific, realistic, and easy to evaluate. A good rule says who it applies to, when it applies, and what outcome is preferred or required.
Final Advice
Start simple.
Add the rules that matter most, keep most of them as normal rules, and use the rule order to express priority. Then review the generated roster.
If the roster does not match your expectation, play with the order of rules or add more specific Scheduling rules. AI scheduling works best when your rules describe the real tradeoffs of your workplace.
Detailed Numeric Penalty Reference
Shift Scheduler uses numeric penalties and bonuses internally. A positive number makes a roster worse. A negative number is a bonus that makes a roster better. Users normally control these values indirectly through rule order, Must rules, availability, preferences, and shift setup.
| Solver item | Internal value | What it means |
|---|---|---|
| Unassigned shift | +30000 reported penalty per unfilled shift | The roster is penalized when an open shift remains unassigned. Coverage also has the strongest objective priority, so filling shifts is treated as the first major goal. |
| 1st normal Scheduling rule violation | +8000 per soft rule violation | Highest soft-rule priority. Applies to normal rest, hour, location, availability, relationship, blocked-shift, rotation, weekly alternating, max-consecutive, and monthly-weekends-off rules. |
| 2nd normal Scheduling rule violation | +6000 per soft rule violation | Strong soft-rule priority. |
| 3rd normal Scheduling rule violation | +4000 per soft rule violation | Medium soft-rule priority. |
| 4th and later normal Scheduling rule violation | +2000 per soft rule violation | Standard soft-rule priority for lower ordered normal rules. |
| Must rule | No numeric penalty | Treated as a hard constraint. The scheduler should not break it; if too many Must rules conflict, shifts may remain unassigned. |
| Disliked date preference | +1000 per assigned shift on that disliked date | Used when a person dislikes an entire date. |
| Liked date preference | -1000 per assigned shift on that preferred date | Used when a person likes an entire date. |
| Shift-specific disliked preference | +1000 per matching assigned shift | Used when a person dislikes a specific shift template on a date. |
| Shift-specific liked preference | -1000 per matching assigned shift | Used when a person likes a specific shift template on a date. |
| Total-hour fairness | sum absolute hour deviation in centihours * 1000 + max deviation in centihours | Roughly +100000 reported penalty per 1 hour of summed target deviation, plus +100 per 1 hour of max person deviation. |
| Template-mix fairness | +1 per centihour of template-mix deviation | Roughly +100 reported penalty per 1 hour of shift-template mix deviation. |
| Allocation fairness | Normal rule-order penalty per hour of allocation deviation | Uses the parent normal rule order: roughly +8000, +6000, +4000, or +2000 per 1 hour of deviation inside the requested weekday/date group. |
The reported penalty summary groups these into unfilled, fairness, preference, and pattern buckets. The pattern bucket includes soft Scheduling rule violations, including soft constraints such as rest, max hours, location eligibility, and cannot-work-with rules.
The optimizer compares rosters lexicographically:
- It first minimizes the number of unfilled shifts. A roster with better coverage wins before any fairness, preference, or soft-rule score is compared.
- Among rosters with the same best coverage, it minimizes exactly the reported total:
unfilled + fairness + preference + pattern.
There are no additional hidden multipliers on total-hour fairness, template-mix fairness, or any other reported category. At equal coverage, the roster with the lower reported total is better. Normal rule order still matters because its +8000, +6000, +4000, and +2000 penalties are already included in that total.