Shift Breaks
When creating shifts, there are multiple strategies for dividing them.
Such as:
-
Creating shifts that mirror the exact amount of time worked (no breaks).
-
Creating shifts that span multiple days, but include breaks whenever the employee shouldn’t be working.
-
Creating shifts with intermediate durations, but include breaks for lunch or travel.
1. Defining breaks
Breaks are defined in shifts.
{
"shifts": [
{
"id": "shiftWithBreaks",
"start": "2027-02-01T09:00:00Z",
"end": "2027-02-01T17:00:00Z",
"breaks": [
{
"start": "2027-02-01T10:00:00Z",
"end": "2027-02-01T10:15:00Z"
},
{
"start": "2027-02-01T12:00:00Z",
"end": "2027-02-01T13:00:00Z"
}
]
}
]
}
Breaks have two required fields, start and end.
Validation rules for breaks:
-
The break’s
startmust be before itsend. -
The total duration of breaks during a shift must not surpass the shift’s total duration.
-
The breaks in a shift must be ordered from first to last.
-
The breaks defined on a shift must not overlap.
2. Using breaks
As mentioned before, there are multiple ways to use breaks. They come in very handy if you define long shifts but expect employees to take a certain number of breaks. The parts of the shift that are covered by breaks are not counted towards time worked.
For example, when an employee must work at most eight hours a day, and works the shifts in the code example below, then:
-
shift ais too long. It spans nine hours. -
shift bis perfect. It spans nine hours, but has a one-hour break. -
shift cis perfect. It spans nine hours, but has a 15-minute break and a one-hour break.
{
"shifts": [
{
"id": "shift a",
"start": "2027-02-01T09:00:00Z",
"end": "2027-02-01T18:00:00Z",
"breaks": []
},
{
"id": "shift b",
"start": "2027-02-01T09:00:00Z",
"end": "2027-02-01T18:00:00Z",
"breaks": [
{
"start": "2027-02-01T12:00:00Z",
"end": "2027-02-01T13:00:00Z"
}
]
},
{
"id": "shift c",
"start": "2027-02-01T09:00:00Z",
"end": "2027-02-01T18:00:00Z",
"breaks": [
{
"start": "2027-02-01T10:00:00Z",
"end": "2027-02-01T10:15:00Z"
},
{
"start": "2027-02-01T12:00:00Z",
"end": "2027-02-01T13:00:00Z"
}
]
}
]
}
Assigning multi-day shifts to a single employee
Another use case for breaks is assigning set of shifts to the same employee. For example, when the servicing of a machine requires multiple days of work, but the same employee must work on the machine and the employee may not work at night. You could define a shift spanning multiple days and include breaks for the night hours. The code example below defines a shift that spans three days, but includes two breaks for the night hours.
{
"shifts": [
{
"id": "multi-day shift with night break",
"start": "2027-02-01T09:00:00Z",
"end": "2027-02-03T17:00:00Z",
"breaks": [
{
"start": "2027-02-01T17:00:00Z",
"end": "2027-02-02T09:00:00Z"
},
{
"start": "2027-02-02T17:00:00Z",
"end": "2027-02-03T09:00:00Z"
}
]
}
]
}
|
Keep in mind that the breaks only work with 'minutes worked' constraints and are not supported by other constraints, e.g. days or weekends worked constraints. |
Next
-
See the full API spec or try the online API.
-
Learn more about employee shift scheduling from our YouTube playlist.