Skip to main content
Nintex Community Menu Bar

I am facing a scenario where I need to terminate all workflows associated with an item if any of the approvers rejects the request. Currently, we have a parent workflow that initiates multiple component workflows. Each component workflow includes several approval steps, and upon the completion of each, it updates a specific SharePoint column to confirm completion.

The requirement is to terminate all running workflows on the item if any approver rejects a request in any of the component workflows. Is there a mechanism to track and store all workflow instance IDs in the same SharePoint list or a different one, so I can use the 'Terminate Workflow Instance' action to halt the relevant workflows based on their instance IDs?

Please advise on the best approach for this.

I've seen a similar scenario using instance names to get the instance IDs. The general idea is you set a unique instance name property (for example a list name) in each workflow that you want to cancel. You can then use the “List Instances” action from a modified version of the Nintex Workflow Cloud API - V2 connector that takes a parameter called “Instance Name Contains” (note it will not be supported by Nintex), to list all the instances that contain the unique property in the instance name. The returned data will be in an object and collection format and the instance ID will be one of the properties. You can then loop through all instance ID’s and terminate each instance.

In my scenario, If a SP item was cancelled, it had to terminate all the instances related to the item for a specific site, so the naming convention of the instances was something like this: WorkflowName_ListName_ID_SiteName.

This is what the List Instances action looks like:

So if you had to do something similar, you would need to build a component workflow to terminate all active instances for the item and simply call it whenever a task is rejected.

If this is a potential solution, then see the attached the modified connector file (Nintex API V2 - updated2) note, you will have to unzip it to upload it. The instructions on how to set it up should be the same as the normal one from the nintex connector gallery:
https://gallery.nintex.com/t/NintexWorkflowCloudAPI-v

Lemme know how it goes (if you do go with this) :)


Hi @Kammasood123 
Has Prineel’s answer helped to solve your question?


Reply