We are happy to announce that you can now constraint the maximum number of jobs or activities in a route. It is as simple as adding the
max_activities field like this:
In this specific example the vehicle with id “my_vehicle” cannot conduct more than two pickups or more than two services, or it cannot load more than two shipments. If you use “max_activities”, the vehicle cannot conduct more than two activities. If you deal with services, the number of services are equal to the number of activities. However, if you deal with shipments, the number of activities is equal to 2*shipments since each shipment involves two activities, i.e. pickup and delivery.
If there are jobs that cannot be assiged due to these constraints, the API responds with this:
"reason": "could not be assigned due to max job constraint"