> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solvice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Resumable Jobs

> Enable jobs to be interrupted by breaks and resumed afterward

# Resumable Jobs

Resumable jobs allow long-duration tasks to be interrupted by scheduled breaks and then resumed, ensuring both task completion and compliance with break requirements. This feature is essential for managing lengthy service appointments alongside mandatory rest periods.

## Overview

The resumable jobs feature enables:

* Jobs to be paused during resource breaks
* Automatic resumption after breaks complete
* Better utilization of available working time
* Compliance with break regulations without sacrificing long jobs

## Basic Configuration

### Making Jobs Resumable

Set the `resumable` flag on jobs that can be interrupted:

```json theme={null}
{
  "jobs": [
    {
      "name": "installation-project",
      "location": {"latitude": 52.520, "longitude": 13.405},
      "duration": 14400,  // 4 hours
      "resumable": true   // Can be interrupted by breaks
    },
    {
      "name": "quick-repair",
      "location": {"latitude": 52.523, "longitude": 13.401},
      "duration": 1800,   // 30 minutes
      "resumable": false  // Must be completed without interruption (default)
    }
  ],
  "resources": [
    {
      "name": "technician-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 lunch break
        }]
      }]
    }
  ]
}
```

<Info>
  **Default Behavior**: Jobs are non-resumable by default (`resumable: false`). Only explicitly mark jobs as resumable when interruption is acceptable.
</Info>

## How Resumable Jobs Work

### Break Interruption Process

<Steps>
  <Step title="Job Starts">
    Technician begins the resumable job at scheduled time
  </Step>

  <Step title="Break Time Arrives">
    When break window is reached, current job is paused
  </Step>

  <Step title="Break Taken">
    Resource takes the scheduled break (at depot or current location). If the unavailability break defines a `start`/`end` location, the travel from the job to the break's `start` location and back from its `end` location is added to the job's duration.
  </Step>

  <Step title="Job Resumes">
    After break completion, job automatically resumes where it left off
  </Step>

  <Step title="Job Completes">
    Remaining duration is completed after the break
  </Step>
</Steps>

### Example Timeline

For a 4-hour resumable job with a 1-hour lunch break:

```
08:00 - Arrive at job location
08:00 - Start 4-hour installation (resumable)
12:00 - Pause job for lunch break (4 hours completed)
12:00 - Take lunch break
13:00 - Resume installation
13:00 - Complete installation
13:00 - Available for next job
```

## Use Cases

### Long Service Appointments

Handle extended service calls with mandatory breaks:

```json theme={null}
{
  "jobs": [
    {
      "name": "server-room-upgrade",
      "duration": 21600,  // 6 hours
      "resumable": true,
      "windows": [{
        "from": "2024-03-15T08:00:00Z",
        "to": "2024-03-15T18:00:00Z"
      }]
    }
  ],
  "resources": [{
    "name": "it-specialist",
    "shifts": [{
      "from": "2024-03-15T08:00:00Z",
      "to": "2024-03-15T18:00:00Z",
      "breaks": [
        {
          "type": "WINDOWED",
          "from": "2024-03-15T10:00:00Z",
          "to": "2024-03-15T10:30:00Z",
          "duration": 900  // 15-min morning break
        },
        {
          "type": "WINDOWED",
          "from": "2024-03-15T12:00:00Z",
          "to": "2024-03-15T13:00:00Z",
          "duration": 3600  // 1-hour lunch
        },
        {
          "type": "WINDOWED",
          "from": "2024-03-15T15:00:00Z",
          "to": "2024-03-15T15:30:00Z",
          "duration": 900  // 15-min afternoon break
        }
      ]
    }]
  }]
}
```

### Construction and Installation

Manage multi-hour installations with regulated breaks:

```json theme={null}
{
  "jobs": [
    {
      "name": "kitchen-installation",
      "duration": 18000,  // 5 hours
      "resumable": true,
      "tags": [{"name": "installation", "hard": true}]
    },
    {
      "name": "appliance-delivery",
      "duration": 1200,   // 20 minutes
      "resumable": false  // Quick task, don't interrupt
    }
  ]
}
```

### Healthcare Services

Extended patient care with mandatory rest periods:

```json theme={null}
{
  "jobs": [
    {
      "name": "home-care-visit",
      "duration": 10800,  // 3 hours
      "resumable": true,
      "priority": 100
    }
  ],
  "resources": [{
    "name": "caregiver",
    "shifts": [{
      "from": "2024-03-15T08:00:00Z",
      "to": "2024-03-15T16:00:00Z",
      "breaks": [{
        "type": "WINDOWED",
        "from": "2024-03-15T11:00:00Z",
        "to": "2024-03-15T12:00:00Z",
        "duration": 1800  // 30-min break
      }]
    }]
  }]
}
```

## Interaction with Break Types

### Windowed Breaks

Most flexible - solver optimizes when to interrupt:

