Not applicable

does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

I want to remove list items in specific statuses for specific timeframes (ex: all 'cancelled' over 30 days).

I want to be sure that using the 'delete multiple items' control does not leave orphaned workflows running.

0 Kudos
Reply
10 Replies
kapilkjoshi
Automation Master
Automation Master

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Hi David,

To make sure that you do not have orphaned workflows, you can terminate the workflows for the respective item using Web service and then delete the corresponding items. You would need to query all the ID's that you want to delete and within For-Each loop, create web service action to terminate workflow and delete the item as well.

Here is the reference for batch termination that you can use: Nintex Workflow - Batch Termination Workflow - Vadim Tabakman

Reply
Not applicable

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Hi Kapil,

Thank you, this is helpful; but what if I don’t know what workflow might be running for the list item?

This web service call in the link provided appears to require the workflow name specified.

I have just taken over for someone that left, I see that they didn’t do any cleanup. Although I’ve done C# development for many years, I’m just becoming familiar with Nintex. I’ve created a workflow that can delete list items that have been abandoned in statuses for a long time, but not sure what is going on in the background.

Is there a way to detect what workflow is running against a list item? (other than opening each one up)

Can a list item have more than one workflow operating on it at one time?

thx

Reply
eharris04
Workflow Hero

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

David,

To achieve this, I would suggest navigating to the NIntex Workflow Manager at the site collection level and terminating workflows from that level.  You can delete the list items and then purge workflows running on that list or in that site.  This removes them from the Nintex Database which means truly deleting them from the farm.

Regarding your workflow to delete items, it will remove those items and the workflow instances that were running or ran on those items, but they will still be in the database.  If you want to remove those, my suggestion above will help.  A list item can have more than one workflow running against it, but I will say that this way.  A list item can only have one instance of a workflow running against it, so if a workflow is named Workflow 1, than only one instance of that can be running on an item at a time.  You cannot start that workflow and then two days later start it again, unless it has already completed.  You can however have Workflow 2 start against that item as long as the workflows are truly different.

Hope that helps

Reply
cju
Automation Master
Automation Master

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

You're absolutely right, Eric.

Another solution could be to build a workflow on the list where the items to delete are. This workflow would end all running instances on the current item (with the "Terminate workflow" action configured to stop "All except current workflow") and could maybe also delete the current item. Then in your other workflow, you could call the previous workflow for each item to delete instead of deleting them.

Hope this helps

Reply
Not applicable

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Thanks, this is something I was considering, but I really want to create a site workflow that I can schedule.

I’m frustrated that site workflows don’t have the same options available.

My thought was using a site workflow, capture all the old items in a collection, then in a foreach loop process each one to terminate all except current, then delete the item.

- But there is no availability of the “terminate all wf’s except current” process for site wf’s

I should mention that we are still working on 2010, there is a plan to upgrade next year, but for now … however, I don’t know if this would even be an option in 2013.

Reply
cju
Automation Master
Automation Master

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Hi David,

It's the same in 2013 than in 2010 : in site workflows there's not the option to terminate all workflows except the current.

What you can do is :

  • create a list workflow (or a reusable list workflow) which would simply just terminate all workflows except the current
  • in the foreach loop of your site workflow (which loop through all the old items) start the list workflow created before (you can do it via Nintex Workflow web service : Start a Workflow using a Web Service )

And this should do what you'd like.

Hope this helps

View solution in original post

Reply
Not applicable

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Caroline, that is what I ended up doing.  It's clunky, but it works.

0 Kudos
Reply
Not applicable

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

Hi, David Light​! Mind selecting a "correct answer" from this thread? Even if it's klunky, it's helpful to other community members seeking correct answers.  Thank you!

Frank

Your community manager

0 Kudos
Reply
Not applicable

Re: does 'Delete multiple items' terminate any running workflows for each item?

Jump to solution

HI Frank,

Done. Thank you for reminding me.

Reply