Jobs and Objectives

Introduction to Jobs

A Job is the sequence of workflows to be executed to complete a single leg of an expected path of an order (point to point). An expected path is a path/route for the movement of the Participants and/or Containers to fulfill an order. Each segment of the route is referred to as a Job (Legs).


  1. For the order ‘Pickup shipment from location A and deliver it to location B’, the expected path could have three legs/jobs:
  1. For the order ‘Go to location B and install the refrigerator’, the expected path could have just one leg/job:

To create a Job, call the Create a new job endpoint.

Request bodies are specified in JSON format. The following examples show a request body for creating a Job:

MemberDescriptionValidationData type
jobWorkflowIdJob workflow IDminLength: 1
maxLength: 64
jobRefExternal job referenceminLength: 4
maxLength: 64
objectivesminItems: 1
objectiveRefReference ID for individual objectives.minLength: 4
maxLength: 36
location>addressAddress where the job needs to be executed.
location>geolocation>longRange of longitude is -180 to 180 and can be upto 6 decimal places.pattern: ^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$string
location>geolocation>latRange of latitude is -90 to 90 and can be upto 6 decimal places.pattern: ^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$string
contact>nameContact name.string
contact>phone>countryCodeCountry code of the mobile it belongs.pattern: ^\+(\d{1}\-)?(\d{1,3})$string
contact>phone>numberPhone number of the user.minLength: 4
maxLength: 13
contact>phone>isMobileWhether the phone is of type mobile or telephone.boolean
contact>phone>areaCode In case of type telephone, areaCode of the telephone it belongs.pattern: ^\+(\d{1}\-)?(\d{1,3})$string
jobTypeIdJob Type ID.minLength: 4
maxLength: 64
    "jobWorkflowId": "jobWorkflow:e768f61e-42bf-4aa6-8ff6-5030114d4307",
    "jobTypeId": "pickuptest:44d87031-f1f7-56b8-9a47-783dc874d2b6",
    "jobRef": "jobRef:02",
    "objectives": [
            "objectiveRef": "Pickup",
            "contact": {
                "name": "Worldlogistic",
                "phone": {
                    "countryCode": "+91",
                    "number": "9900889900",
                    "isMobile": true,
                    "areaCode": "+91"
            "location": {
                "address": {
                    "buildingNumber": "746",
                    "apartmentNumber": "1234",
                    "addressLine1": "housing board colony",
                    "addressLine2": "new housing board colony",
                    "addressLine3": "old street late",
                    "city": "pune",
                    "state": "maharashtra",
                    "zipCode": "112356",
                    "country": {
                        "code": "IND",
                        "name": "india"
                "geolocation": {
                    "lat": "86.74739",
                    "long": "24.7283"
            "input": {
                "items": [
                        "skuId": "id1"
                "title": "title1"

Attributes of a Job

A job has the following attributes:

Attribute NameData Type ExpectedPurpose
Tenant IDUUIDThe ID of the tenant to whose data domain the Job belongs.
Job ID
UUIDSystem generated ID of the Job.
Array of JSONInstruction JSON schema is as follows:

1. id: Unique ID for instruction.
2. label: Text label describing the type of instruction.
3. containers: List of containers associated with this instruction.
4. location: Location ID of the location where the instruction is to be performed.
5. contact: Name and contact phone number of the customer (a secure data ID if the real phone number is passed. Masked phone number can be passed directly).
6. timeSlot: Defines the preferred time slot for executing this instruction. Has two keys from and to which have the start & end epoch time of the time slot.
7. workflow: Workflow instance ID (Workflow instance is workflow id plus the input data for executing the workflow. The instance is stored in the Workflow service and passed as an ID here.).
8. next: Has two keys onSuccess and onFailure whose values denote the next instruction to be executed in case of current instruction success and failure respectively.
9. meta: Additional metadata related to the instruction. This is passed as it is in the meta key of the corresponding objectives in the dispatch. Can be used for any custom value that may be required by the app (e.g., special instructions etc).

To create a custom Job Attribute, call the Post attribute config for job endpoint.

Request bodies are specified in JSON format. The following examples show a request body for creating a custom Job Attribute:

MemberDescriptionValidationData type
attributesminItems: 1
nameAttribute name.minLength: 1
maxLength: 32
pattern: ^[a-zA-Z]{1,32}$
descriptionAttribute description.minLength: 0
maxLength: 256
tagsTag to be associated with the attribute.string
dataTypeData type.string, number, boolean, object, arraystring
indexeddefault: falseboolean
validationSpecifies all the validations to be performed on an attribute, when a participant of this type is created/updated.
  "attributes": [
      "name": "Job Attribute",
      "description": "Description of Job Attribute",
      "tags": [
      "dataType": "number",
      "indexed": false,
      "defaultValue": { "no" : 10 },
      "validation": {
          "range" : {
              "min" : 1,
              "max" : 50
        "required": true


An Objective is one or more execution tasks to be performed as a workflow for a Container or set of Containers at a given location.
It is possible that an objective can consist of one or more Service IDs and service IDs in turn can contain one or more Containers. For example, a warehouse pickup can have multiple service ids and associated Containers to pickup.

To complete a shipment, the operator needs to execute a sequence of Jobs (set of actions) associated with it. A Job has the following entities in it: Customer, Location, and Time Slot.

The following describes two different jobs:

  • Pick up shipment s1 from Location-A (between 9 AM & 10 AM) and Deliver to Location-B
  • Pick up shipment s2 from Location-A (between 9 AM & 10 AM) and Deliver to Location-C

If we examine these two jobs, we can see that they contain common areas such as Location-A and the Time Slot for pick-up.

Based on these common areas, we can convert these jobs into Objectives. The Objective can then be defined as a group of jobs to be performed at a particular location.

In this example of 4 different jobs are converted into objectives:

  • Job-1: Pick up shipment s1 from Location-A (between 9 AM & 10 AM) and Deliver to Location-B
  • Job-2: Pick up shipment s2 from Location-A (between 9 AM & 10 AM) and Deliver to Location-C
  • Job-3: Pick up shipment s3 from Location-D and Deliver to Location-C
  • Job-4: Pick up shipment s4 from Location-A (between 3 PM & 4 PM) and Deliver it to Location-E

These jobs are now converted into Objectives based on location & time slots:

Location-APick up shipment s1; Pick up shipment s2
Location-BDeliver shipment s1
Location-DPick up shipment s3
Location-CDeliver shipment s2; Deliver shipment s3
Location-APick up shipment s4
Location-EDeliver shipment s4



The Objectives are grouped together by the customer, location, and time slot. For simplicity of explanation, the customer part has been excluded in the above examples.

The purpose of creating Objectives is to enhance the working efficiency of operators and to eliminate areas of human errors.

Lifecycle of a Job

The platform provides a default of five states for an Objective:

  • Created: This state denotes that an Objective has been created.
  • Assigned: This state denotes that the objective has been assigned to a dispatch.
  • In-Progress: The state denotes that the Job is in progress. The event store can give the exact sub-state of this state.
  • Completed: This state denotes that the instruction list of the Job was completed by the Operator.
  • Failed: This state denotes that one of the instructions in the Job has failed. It simply states that the job the Operator had to perform wasn’t completed successfully.