Looping action only runs once then errors

  • 28 January 2019
  • 6 replies
  • 4 views

Badge +2

Hello

We have not been able to master the looping action. In all instances we've tried, it will run through the first loop and then error out. 

Here is my scenario.

During the run of the workflow, users manually update the Order status in the list. I have the loop start if the order status = "Repair in progress". Within the loop we are checking a date filed and checking if the calculated date is less than today's date. If so then send an email notification. If not then it will loop back until either the status has changed or until the date is less. 

As mentioned the workflow goes through the first loop but then errors without any explanation as to why. Any suggestions would really be appreciated. We have already tried switching off safe looping, increasing the pause to 15 minutes (in real world it will be set to 1 day), and adding the Commit pending changes to the end of the loop.

Screenshots below


6 replies

Userlevel 5
Badge +14

and what's the error message?

from the history, you seem to make some updates. they are likely batched and effectively just applied when workflow reaches a pause action. so the error may be caused by before executed updates.

Badge +2

Hello Marian 

The error message isn't very helpful. It just states "The Spares Request workflow has ended unexpectedly for (no title)
Spares Request failed to run.
Click here to view the workflow status."

The updates that do run take place before the loop action and it goes through these without issue. We don;t have any batching set up for the updates. While the workflow runs there are stages that wait for updates. The list updates without issue. 

Userlevel 5
Badge +14

The error message isn't very helpful.

what's a delay between pause action started and error is reported?

I wonder whether it errors out within/after a timer job cycle or after some (longer) timeout ...

The updates that do run take place before the loop action and it goes through these without issue.

that doesn't mean updates are effectively applied to the SP list....

(see the link bellow when updates are effectively persisted to the list)

and until they are applied error need not be raised.

We don;t have any batching set up for the updates. While the workflow runs there are stages that wait for updates. The list updates without issue. 

this is not anything you could influence, it's OOTB SP feature.

read more on the topic eg in this blog - Defensive Workflow Design Part 5 - Batching 

to rule out problems caused by previous updates add both "commit pending changes" and "pause for..." actions right before loop.

run the workflow and let's see the behaviour...

Badge +2

Hello Marian

Thanks for your help. I tried to run it with the "Commit pending changes" and the "pause for" before the loop. First i had it with Pause for 5 minutes then the commit pending changes and this failed at the Pause for. I then swapped them round and it failed again. I then increased the pause from 5 to 10 minutes and it still failed at the pause. 

The error just shows the pause action as incomplete. At 11:15 pausing for 10 minutes and then at 11:25 Error.

I will get our SharePoint administrator to check the OOTB feature to see if something here is affecting it. 

Userlevel 5
Badge +14

this as well supports my above idea the problem is in one of previous updates.

it's not about how long you will pause for, it's all about the pause causes workflow to dehydrate and before that all the queued changes must be persisted to the list (item). and this is the reason of problem.

check once again carefully all the updates

Badge +2

Hi Marian

On Thursday we updated our Nintex software to the latest version 4.4.0.0 after looking into some other issues hoping it would also fix this. Unfortunately it didn't and we are no better off. We are now looking to update  our Sharepoint software as this is still running on an older version. Nintex support said that this being on an older version shouldn't have an impact but at the moment we have nothing else to try. 

Reply