Vadim Tabakman

Nintex Workflow - Restarting on Modified

Recently and quite often in the past few months, I've seen the request where a Nintex Workflow starts when an item is created.  As it is running, the item is modified and there is a requirement that a new instance of the workflow starts.

Unfortunately, in SharePoint, you can't have multiple instances of the same workflow running at the same time.  So to get this scenario to work, you need two workflows.

VIDEO

The main workflow starts when an item is created and does all the work.

The second workflow is the one that starts when and item is modified.  This one only has a few actions in it, as we want it to be as streamlined as possible.  This workflow will check if the main workflow is running.  If it is, it will terminate it and finally it will start a new instance of the main workflow.

What the main workflow looks like in this scenario is not relevant, since this is just a proof-of-concept.  You can see what it looks like in the video above, or get it from the downloads section below.

The second workflow looks like this :

 

You can see that it's not very elaborate and that's the way we want this. It should be a simple workflow that is quick and doesn't waste time.

The first thing we do is check to see if the main workflow is running which is done with a Run If action.  Whenever a workflow runs, it update a field that has the same name as the workflow.  If a workflow is running, it will say "In Progress" but behind the scenes, that is kept a number which is 2.  So we check the field of the main workflow, if it equals 2.

If the workflow is running, we can use the Nintex Workflow action called Terminate Workflow.  This will stop the running instance of that workflow.

Finally, regardless of whether the main workflow was running or wasn't, we want to start a new instance of that workflow, and we can use the Start Workflow action.

The main thing to note in the Start Workflow action, is that we want to start the workflow immediately, and we want to make sure the "Wait for the workflow to complete before continuing" is NOT checked.  Otherwise, if you'll get both instances (OnCreated and OnModified) running at the same time, and any other item edits will not go through this process until both workflow instances are complete.

NOTE: when running this type of logic, when you terminate a workflow, if the main workflow is assigning and waiting on a task, those users will get emails letting them know they no longer need to respond.  The initiator of the workflow will also get an email letting them know the workflow was cancelled.  So there may be questions from them around why that happened. 

Downloads 

Posted by Vadim Tabakman Friday, May 16, 2014 8:20:00 AM Categories: Nintex Workflow Nintex Workflow 2013 Run If Start Workflow Terminate Workflow
Copyright Vadim Tabakman
Rate this Content 3 Votes

Comments

Monday, May 19, 2014 3:13:25 AM
Mark Uden
Gravatar

re: Nintex Workflow - Restarting on Modified

Hi Vadim,

That's a interesting idea and I will try to use it, but there would be some important limitations wouldn't there? If the main workflow needed to update the item in any way (maybe even setting the status as approved), then the second workflow would run, wouldn't it?

I suppose in this scenario, you could use a hidden column that the main workflow could use to show that it was making the change rather than an end user, so the second workflow could ignore it. But I'm not sure how reliable this would be. Any thoughts on this?

Regards,

Mark

Monday, May 19, 2014 9:46:39 PM
patrick
Gravatar

re: Nintex Workflow - Restarting on Modified

hello,could you please give me your email address,i have some problem on the "Nintex Forms - Querying User Profiles""

 

thank you ~

Tuesday, August 5, 2014 9:49:20 AM
Gabe Worden
Gravatar

re: Nintex Workflow - Restarting on Modified

How can I turn this into a UDA? 

Tuesday, August 5, 2014 11:20:55 AM

re: Nintex Workflow - Restarting on Modified

Hi Gabe,

I'm not sure what you mean?  Have you tried to put this into a UDA and it's not working?

cheers,

Vadim

Friday, November 14, 2014 5:00:20 AM
Puseletso
Gravatar

re: Nintex Workflow - Restarting on Modified

Hi

I followed the step provide to cancelled and start a workflow on the same, but my problem is that the workflow still start even if I set it to start when items are modified it start when item are created but I did not set it to do that

Any solution regarding my issue

Friday, November 14, 2014 7:29:12 AM

re: Nintex Workflow - Restarting on Modified

Hi Puseletso,

your workflow is configured to start when an item is modified, but it starts when an item is created?

Are you creating a list item or a document?

cheers,

Vadim

Monday, November 17, 2014 12:50:40 AM
Puseletso
Gravatar

re: Nintex Workflow - Restarting on Modified

Hi Vadim

Yes it start when items are created but configured to start when item are modified

I am creating a list item

Thanks

Puseletso

Monday, November 17, 2014 8:54:38 AM

re: Nintex Workflow - Restarting on Modified

I'm afraid I don't know.  Nintex Workflow itself doesn't start the work on those events. SharePoint does.

It sounds like something is modifying the item after it's created.

cheers,

Vadim

Tuesday, November 18, 2014 1:19:13 AM
Puseletso
Gravatar

re: Nintex Workflow - Restarting on Modified

Hi Vadim

I think its because the workflow update the status and so the item becomes modified, is the any way to start the workflow conditionally when items are updated/ start workflow conditionally using the version of the item if possible?

Thanks

Puseletso 

Friday, April 10, 2015 1:04:56 PM
Mike
Gravatar

re: Nintex Workflow - Restarting on Modified

I have three different workflows running currently. The first coming from the supervisor going to the worker. The worker then take action and the flow goes back to the supervisor. The supervisor reviews what he received from the worker and then closes the form. The worker receives a notification the the supervisor closed the task. The flow that you have listed sends all of the flows out at one time. Any suggestions?

 

M

Friday, April 10, 2015 1:09:24 PM

re: Nintex Workflow - Restarting on Modified

HI Mike,

instead of having one workflow start other workflows, since it sounds like you have a process flow, if you need separate workflows, look at having one workflow start another workflow.

eg. Workflow1 runs and at the end, starts Workflow2.  Workflow2 runs and at the end, starts Workflow3

 

cheers,

Vadim

Thursday, September 17, 2015 8:22:30 AM
Jon
Gravatar

re: Nintex Workflow - Restarting on Modified

Hi Vadim,

 

Thanks for this, it is very helpful. However, I have an issue similar to the one mentioned above by Mark.

 

My initial workflow updates the items in several of the columns and, as such, it sets off the second workflow. This leads to a never ending chain of the first workflow! Is there a way to stop this?

 

Thanks,

 

Jon 

Monday, February 5, 2018 2:46:03 PM

re: Nintex Workflow - Restarting on Modified

Vadim,

Thank you so very much for this post - what a lifesaver!!  It is so simple, yet I've been trying to get to this a variety of (more complicated) ways and your post really broke it down and made it easy.  I cannot thank you enough!! smiley

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register





 

Statistics

  • Entries (256)
  • Comments (1761)

Categories