```json theme={null}
{
  "breaks": [{
    "type": "WINDOWED",
    "from": "2024-03-15T11:00:00Z",
    "to": "2024-03-15T14:00:00Z",
    "duration": 3600
  }]
}
```

### Drive Breaks

Interrupts based on accumulated driving time:

```json theme={null}
{
  "breaks": [{
    "type": "DRIVE",
    "driveTime": 16200,  // After 4.5 hours driving
    "duration": 2700     // 45-minute break
  }]
}
```

### Unavailability Breaks

Resource completely unavailable - resumable jobs pause:

```json theme={null}
{
  "breaks": [{
    "type": "UNAVAILABILITY",
    "from": "2024-03-15T13:00:00Z",
    "to": "2024-03-15T14:00:00Z"
  }]
}
```

## Best Practices

<Steps>
  <Step title="Identify Interruptible Work">
    Only mark jobs resumable if the work can actually be paused safely
  </Step>

  <Step title="Consider Customer Impact">
    Ensure customers are aware that service may include break periods
  </Step>

  <Step title="Set Realistic Durations">
    Account for any setup/cleanup time needed when resuming
  </Step>

  <Step title="Combine with Time Windows">
    Use time windows to ensure resumable jobs fit within acceptable hours
  </Step>
</Steps>

## Common Scenarios

### Mixed Job Types

Combine resumable and non-resumable jobs:

```json theme={null}
{
  "jobs": [
    {
      "name": "emergency-repair",
      "duration": 2700,
      "resumable": false,  // Cannot interrupt emergency work
      "priority": 100
    },
    {
      "name": "preventive-maintenance",
      "duration": 14400,
      "resumable": true,   // Can pause for breaks
      "priority": 50
    }
  ]
}
```

### Multiple Break Interruptions

Long jobs interrupted by multiple breaks:

```
08:00 - Start 8-hour project (resumable)
10:00 - First break (15 min)
10:15 - Resume project
12:30 - Lunch break (1 hour)  
13:30 - Resume project
15:30 - Afternoon break (15 min)
15:45 - Resume project
17:45 - Complete project
```

## Constraints and Behavior

<Warning>
  **Important Considerations**:

  * Non-resumable jobs cannot be scheduled if they would conflict with mandatory breaks
  * Break travel time (if returning to depot) is added to the total time
  * Jobs can be resumed multiple times if interrupted by multiple breaks
</Warning>

<Info>
  **Solver Behavior**:

  * Automatically calculates optimal break placement for resumable jobs
  * Ensures breaks don't violate job time windows
  * Minimizes total completion time including break interruptions
</Info>

## Performance Impact

Resumable jobs add complexity to route optimization:

| Factor                 | Impact          |
| ---------------------- | --------------- |
| Few resumable jobs     | Minimal impact  |
| Many resumable jobs    | Moderate impact |
| Complex break patterns | Higher impact   |
| Tight time windows     | Highest impact  |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Job Not Scheduled Despite Being Resumable">
    **Causes**:

    * Time window too tight for job + breaks
    * Break location adds too much travel time
    * Other constraints preventing assignment

    **Solutions**:

    * Widen job time windows
    * Use "ANY" location breaks
    * Check for conflicting constraints
  </Accordion>

  <Accordion title="Inefficient Break Placement">
    **Causes**:

    * Fixed break times not optimal
    * Too many short breaks

    **Solutions**:

    * Use windowed breaks for flexibility
    * Consolidate multiple short breaks
    * Review break necessity
  </Accordion>

  <Accordion title="Customer Dissatisfaction">
    **Causes**:

    * Unexpected service interruption
    * Extended total service time

    **Solutions**:

    * Communicate break policy upfront
    * Schedule resumable jobs early in shift
    * Consider customer preferences
  </Accordion>
</AccordionGroup>

## Integration Examples

### With Job Complexity

Balance complex resumable work:

```json theme={null}
{
  "jobs": [
    {
      "name": "complex-installation",
      "duration": 14400,
      "resumable": true,
      "complexity": 8  // High complexity work
    }
  ]
}
```

### With Rankings

Assign resumable jobs to preferred resources:

```json theme={null}
{
  "jobs": [
    {
      "name": "vip-service",
      "duration": 10800,
      "resumable": true,
      "rankings": [
        {"name": "senior-tech", "ranking": 1}
      ]
    }
  ]
}
```

## Related Features

<CardGroup cols={2}>
  <Card title="Break Management" icon="coffee" href="/guides/vrp/features/break-management">
    Configure various break types and rules
  </Card>

  <Card title="Time Windows" icon="clock" href="/guides/vrp/features/time-scheduling-advanced">
    Coordinate job timing with breaks
  </Card>

  <Card title="Job Complexity" icon="brain" href="/guides/vrp/features/job-complexity">
    Balance workload with resumable jobs
  </Card>

  <Card title="Advanced Constraints" icon="shield" href="/guides/vrp/features/advanced-constraints">
    Additional scheduling constraints
  </Card>
</CardGroup>
