Orchestrating Human Tasks with Conductor
Human tasks are used when you need to pause your workflow for an interaction from a human. When your workflow reaches the human task, it waits for a manual interaction to proceed with the workflow.
It can be leveraged in situations where forms need to be used within an application, such as approval workflows.
To support human involved tasks, Conductor offers a set of features:
- Templates: Used to build forms that can be hosted in Conductor UI
- Human Tasks API: Suite of APIs to manage the lifecycle of Human tasks connected to Conductor workflows
Human Task Lifecycle
The diagram below shows the lifecycle of a human task. When using the APIs, we are basically moving between states as required by the business application. State changes also happen when the policies kick in for timeouts, assignments, or escalations.
- When tasks are complete, workflows will move forward, and tasks are no longer editable.
- When tasks time out, the workflows will be marked as failed. Upon retry - a new task will be created that will start from the PENDING state.
Human Task Triggers
Upcoming feature. Using triggers that can be attached to state changes or time, we can run additional workflows to supplement the human action. This is useful for notifications and other aspects.
More details coming soon...
Creating Templates
Conductor has a feature to compose and host forms that can be used in the Conductor UI application.
A template is to be created only if the forms are hosted within your Conductor console.
If your forms are to be hosted on any external system, you can simply add a blank template where one of the input parameters can be used to indicate that form is an external form.
To create a template from Conductor UI,
- From the left menu, navigate to INBOX > Template builder.
- Click Create New Template.
- Provide a name for the template.
- Create the template based on your requirements by dragging and dropping the available components from Conductor UI.
- While adding the components, you have the provision to make the fields mandatory by checking the required button.
When creating a template as a proxy for an externally hosted form, we can add an empty form with just one field. And when this template is attached to the workflow, we can add the external reference to this task on it. The UI application that then reads this human task can determine that this is an external form and then load the corresponding UI form.
- Under Layout Configuration, you can provide a Layout label that would be visible at the beginning of the layout.
- Once the template is created, you can have a preview of the template by clicking on the Preview button.
Defining Workflows with Human Tasks
To define a workflow from Conductor UI,
- Navigate to WORKFLOWS > Definitions from the left menu
- Click Define Workflow, provide a workflow name and add a Human Task
- You can have as many human tasks in whichever steps as required
The human task needs to be configured with the following parameters:
Human Task Parameters
Parameter | Description |
---|---|
Assignment Policy | Choose the policy through which the human task is to be assigned. It can take the following values:
|
Task Owners | Select the task owner for the human task. The task owner grants permission to perform a human task. Choose the users/applications in Conductor who should own the task. In most situations, applications created in Conductor will retrieve tasks via APIs. In such cases, you can add the required application as a task owner. Note: By default, the Conductor Admin can access all the human tasks. |
Timeout Policy | Indicates the condition at which the task should be timed out. It can take the following values:
|
UI Template | Choose the template we have created previously here. Similar to workflows, the templates can also have different versions. You can also choose the required version. The inputs to the template can be parameterized from here. |
- Save the workflow definition.
Executing Workflow
Now, you can run the workflow from the Conductor UI.
Steps to Run Workflow from UI
- From the left menu, click Run Workflow.
- Choose the workflow to run and provide any input parameters if defined.
- Click Run Workflow.
- Once the workflow is run, click on the workflowID generated.
- The task would be in the RUNNING state.
Completing Human Task
Once your workflow execution is initiated, navigate to INBOX > Tasks. Here, the human task would be listed.
You can view the human task details, such as the workflow it is part of, state, assignment policy, and assignee.
The task owner/assignee can claim the task. To do this:
- Click on the task ID & you can view the form details.
- Click Claim.
Once claimed, you can update or complete the task. In addition, you can release the task to remove your assignment so that someone else can claim the task.
Once the task is completed from here, the workflow gets completed.
Have a look at Human Task APIs here.