Skip to main content

Hello,

I am working on migrating a 2010 On Prem workflow that is using the Terminate Workflow - All except current workflow option but it’s not a option in the Nintex Automation environment.  Is there any way to have this same functionality/step in Automation environment?

 

Hi @fortyone,

There is no out-of-the-box way to achieve this solution.
You will need to use Nintex Automation Clouds API’s.

Use this API to get all the instances of the workflow.
https://developer.nintex.com/docs/nc-api-docs/046832983606a-list-a-workflow-s-instances
Loop through the results and use this API to Stop all but the last instance.
https://developer.nintex.com/docs/nc-api-docs/f088a75546a21-stop-an-instance


Hi @fortyone 

Did this response help answer your question?


I’m totally new to Nintex and still learning so with the API, would I use the Call a web service action and add url - https://us.nintex.io/workflows/v2/designs/{workflowId}/instances 

The list I am working with has 5 different workflows that might run against a specific item and when a certain field is changed all workflows running need to be totally stopped/terminated.  Thanks for your help


Hi @fortyone,

Yes, you would use a call a web service action to call that URL to list the instances.
As you may have multiple instances of a workflow running on the list, one for each item, I suggest that you use the Set Instance name action at the start of each workflow to give each instance a unique name. It could be as simple as appending the item ID to the end of the name.  This will make it easy to identify in the list of instances.
Unfortunately, you must do this 5 times if you have 5 different workflows.
 


Thanks!  So if I set one of the Workflows instance name to be Test Workflow 1 - ID

The Url would look like this?:

 


Hi @fortyone,

That does not look correct.  That web service is to list all the instances for a workflow, so the workflow ID needs to be provided, not the workflow name.
To find the workflowID, open the workflow in the designer and grab the GUID from the URL.

Example: yourtenant.workflowcloud.com/dashboard/designer/f7a31cd8-6d9c-4103-a220-3b5d1996d6ae/published

This will return all the instances of the workflow.
Loop through the results to find the unique workflow name, and when you find it, use: 

https://us.nintex.io/workflows/v1/instances/{instance_id}/terminate to terminate the workflow.

I suggest you remove the special characters from the workflow name, as you have pictured above, as this may cause issues.


So when I try the following url I get a 401 error, does the actual url need be a little different somewhere:

https://us.nintex.io/workflows/v2/designs/f4b89684-ad87-4a71-be5b-eef2cd9d8228/instances

 


Hi @fortyone,

Make sure you have setup your authentication token.
https://developer.nintex.com/docs/nc-api-docs/b87d37ae48a0d-authentication


Reply