Looping Workflow


Badge +3

Good day,

I have a workflow that has a flex task in it. Once the user completes the task they will get a notification and the workflow should complete.  For some reason, that I cannot figure out, the workflow will start over again and prompt the user a second time to complete the task.  Once the task is completed a second time, the workflow completes.  I'm not sure what is causing this or how to fix it.  Any help is greatly appreciated!

Thanks!


18 replies

Userlevel 4
Badge +11

mHi,

is there a State Machine and is the Flexi Task inside a State of the State Machine? If yes, is there a Change State action in that branch that moves to a different state or exit the state machine?

If there is no Change State action inside a state of a state machine, and that state is executed, once it's ended the default behaviour is to start it again, that's why you need at least a Change State action

Giacomo

Badge +3

No, I do not have a State Machine setup.  I'll research how to set that up and give it a try.

Userlevel 4
Badge +11

If you don't have a State Machine, you don't need to set it up to try..it was just my first thought on what could cause the loop..

Could you share a screenshot of your workflow design?

Giacomo

Badge +3

The workflow is to run anytime an item is created or updated.  Once the user completes the task the list is updated and two notifications are sent to the required parties.  I've gone as far as adding the end workflow step, but it has not prevented the workflow from looping and sending the task again.  I do have a reminder setup with in the task, but it not to trigger until 14 days business days after the initial notification and no response has been received.

Userlevel 4
Badge +11

ok..probably looking at what you've written, the workflow isn't looping but simply there is a new instance that is starting on every modification (have a look on workflow history, are there several instances of the same workflow?)

because you have a run if at the beginning, could you try to exclude also items that have fields set up as in the Update Item action so it doesn't process those items?

Badge +3

Yes, in history of any given list item, it shows the workflow completed and then started again.  I'm not sure I follow you - "exclude also items that fields set up as in the Update Item"?  Can you explain?  happy.png 

Userlevel 4
Badge +11

After approval, you're updating some columns in the list items..could you use the field you've updated to add other exclusion to the run if?

For example, assuming you're setting a column named "Status" to "Approved", is it possible to set the Run if condition to verify that Status is not equal to "Approved"?

Badge +3

Ah, now I follow.  Yes, the work flow is to check if the Approval status is not Approved.  It is setup to check if that particular field set to requested.  See below:

Userlevel 4
Badge +11

Ok, and are you already updating that field in the Update Item action after the Flexi Task in order to have a different value? 

Badge +3

Yes that is correct.  The field is being updated to either accepted or declined depending on the users response.

Userlevel 4
Badge +11

ok, try to put a Commit pending changes after the two update item actions and see if the workflow keeps starting..

are there other workflows on the same list/library that should start automatically on change?

Badge +3

No other automatic workflows on the list. 

Thanks, I will give that a try and post back my outcome.

Badge +3

Unfortunately that did not work.  A user responded to the task and they received another request to complete it.  I pulled up the workflow history for this particular item and found that when the user completes the task, the work flow will start again and shows the user started it.  See below.  In this instance I cancelled it. 

Userlevel 4
Badge +11

It's very strange...could you post a screenshot also of the configuration of the two Update Item?

Badge +3

Userlevel 4
Badge +11

Hi Jennifer,

thanks for those additional screenshots...honestly I can't figure out why the other workflow starts and why the status isn't correctly evaluated in the first Run If (because the update item looks correct and it should change the value from "Requested"), I'm sorry! Can you confirm again that there are no other actions or activities (even human-made and not workflow-made) that change again the value in that field?

maybe anyone else here on the forum have other suggestions?

Badge +3

No.  No other changes.  The only goal for the workflow is to notify the user of the terms agreement and once they accept/decline notifications are generated.

Thanks for your suggestions and help!

Badge +3

After some trial and error, I believe I've got this sorted.  Instead of having the workflow trigger based on conditions, I changed it to run when ever an item is created or modified.  I then placed the flex task with in a Run If.  So far the users I have sent the task to have not been prompted a second time for the task approval.

Thanks for your help on this Giacomo Gelosi‌.

Reply