Cancel Workflow Task
Cancel an open workflow task. This endpoint supports single and multi-record workflows.
POST
/api/{version}/objects/objectworkflows/tasks/{task_id}/actions/cancelHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json or application/x-www-form-urlencoded |
Accept | application/json (default) or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{task_id} | The task id field value. |
Query Parameters
Section link for Query Parameters| Name | Description |
|---|---|
entrycriteria | Set to true to receive a structured evaluation of entry criteria violations in the response. If omitted, defaults to false. Learn more about the entry criteria evaluation response. |
Request
Section link for Requestcurl -X POST -H "Authorization: {AUTH_VALUE}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
https://myvault.veevavault.com/api/v26.3/objects/objectworkflows/tasks/7102/actions/cancelResponse
Section link for Response{
"responseStatus": "SUCCESS"
}Request: Entry Criteria Evaluation
Section link for Request: Entry Criteria Evaluationcurl -X POST -H "Authorization: {AUTH_VALUE}" \
-H "Content-Type: application/x-www-form-urlencoded" \
https://myvault.veevavault.com/api/v26.3/objects/objectworkflows/tasks/7102/actions/cancel?entrycriteria=trueResponse: Entry Criteria Evaluation
Section link for Response: Entry Criteria Evaluation{
"responseStatus": "FAILURE",
"errors": [
{
"type": "OPERATION_NOT_ALLOWED",
"message": "Record cannot be updated: Entry criteria requirement for state [in_review_state__c] failed : Payment Terms required before approving this contract"
}
],
"source_context": {
"is_nested": false,
"type": "document",
"document_id": 100,
"minor_version_number__v": 0,
"major_version_number__v": 1,
"lifecycle": "contract_management_lifecycle__c",
"target_state": "in_review_state__c"
},
"entry_criteria": [
{
"type": "field",
"message": "Payment Terms required before approving this contract.",
"field": {
"name": "payment_terms__c",
"url": "/api/v26.3/metadata/objects/documents/properties"
}
},
{
"type": "message",
"message": "Formula must be TRUE."
}
]
}Response Details
Section link for Response DetailsReturns SUCCESS if the task was canceled successfully.
If a request to cancel a workflow task results in FAILURE due to unmet entry criteria and entrycriteria=true, the response includes a structured evaluation of entry criteria violations for the affected records. Learn more about the entry criteria evaluation response.