Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Employee Shift Scheduling
  • Employee resource constraints
  • Shift Breaks
  • latest
    • latest
    • 1.21.x

Employee Shift Scheduling

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Use case guide
      • Planning AI concepts
      • Integration
      • Constraints
      • Understanding the API
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Planning window
      • Time zones and Daylight Saving Time (DST)
      • Tags and tag types
      • Input validation
      • Metrics and optimization goals
      • Score analysis
      • Visualizations
    • Employee resource constraints
      • Employee contracts
      • Employee availability
      • Employee priority
      • Pairing employees
      • Shift travel and locations
      • Shift Breaks
      • Employee activation
      • Work limits
        • Minutes worked per period
        • Minutes worked in a rolling window
        • Minutes logged per period
        • Days worked per period
        • Days worked in a rolling window
        • Consecutive days worked
        • Shifts worked per period
        • Shifts worked in a rolling window
        • Weekend minutes worked per period
        • Weekends worked per period
        • Weekends worked in a rolling window
        • Consecutive weekends worked
      • Time off
        • Days off per period
        • Consecutive days off per period
        • Consecutive days off in a rolling window
        • Consecutive minutes off in a rolling window
        • Shifts to avoid close to day off requests
        • Consecutive weekends off per period
      • Shift rotations and patterns
        • Shift rotations
        • Single day shift sequence patterns
        • Minimize gaps between shifts
        • Multi-day shift sequence patterns
        • Daily shift pairings
        • Overlapping shifts
        • Shift start times differences
        • Minutes between shifts
      • Shift type diversity
        • Shift tag types
        • Shift types worked per period
        • Unique tags per period
      • Fairness
        • Balance time worked
        • Balance shift count
    • Shift service constraints
      • Alternative shifts
      • Cost management
      • Demand-based scheduling
      • Mandatory and optional shifts
      • Shift assignments
      • Skills and risk factors
    • Manual intervention
    • Recommendations
    • Real-time planning
    • Real-time planning (preview)
    • Scenarios
      • Configuring labor law compliance
      • Configuring employee well-being
    • Changelog
    • Upgrade to the latest version
    • Feature requests

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
  • 2. Using breaks

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:
  1. The break’s start must be before its end.

  2. The total duration of breaks during a shift must not surpass the shift’s total duration.

  3. The breaks in a shift must be ordered from first to last.

  4. 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 a is too long. It spans nine hours.

  • shift b is perfect. It spans nine hours, but has a one-hour break.

  • shift c is 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.

  • © 2026 Timefold BV
  • Timefold.ai
  • Documentation
  • Changelog
  • Send feedback
  • Privacy
  • Legal
    • Light mode
    • Dark mode
    • System default