How to: Manage Job Workflow

For information about prerequisites, see Integrate with Dispatch.

Create a Job Workflow

To create a Job Workflow, call the Create Job Workflow endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
nameJob Workflow name.string
minLength= 1 and maxLength= 24 Pattern: ^[a-zA-Z0-9- _]{1,24}$.
startThis is the starting objective reference.string
minLength= 4 and maxLength= 36
objectives > objectiveRefReference IDs for individual objectives.string
minLength= 4 and maxLength= 36
objectives > workflowWorkflow ID.string
minLength= 1 and maxLength= 64
objectives > next > codeEvent or Reason Code.string
minLength= 4 and maxLength= 36
objectives > next > nextObjectiveReference ID for individual objectives or END for the last state.string
minLength= 4 and maxLength= 36

The request body should be similar to the following:

{
   "name":  “TestJobWorkflow”,
   "start": "Pickup",
   "objectives": [
       {
           "objectiveRef": "Pickup",
           "workflow": "workflow:813d56f2-c9ce-5741-9536-895e6be5a88b",
           "next": [
               {
                   "code": "A",
                   "nextObjective": "END_STATE"
               }
           ]
       }
   ]
}

Retrieve Job Workflow by Job Workflow ID

To retrieve a Job Workflow call the Get Job Workflow endpoint and specify the jobWorkflowId in the path parameter.

Update Job Workflow status

To update the status of a Job Workflow, call the Update Job Workflow Status endpoint and pass the following member in the request body:

MemberDescriptionRemarks
statusThis is the Job Workflow status.It can have one of the possible values: Active and Inactive.

Also, specify the jobWorkflowId in the path parameter.

The JSON request body should be similar to the following:

{
  "status": "ACTIVE"
}