Skip to main content
Nintex Community Menu Bar
Solved

Terminate All Workflows Except Current workflow in Nintex Cloud

  • May 22, 2024
  • 8 replies
  • 107 views
  • Translate

Forum|alt.badge.img+4

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?

 

Best answer by SimonMuntz

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

View original
Did this topic help you find an answer to your question?

8 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2467 replies
  • Answer
  • May 23, 2024

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

Translate

MillaZ
Nintex Employee
Forum|alt.badge.img+21
  • Nintex Employee
  • 675 replies
  • May 27, 2024

Hi @fortyone 

Did this response help answer your question?

Translate

Forum|alt.badge.img+4
  • Author
  • Rookie
  • 28 replies
  • June 4, 2024

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

Translate

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2467 replies
  • June 4, 2024

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.
 

Translate

Forum|alt.badge.img+4
  • Author
  • Rookie
  • 28 replies
  • June 5, 2024

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

The Url would look like this?:

 

Translate

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2467 replies
  • June 6, 2024

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.

Translate

Forum|alt.badge.img+4
  • Author
  • Rookie
  • 28 replies
  • June 6, 2024

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

 

Translate

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2467 replies
  • June 10, 2024

Hi @fortyone,

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

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings