Skip to main content

Break Management

Breaks are essential for driver safety, legal compliance, and operational efficiency. This guide covers how to configure various break types, locations, and timing constraints in your routing optimization.

Break Configuration Basics

Breaks are defined within resource shifts:
{
  "resources": [
    {
      "name": "driver-1",
      "shifts": [{
        "from": "2024-03-15T08:00:00Z",
        "to": "2024-03-15T17:00:00Z",
        "breaks": [
          {
            "type": "WINDOWED",
            "from": "2024-03-15T12:00:00Z",
            "to": "2024-03-15T13:00:00Z",
            "duration": 3600  // 1 hour break
          }
        ]
      }]
    }
  ],
  "jobs": [
    {
      "name": "delivery-1",
      "duration": 1800
    }
  ]
}

Break Types

Windowed Breaks

Can occur flexibly within a time window:
{
  "breaks": [
    {
      "type": "WINDOWED",
      "from": "2024-03-15T12:00:00Z",
      "to": "2024-03-15T13:00:00Z",
      "duration": 3600  // Break duration in seconds
    }
  ]
}

Flexible Windowed Breaks

Flexible timing within a wider window:
{
  "breaks": [
    {
      "type": "WINDOWED",
      "from": "2024-03-15T11:00:00Z",
      "to": "2024-03-15T14:00:00Z",
      "duration": 2700  // 45 minutes anytime in window
    }
  ]
}

Drive Breaks

Reset continuous driving time:
{
  "breaks": [
    {
      "type": "DRIVE",
      "driveTime": 16200,  // After 4.5 hours driving
      "duration": 2700      // 45 minutes break
    }
  ]
}

Duty Breaks

Trigger a break after cumulative work time — the combined total of driving time and service time. Unlike drive breaks which only count time behind the wheel, duty breaks account for all active work performed by the resource.
{
  "breaks": [
    {
      "type": "DUTY",
      "workTime": 19800,  // After 5.5 hours of total work
      "duration": 1800     // 30 minutes break
    }
  ]
}
Work time calculation: Work time includes driving time and service time (job durations). It does not include waiting time from time windows, break time, or synchronization delays.

Unavailability Breaks

Mark resource as unavailable:
{
  "breaks": [
    {
      "type": "UNAVAILABILITY",
      "from": "2024-03-15T14:00:00Z",
      "to": "2024-03-15T15:00:00Z"
    }
  ]
}

Break Locations

Location Options

{
  "type": "WINDOWED",
  "from": "2024-03-15T11:00:00Z",
  "to": "2024-03-15T14:00:00Z",
  "duration": 1800
}
Break can be taken anywhere
Location Impact:
  • ANY: No travel time, taken at current location
  • Specific location: Travel time to break location

Deducting Previous Breaks

When a shift includes multiple breaks, you can use deductPreviousBreaks to reduce a break’s effective duration by the total time already spent on earlier breaks. This is useful when regulations require a total rest period that can be split across multiple shorter breaks throughout the shift.
{
  "breaks": [
    {
      "type": "WINDOWED",
      "from": "2024-03-15T10:00:00Z",
      "to": "2024-03-15T10:30:00Z",
      "duration": 900
    },
    {
      "type": "DUTY",
      "workTime": 21600,
      "duration": 2700,
      "deductPreviousBreaks": true
    }
  ]
}
In this example, the duty break has a base duration of 45 minutes (2700 seconds). Because deductPreviousBreaks is true, the 15-minute windowed break taken earlier is subtracted, resulting in an effective duty break of only 30 minutes.
How deduction works: When deductPreviousBreaks is true, the effective break duration is calculated as:effective duration = max(0, break duration − sum of all prior break durations)If prior breaks already meet or exceed the configured duration, the effective duration becomes zero — the break is still tracked but adds no extra idle time.
The deductPreviousBreaks option is available on all trigger-based break types:
Break typeFieldDefault
WINDOWEDdeductPreviousBreaksfalse
DRIVEdeductPreviousBreaksfalse
DUTYdeductPreviousBreaksfalse

Break Timing Constraints

Break Before Finish

Ensure breaks complete before shift end:
{
  "shifts": [{
    "from": "2024-03-15T08:00:00Z",
    "to": "2024-03-15T17:00:00Z",
    "breakBeforeFinish": 7200,  // 2 hours before shift end
    "breaks": [{
      "type": "WINDOWED",
      "from": "2024-03-15T11:00:00Z",
      "to": "2024-03-15T15:00:00Z",  // Must finish by 15:00
      "duration": 3600
    }]
  }]
}

Multiple Breaks Example

{
  "shifts": [{
    "from": "2024-03-15T06:00:00Z",
    "to": "2024-03-15T18:00:00Z",
    "breaks": [
      {
        "type": "WINDOWED",
        "from": "2024-03-15T09:00:00Z",
        "to": "2024-03-15T10:30:00Z",
        "duration": 900,  // 15-minute morning break
        "location": "ANY"
      },
      {
        "type": "WINDOWED",
        "from": "2024-03-15T11:30:00Z",
        "to": "2024-03-15T13:30:00Z",
        "duration": 3600,  // 1-hour lunch
        "location": "DEPOT"
      },
      {
        "type": "WINDOWED",
        "from": "2024-03-15T15:00:00Z",
        "to": "2024-03-15T16:30:00Z",
        "duration": 900,  // 15-minute afternoon break
        "location": "ANY"
      }
    ]
  }]
}

