Template constraints

How to use constraints to affect the behaviour of rota templates when generating a rota automatically.

Amelia Andrews avatar
Written by Amelia Andrews
Updated over a week ago

Constraints are a key part of templates, which are used when generating rotas automatically.

You can add a constraint to any part of a template, such as a shift set, a group or even the template itself. As templates are hierarchical by nature, a constraint will also apply to all other components that sit within the component you add it to.

Constraints are used for various reasons, such as to define the shift type of generated shifts, or to restrict which employees are eligible for the generated shifts. Simply put, they tell Rotaready's scheduling algorithms how to build the finer details of your rota.

Using constraints

Simply click options alongside a group, task or shift set, then click edit constraints. To set top-level constraints on a template itself,  use the template constraints button. 

You'll see a spanner icon wherever constraints are actively applied in your template.

Types of constraints

Staff selection

By default, everyone is eligible for a shift so long as they are available to work it. Holiday, unavailability or even working another shift, for example, are all things that prevent someone from being free.

The staff selection constraint allows you to further filter who is eligible for a shift to only those who possess certain tags. Tags are Rotaready's way of assigning skills, qualities or attributes to employees.

If more employees are eligible than required, Rotaready's in-built fairness algorithm will evenly distribute work across your workforce, taking into account rest, preferences, time of day and more.

There are four different behaviours for the staff selection constraint:

Pick fairly from all staff: this is the default behaviour.

Pick fairly from those who match any of the below tags: provide one or more tags and Rotaready will filter eligible employees to those who have at least one of the tags provided.

Pick fairly from those who match all of the below tags: provide one or more tags and Rotaready only consider an employee eligible if they have every tag provided.

Treat the below tags as pools of staff and exhaust each one in order: by providing multiple tags, Rotaready will try to find an employee who has the first tag. If nobody is available, it will look for someone who has the second tag, and so on, in the order of the tags provided. If your shift requires multiple people, and not enough have the first tag, Rotaready will assign as many as possible before moving onto the next tag.

Shift type

This sets the shift type associated with any shifts that are generated from this part of the template. It represents the type of work to be done, and defines the cost stream(s) to attribute the wage cost of the shift to.

You'll need to set a default shift type constraint on the template itself.

Preferred staff selection

This behaves the same way as the staff selection constraint, except it works in an optional, rather than mandatory, way.

After applying the staff selection constraint, if there are still more people eligible to work a shift than required, the preferred staff selection constraint is used. It will bias Rotaready's fairness algorithm towards employees possessing certain skills or attributes, again expressed through tags.


By default a generated shift will always be associated with the site/department the template is used in. This constraint is used to change that. Handy if you want to generate cover shifts automatically.

Selection consistency

If you have a shift set that requires 1 person on Monday, Wednesday and Friday, for example, Rotaready will naturally balance out the three shifts across your workforce according to its in-built fairness. This will likely result in different employees being assigned to the shifts.

If it's important to you that the same person is assigned to all three shifts, providing that they are available and eligible for all three of course, you should enable selection consistency.

Rest period

When a shift is generated, this sets a mandatory period of time after it finishes during which an employee is deemed as unavailable. They will not be able to be assigned other shifts during this time.

Did this answer your question?