> ## 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.

# Multi-day work orders

> A worked V3 example: an 11-hour work order sent as one-hour pieces, which one technician finishes in order over two days, around the drive and lunch

> [!NOTE]
>
> **V3 is in beta.** General availability (GA) is planned for 1 December 2026.

An HVAC contractor in Antwerp has an 11-hour work order: an overhaul of an air-handling unit at an office in Leuven. One technician with the `hvac` skill must keep the order until it is done. It is longer than one shift.

V3 serves each job whole, on one shift. To spread an order over several days, send it as equal pieces, one job per piece, and link the pieces with relations. The solver then decides how many pieces each day takes. The response excerpts on this page are real output for the requests shown. Travel figures can change with the road data.

## The scenario

All times are local time in December 2026, written with the `+01:00` offset.

| Item | Details |
| - | - |
| Order | `ahu-overhaul`: 11 hours on site in Leuven, needs `hvac` |
| Technicians | `ines` and `joris`, both `hvac`, both based at the Antwerp workshop |
| Shifts | 7, 8 and 9 December, 08:00 to 17:00, starting and ending at the workshop |
| Lunch | A `fixed` break from 12:00 to 13:00 on every shift |

The drive takes about 51 minutes each way. A technician who leaves at 08:00 arrives at 08:51 and must stop by about 16:10 to be back by 17:00. After the lunch hour, that leaves just over six hours on site per day.

## Equal pieces, not fixed blocks

A block sized without knowing the drive leaves part of the day unused. The same order sent two ways, with the same shifts, the same relations and `break_interruptible` on every job:

| Sent as | Days used | Hours on site per day | `score.cost` |
| - | - | - | - |
| Three blocks: 4 h, 4 h and 3 h | 3 | 4, 4, 3 | 717.70 |
| Eleven pieces of 1 h | 2 | 6, 5 | 621.93 |

A 4-hour block and the 3-hour block do not fit together in one six-hour day, so each block takes its own day. One-hour pieces save the third day's round trip.

