Clean recertification workflow tasks in bulk

Resolved

Hi,

I have a case where I want to clean many unwanted recertifications workflow tasks in bulk through API.

I was able to retrieve the full list of task instances, but now I don't know how to clean them.

Questions

  • Can I do a "Cancel workflow" operation through API ? What will be the consequence on the recertification of the role ?

  • Or should I "Approve" the workflow through API, and accept to see this in the recertification history ?

  • What are the API calls to make such operations, and are the processId and rootProcessId enough to do it ?

Request example

POST : {{memority_apiGuard_path}}/bum/workflow-user-tasks
Body : 
{
  "taskId": {
    "workflowId": "role-recertification-oneStep-workflow",
    "taskId": "step1-userTask"
  },
  "technicalAdmin": true
}

Reponse example :

{
        "id": "75141",
        "taskId": "step1-userTask",
        "createdAt": "2025-10-22T15:27:50.717Z",
        "dueDate": null,
        "processId": "75137",
        "rootProcessId": "75137",
        "businessKey": {
          "type": "FEATURE_EXECUTION",
          "value": "7cc1c67b-1630-4539-bd67-bcb6ab9ef1cf"
        }
}

I remain available for any additionnal information.

Regards,

Logan.

Workflow, APIs
1 reply
Best reply by Logan COQUERANT

Hi,

After doing some testing, the right way would be to perform an "Approve workflow", because the "Cancel workflow" will also add trace into the recertification history saying the certification was refused, even though the role is not unassigned.

Here is the informations to perform the validation :

POST {{memority_apiGuard_path}}/bum/workflow-user-task/~complete/:taskId
BODY : 
{
    "@type": "ROLE_ASSIGNMENT_OPERATION_EXECUTION",
    "roleAssignmentChanges": {
        "enabledFrom": null,
        "enabledUntil": null,
        "comment": null,
        "dimensions": {}
    },
    "fields": [],
    "comment": "Validation en masse suite au lancement par erreur de la recertification"
}

Regards,

Logan.

View original