Route optimization for field service: skills, shifts and breaks
How to model technicians in a route optimization API: skills that gate which jobs a person can do, shifts as vehicle time windows, breaks, daily job caps and travel limits, with a request you can test.
A field technician is a vehicle with rules. She can only fix boilers if she holds the gas certificate. She starts at 08:00 and must be off the road by 17:00. She needs 30 minutes for lunch between 12:00 and 14:00. She should not drive for more than two hours in a day, and she can do at most eight jobs. Many scheduling tools handle these rules as a list of special cases. A route optimization API handles them as data, so the same request shape can plan a plumber, an elevator engineer or a pest-control van.
This post shows how each rule maps to a field in the Argamin optimize request, with an example you can run. The numbers in any response are illustrative.
Skills: who can do what
A skills array on a vehicle lists what that technician can do. A skills array on a job or shipment lists what the job needs. The rule is strict: a vehicle can serve a stop only if every skill on the stop is in the vehicle’s list.
{ "vehicles": [ { "id": "tech-ana", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["gas-safe", "boiler"] }, { "id": "tech-ben", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["boiler"] } ], "jobs": [ { "id": "job-boiler-service", "location": { "lat": 51.5155, "lng": -0.0922 }, "service": 3600, "skills": ["gas-safe", "boiler"] }, { "id": "job-radiator-bleed", "location": { "lat": 51.4613, "lng": -0.1156 }, "service": 900, "skills": ["boiler"] } ]}Here tech-ana can take either job, and tech-ben can only take the radiator. If the boiler job required gas-safe and no vehicle had it, the job would come back in unassigned with the reason SKILL. That is the right outcome: it tells the dispatcher to hire, train or reassign, instead of sending someone who is not qualified.
Keep skill names short and stable. A typo such as gassafe in one place and gas-safe in another produces a SKILL failure that looks like a logic problem, when it is really a data problem.
Shifts: the vehicle time window
A technician’s working day is the vehicle’s time_window. Times are ISO 8601 with an offset. The optimizer does not plan work before the shift starts or after it ends. A job whose own time window cannot fit inside the shift comes back as unassigned with the reason TIME_WINDOW.
{ "id": "tech-ana", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["gas-safe", "boiler"], "time_window": { "start": "2026-11-27T08:00:00Z", "end": "2026-11-27T17:00:00Z" }}Use end to say where the technician finishes. If she goes home from the last job, leave end out. If she returns to the depot to load parts, set end to the depot’s location.
Breaks: a lunch window with a fixed length
A break is a list of time windows and a duration in seconds. The optimizer places the break inside one of the windows and counts it in the route.
{ "id": "tech-ana", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["gas-safe", "boiler"], "time_window": { "start": "2026-11-27T08:00:00Z", "end": "2026-11-27T17:00:00Z" }, "breaks": [ { "id": "lunch", "time_windows": [{ "start": "2026-11-27T12:00:00Z", "end": "2026-11-27T14:00:00Z" }], "duration": 1800 } ]}duration is an integer in seconds, so 30 minutes is 1800. Give the break more than one window if the technician can take it on either side of a long job.
Daily limits: jobs and driving time
Two fields keep a technician’s day realistic:
max_taskscaps the number of stops on a route. Set it to the number you can really do in a day. A value of8means at most eight stops for that vehicle.max_travel_timecaps the driving time of a route, in seconds. A value of7200means two hours of driving at most.
Both are optional. If you use a cap that is too tight, the affected stops show up in unassigned, so read that list after every run rather than assuming the caps worked.
Priorities and costs
priority on a stop, from 0 to 100, tells the optimizer which jobs to protect when the day is full. A broken heating system in winter can carry a priority of 60. A routine service can stay at 0.
costs on a vehicle shapes the trade-off between using more technicians and driving longer. fixed is the cost of using a vehicle at all. per_hour is the cost of an hour on the road, and its default is 3,600. Raise fixed when a second van is expensive, so the optimizer tries to fit the day into fewer routes first.
The whole request
Here is a complete request with two technicians, two jobs with skills, a lunch break and the daily limits. It can be sent as it is.
curl https://api.argamin.ai/v1/optimize \ -H "Authorization: Bearer $ARGAMIN_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: field-2026-11-27-london-east" \ -d '{ "vehicles": [ { "id": "tech-ana", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["gas-safe", "boiler"], "time_window": { "start": "2026-11-27T08:00:00Z", "end": "2026-11-27T17:00:00Z" }, "breaks": [ { "id": "lunch", "time_windows": [{ "start": "2026-11-27T12:00:00Z", "end": "2026-11-27T14:00:00Z" }], "duration": 1800 } ], "max_tasks": 8, "max_travel_time": 7200 }, { "id": "tech-ben", "start": { "lat": 51.5072, "lng": -0.1276 }, "skills": ["boiler"], "time_window": { "start": "2026-11-27T08:00:00Z", "end": "2026-11-27T17:00:00Z" } } ], "jobs": [ { "id": "job-boiler-service", "location": { "lat": 51.5155, "lng": -0.0922 }, "service": 3600, "skills": ["gas-safe", "boiler"], "priority": 60 }, { "id": "job-radiator-bleed", "location": { "lat": 51.4613, "lng": -0.1156 }, "service": 900, "skills": ["boiler"] } ], "options": { "geometry": false } }'The response has a routes entry for each technician who got work. Each route lists steps: a start, a job for each visit, a break for lunch if it fits, and an end. Read arrival and waiting_time on each step to check the schedule against the shift and the windows.
The unassigned list is the part to read first. An empty list means the day fits. Any entry tells you what to change: a skill to add, a shift to extend, or a job to move to another day.
Testing the plan
Before you put this into a dispatch screen:
- Build a test with a handful of real technicians and a day of real jobs. Use an
am_test_key, which is free and limited to 10 stops and 100 calls a day, so keep the test small. - Check that every technician’s skills match the jobs they are given. Read the route, not only the summary.
- Check that the lunch break sits inside its window and that
max_travel_timeis respected. - Look for
SKILLandTIME_WINDOWin the unassigned list. Those two reasons are where most field-service problems show up.
For larger days, such as a regional team with 100 technicians and 1,000 stops, use POST /optimize/jobs. The billing counts stops, not skills or breaks. For how the counting works, see the pricing explainer. For the difference between one technician and a team, see VRP vs TSP.
Compare the cost on the pricing page, or join the waitlist.