Integration with Resumable Jobs

Breaks can interrupt long service jobs:
{
  "jobs": [
    {
      "name": "installation",
      "duration": 14400,  // 4 hours
      "resumable": true   // Can be paused for breaks
    }
  ],
  "resources": [{
    "name": "driver-1",
    "shifts": [{
      "from": "2024-03-15T08:00:00Z",
      "to": "2024-03-15T17:00:00Z",
      "breaks": [{
        "type": "FIXED",
        "from": "2024-03-15T12:00:00Z",
        "to": "2024-03-15T13:00:00Z"
      }]
    }]
  }]
}
Result: Installation runs 8:00-12:00 (4 hours), break 12:00-13:00, resumes 13:00 to completion

Complex Break Scenarios

EU driving regulations with both drive and duty breaks:
{
  "resources": [{
    "name": "long-haul-driver",
    "maxDriveTimeInSeconds": 16200,  // 4.5 hours
    "shifts": [{
      "from": "2024-03-15T06:00:00Z",
      "to": "2024-03-15T20:00:00Z",
      "breaks": [
        {
          "type": "DRIVE",
          "driveTime": 16200,  // After 4.5 hours driving
          "duration": 2700      // 45 minutes break
        },
        {
          "type": "DUTY",
          "workTime": 21600,    // After 6 hours total work
          "duration": 1800       // 30 minutes break
        },
        {
          "type": "WINDOWED",
          "from": "2024-03-15T11:00:00Z",
          "to": "2024-03-15T15:00:00Z",
          "duration": 3600  // Daily rest period
        }
      ]
    }]
  }],
  "jobs": [{
    "name": "long-distance-delivery",
    "duration": 1800
  }]
}
Combining DRIVE and DUTY breaks: DRIVE and DUTY breaks trigger independently. A driver with long service stops may hit the DUTY threshold before the DRIVE threshold, or vice versa. Use both when regulations limit driving time and total work time separately. Consider using deductPreviousBreaks on the later breaks to avoid over-scheduling rest when earlier breaks already count toward the required rest period.

Field Service with Breaks

{
  "resources": [{
    "name": "technician",
    "shifts": [{
      "from": "2024-03-15T08:00:00Z",
      "to": "2024-03-15T17:00:00Z",
      "start": {"latitude": 52.520, "longitude": 13.405},
      "breaks": [
        {
          "type": "WINDOWED",
          "from": "2024-03-15T10:00:00Z",
          "to": "2024-03-15T10:30:00Z",
          "duration": 900
        },
        {
          "type": "WINDOWED",
          "from": "2024-03-15T12:00:00Z",
          "to": "2024-03-15T14:00:00Z",
          "duration": 2700
        }
      ]
    }]
  }],
  "jobs": [{
    "name": "service-1",
    "duration": 3600
  }]
}

Best Practices

1

Plan for Travel Time

Depot breaks require round-trip travel time - position routes accordingly
2

Use Flexible Windows

Windowed breaks give solver more optimization options than fixed breaks
3

Consider Job Locations

“ANY” location breaks avoid unnecessary travel
4

Account for Regulations

Implement legal break requirements as hard constraints

Break Impact on Routes

The solver automatically:
  • Schedules breaks within allowed windows
  • Triggers duty breaks when cumulative work time exceeds the threshold
  • Triggers drive breaks when cumulative driving time exceeds the threshold
  • Adds travel time for depot/specific location breaks
  • Splits resumable jobs around breaks
  • Ensures breaks don’t violate time windows
  • Optimizes break placement to minimize disruption
Common Issues:
  • Insufficient time for depot breaks including travel
  • Break windows conflicting with job time windows
  • Too many fixed breaks reducing flexibility

Performance Considerations

Low Impact:
  • Single break per shift
  • “ANY” location breaks
  • Wide time windows
Medium Impact:
  • Multiple breaks per shift
  • Depot return requirements
  • Moderate time windows
High Impact:
  • Many fixed-time breaks
  • Specific break locations
  • Tight break windows
  • Multiple driving and duty breaks combined

Troubleshooting

Causes:
  • Break window too restrictive
  • Insufficient time in shift
  • Travel time to break location too long
Solutions:
  • Widen break windows
  • Use “ANY” location when possible
  • Verify shift duration accommodates all breaks
Causes:
  • Fixed breaks at suboptimal times
  • Depot breaks causing excessive travel
Solutions:
  • Use windowed breaks for flexibility
  • Consider multiple smaller breaks
  • Place depot breaks strategically
Causes:
  • Non-resumable jobs conflicting with breaks
  • Poor break window alignment
Solutions:
  • Make long jobs resumable
  • Adjust break windows
  • Use job relations to control scheduling

Shift Management

Configure shifts and working hours

Resumable Jobs

Jobs that can be paused for breaks

Drive Time Limits

Legal driving time restrictions

Time Windows

Coordinate breaks with job timing