Skip to main content
In this example we will show you how to use job relations. Job relations are defined in the top-level relations array of the request. They can be used to express different links between jobs:
  • SEQUENCE: the jobs need to be visited in the given order
  • DIRECT_SEQUENCE: the jobs need to be visited in the given order, one after the other
  • SAME_TRIP: the jobs need to be visited in the same trip, the sequence does not matter
  • SAME_TIME: the jobs need to be visited at the same time, the assigned resource will be different
  • PICKUP_AND_DELIVERY: the jobs need to be in the same trip and the pickup needs to happen before the dropoff. (special case of job relation)
  • SAME_RESOURCE: the jobs need to be visited by the same resource (could be another day)
  • NEIGHBOR: the jobs must be geographically close
  • SAME_DAY: the jobs must be on the same day, meaning the calendar date the shift serving them starts on
  • GROUP_SEQUENCE: jobs with matching tags must be in sequence; jobs is required but can be an empty array, group membership comes from tags
See Job Relations for the full parameter reference, including minTimeInterval, maxTimeInterval and timeInterval.

Sequence relation

sequence

Direct Sequence relation

direct sequence

Same time relation

If there are Jobs that need multiple resources assigned to it, you should duplicate those jobs and add the requirement that they should start at the same time.
same time

Pickup and delivery relation

A very specific case of a SAME_TRIP relation in combination with a SEQUENCE relation that requires first to do the pickup and then the delivery. The shortcut is the PICKUP_AND_DELIVERY job relation for maximum two jobs, the first is the pickup, the second is the delivery.
pickup and delivery

Same trip relation

If the sequence is independent but they need to be done in the same tour or trip or day, then you can use a SAME_TRIP relation.
same trip

Same resource relation

If a job needs to be done by the same resource throughout the planning period, then set the SAME_RESOURCE relation.
same resource