Update Human Task by Workflow ID and Task Reference
Endpoint: POST /api/human/tasks/update/taskRef
Updates a Human task's output data with form field inputs using the workflow ID and task reference name. You can optionally mark the task as complete.
The invoking user should be one of the following:
- Cluster admin
- Task owner of the Human task
- Task claimant
Query parameters
| Parameter | Description | Type | Required/ Optional |
|---|---|---|---|
| workflowId | The workflow execution ID that contains the Human task to be updated. | string | Required. |
| taskRefName | The reference name of the Human task to be updated. | string | Required. |
| complete | Whether to mark the task as complete or not. Set to false to keep the task in progress. Default is false. | boolean | Optional. |
| iteration | The iteration number if the task is inside a loop. Leave empty to update the latest iteration or if the task is not in a loop. | integer | Optional. |
Request body
Format the request as an object containing the form field inputs. The request body must match the form fields defined in the Human task, or it will fail validation.
Example
{
"formFieldName": "yourInputHere"
}
Response
Returns 200 OK if the Human task has been updated or completed successfully. Returns 404 if an invalid workflow ID or task reference name is provided.
Examples
Update a Human task’s output
Request
curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/human/tasks/update/taskRef?workflowId=ca04d4c8-027a-11f1-913a-226156badb04&taskRefName=human_ref&complete=false' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"approve": "Yes",
"comments": "lgtm"
}'
Response
Returns 200 OK, indicating that the Human task’s output has been updated successfully.
Update a Human task's output and complete the task
Request
curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/human/tasks/update/taskRef?workflowId=ca04d4c8-027a-11f1-913a-226156badb04&taskRefName=human_ref&complete=true' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"approve": "Yes",
"comments": "lgtm"
}'
Response
Returns 200 OK, indicating that the Human task’s output has been updated, and the task has been completed successfully.