Shift Scheduler Blog

How to Use Scheduling Rules in Shift Scheduler

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 typeBest useHow it behaves
Normal rulePreferences, business preferences, preferred patternsTreated as a soft rule. The scheduler tries to satisfy it, but may break it if another higher priority goal matters more.
Must ruleLegal requirements, safety requirements, true business blockersTreated 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, and maximum consecutive days. 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:

  1. Nobody should work more than 5 consecutive days.
  2. 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 ruleBetter 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

Do not add broad fairness rules such as:

  • Spread weekend shifts fairly across the team.
  • Balance total hours across all available people.

These requests usually make no difference as Scheduling rules. 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.

The current solver does not support a separate natural-language rule for weekend fairness. If weekend results are not what you expected, check availability, time off, person preferences, shift templates, and concrete rotation rules instead of adding a broad "spread weekends fairly" rule.

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:

  1. Move the most important normal rule higher.
  2. Move less important preferences lower.
  3. Add a missing rule that explains the expectation.
  4. Split a broad rule into smaller, clearer rules.
  5. Rewrite vague rules with concrete limits, people, shift types, or dates.
  6. Mark only truly non-negotiable requirements as Must rules.
  7. Check whether there are enough available people to satisfy the rules.

For example, if weekends are not distributed the way you expected, a broad rule like this will not add a new fairness constraint:

Spread weekend shifts fairly across the team.

Instead, check whether the right people are available for weekend shifts, whether weekend 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:

  1. Nobody should work more than 5 consecutive days.
  2. Follow a day shift, night shift, two days off rotation.
  3. Prefer Anna on morning shifts when possible.

This order says Anna's preference matters more than the rotation pattern:

  1. Nobody should work more than 5 consecutive days.
  2. Prefer Anna on morning shifts when possible.
  3. 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?

No, not as a broad Scheduling 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. Weekend fairness is not a separate natural-language rule today, so use availability, time off, preferences, shift templates, or concrete rotation rules when weekend assignments need to change.

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 itemInternal valueWhat it means
Unassigned shift+10000 reported penalty per unfilled shiftThe 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 violationHighest soft-rule priority. Applies to normal rest, hour, location, availability, relationship, blocked-shift, rotation, weekly alternating, and max-consecutive rules.
2nd normal Scheduling rule violation+6000 per soft rule violationStrong soft-rule priority.
3rd normal Scheduling rule violation+4000 per soft rule violationMedium soft-rule priority.
4th and later normal Scheduling rule violation+2000 per soft rule violationStandard soft-rule priority for lower ordered normal rules.
Must ruleNo numeric penaltyTreated 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 dateUsed when a person dislikes an entire date.
Liked date preference-1000 per assigned shift on that preferred dateUsed when a person likes an entire date.
Shift-specific disliked preference+1000 per matching assigned shiftUsed when a person dislikes a specific shift template on a date.
Shift-specific liked preference-1000 per matching assigned shiftUsed when a person likes a specific shift template on a date.
Total-hour fairnesssum absolute hour deviation in centihours * 1000 + max deviation in centihoursRoughly +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 deviationRoughly +100 reported penalty per 1 hour of shift-template mix deviation.

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 actual solver objective also applies priority values so some categories dominate others.

Objective componentObjective priority valueWhat it controls
Coverage / unassigned shift count2,000,000,000,000,000Makes filling open shifts the dominant objective.
Total-hour fairness500,000Makes hour fairness dominate ordinary soft preferences and pattern penalties after coverage is considered.
Template-mix fairness10,000Balances the mix of shift templates among people who can work the same template set.
Soft preferences and soft Scheduling rules1Applies liked/disliked preferences and normal Scheduling rule penalties after higher-priority objective layers.

These numbers explain why a roster can sometimes break a lower normal rule or a preference: the solver is comparing the full cost of coverage, fairness, preferences, and soft rule violations at the same time.

More from blogs