Pieces at one location add no travel between them, and each day pays `setup_duration_s` once, not once per piece. See [Travel and service time](https://docs.solvice.io/guides/vrp/v3/constraints.md#travel-and-service-time).

## How each requirement maps to the request

* **Pieces.** Eleven jobs, `ahu-overhaul-01` to `ahu-overhaul-11`, at the same `location`, with `service_duration_s: 3600` and `required_skills: [{ "name": "hvac" }]` each.
* **Lunch.** `break_interruptible: true` on each piece, so a piece that runs into the lunch break pauses and resumes at 13:00. See [Breaks during a long job](https://docs.solvice.io/guides/vrp/v3/constraints.md#breaks-during-a-long-job).
* **One technician.** A `same_vehicle` relation over all pieces. See [Relations](https://docs.solvice.io/guides/vrp/v3/constraints.md#relations).
* **No other jobs in between.** A `consecutive` relation over all pieces, in order. It applies within one route: each day's pieces run back to back.
* **In order across days.** One `time_lag` relation per neighbouring pair, from the earlier piece's departure (`"on": "departure"`) to the next piece's start. Piece 7 is never served on a day before piece 6.
* **Whole or nothing.** An `all_or_none` relation over all pieces: if the shifts cannot hold the whole order, every piece stays unassigned. Leave it out to allow a partial order.

## Solve the order

```bash theme={null}
curl -X POST https://api.solvice.io/v3/routing/solve \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "problem": {
    "jobs": [
      {"id": "ahu-overhaul-01", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-02", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-03", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-04", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-05", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-06", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-07", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-08", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-09", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-10", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true},
      {"id": "ahu-overhaul-11", "location": [4.7005, 50.8798], "service_duration_s": 3600, "required_skills": [{"name": "hvac"}], "break_interruptible": true}
    ],
    "vehicles": [
      {
        "id": "ines",
        "skills": [{"name": "hvac"}],
        "shifts": [
          {"id": "dec-07", "from": "2026-12-07T08:00:00+01:00", "to": "2026-12-07T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-07T12:00:00+01:00", "to": "2026-12-07T13:00:00+01:00"}]},
          {"id": "dec-08", "from": "2026-12-08T08:00:00+01:00", "to": "2026-12-08T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-08T12:00:00+01:00", "to": "2026-12-08T13:00:00+01:00"}]},
          {"id": "dec-09", "from": "2026-12-09T08:00:00+01:00", "to": "2026-12-09T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-09T12:00:00+01:00", "to": "2026-12-09T13:00:00+01:00"}]}
        ]
      },
      {
        "id": "joris",
        "skills": [{"name": "hvac"}],
        "shifts": [
          {"id": "dec-07", "from": "2026-12-07T08:00:00+01:00", "to": "2026-12-07T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-07T12:00:00+01:00", "to": "2026-12-07T13:00:00+01:00"}]},
          {"id": "dec-08", "from": "2026-12-08T08:00:00+01:00", "to": "2026-12-08T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-08T12:00:00+01:00", "to": "2026-12-08T13:00:00+01:00"}]},
          {"id": "dec-09", "from": "2026-12-09T08:00:00+01:00", "to": "2026-12-09T17:00:00+01:00", "start": {"location": [4.4025, 51.2194]}, "end": {"location": [4.4025, 51.2194]}, "breaks": [{"type": "fixed", "from": "2026-12-09T12:00:00+01:00", "to": "2026-12-09T13:00:00+01:00"}]}
        ]
      }
    ],
    "relations": [
      {"type": "same_vehicle", "stops": ["ahu-overhaul-01", "ahu-overhaul-02", "ahu-overhaul-03", "ahu-overhaul-04", "ahu-overhaul-05", "ahu-overhaul-06", "ahu-overhaul-07", "ahu-overhaul-08", "ahu-overhaul-09", "ahu-overhaul-10", "ahu-overhaul-11"]},
      {"type": "consecutive", "stops": ["ahu-overhaul-01", "ahu-overhaul-02", "ahu-overhaul-03", "ahu-overhaul-04", "ahu-overhaul-05", "ahu-overhaul-06", "ahu-overhaul-07", "ahu-overhaul-08", "ahu-overhaul-09", "ahu-overhaul-10", "ahu-overhaul-11"]},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-01", "on": "departure"}, "to": {"stop": "ahu-overhaul-02"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-02", "on": "departure"}, "to": {"stop": "ahu-overhaul-03"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-03", "on": "departure"}, "to": {"stop": "ahu-overhaul-04"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-04", "on": "departure"}, "to": {"stop": "ahu-overhaul-05"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-05", "on": "departure"}, "to": {"stop": "ahu-overhaul-06"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-06", "on": "departure"}, "to": {"stop": "ahu-overhaul-07"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-07", "on": "departure"}, "to": {"stop": "ahu-overhaul-08"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-08", "on": "departure"}, "to": {"stop": "ahu-overhaul-09"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-09", "on": "departure"}, "to": {"stop": "ahu-overhaul-10"}},
      {"type": "time_lag", "from": {"stop": "ahu-overhaul-10", "on": "departure"}, "to": {"stop": "ahu-overhaul-11"}},
      {"type": "all_or_none", "stops": ["ahu-overhaul-01", "ahu-overhaul-02", "ahu-overhaul-03", "ahu-overhaul-04", "ahu-overhaul-05", "ahu-overhaul-06", "ahu-overhaul-07", "ahu-overhaul-08", "ahu-overhaul-09", "ahu-overhaul-10", "ahu-overhaul-11"]}
    ]
  },
  "options": { "time_limit_s": 5 }
}'
```

## Read the response

The response has two routes, both for `ines`. `joris` is unused because `same_vehicle` keeps the order with one technician.

| Shift | Pieces | On site | Back at the workshop |
| - | - | - | - |
| `dec-07` | `ahu-overhaul-01` to `-06` | 08:51 to 15:51 | 16:39 |
| `dec-08` | `ahu-overhaul-07` to `-11` | 08:51 to 14:51 | 15:39 |

Piece 4 runs into lunch. It starts at 11:51 and ends at 13:51, and its stop reports the paused hour in `break_s`. See [Breaks in the response](https://docs.solvice.io/guides/vrp/v3/constraints.md#breaks-in-the-response).

```json theme={null}
{
  "type": "job",
  "id": "ahu-overhaul-04",
  "arrival": "2026-12-07T11:51:27+01:00",
  "service_start": "2026-12-07T11:51:27+01:00",
  "departure": "2026-12-07T13:51:27+01:00",
  "service_s": 3600,
  "break_s": 3600
}
```

To show the order as one activity per day, merge each route's run of pieces, from the first piece's `service_start` to the last piece's `departure`.

## Choosing the piece size

* **Smaller pieces fit each day more exactly.** One-hour pieces suit most days. Use 30-minute pieces when days are tight, such as a long drive or other jobs before and after the order, for orders of up to 8 hours.
* **At most 16 pieces in a `time_lag` chain.** The `time_lag` relations link the pieces into one group, and a linked group holds at most 16 tasks. For a 24-hour order, use pieces of at least 1.5 hours. Without the `time_lag` relations a chain may be longer, but its pieces are then ordered only within each day. See [Limits](https://docs.solvice.io/guides/vrp/v3/limits.md#relations).
* **Every piece is a task.** Splitting multiplies the task count against the [400-task solve limit](https://docs.solvice.io/guides/vrp/v3/limits.md#problem-size), so a week of orders for a team often needs an [async run](https://docs.solvice.io/guides/vrp/v3/runs.md).
* **Each extra day costs a round trip.** The solver favours fewer, fuller days, but a day may still take a single piece when that is cheapest. To make each extra day cost more, set `costs.per_route`. See [Vehicle count is free until you price it](https://docs.solvice.io/guides/vrp/v3/concepts/scoring-explanation.md#vehicle-count-is-free-until-you-price-it).

## Next steps

> [card] [Field service day](https://docs.solvice.io/guides/vrp/v3/examples/field-service.md)
>
> A single day with skills, loads and lunch.

> [card] [The V3 API model](https://docs.solvice.io/guides/vrp/v3/api-design.md)
>
> Every request and response field.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.