2

I have this scenario where I need to loop through a list of items. As workflows don't offer a looping functionality, I created a following workflow:
1. It fires when an item is changed.
2. It does its job, changes Processed field value on current item from False to True.
3. It looks for an item in the same list that has Processed = False.
4. It changes the found item, so that the same workflow is triggered for the next item and the story starts again.

Everything works fine, except that the 11th element in this chain gets updated by the workflow of 10th element but this update for some reason does not fire a workflow for the 11th element. In history I see it was changed, but in workflow history no workflow was fired. And it happens regularly every 10 items.

I thought that maybe there is a limit for workflows of the same type to be running at the same time - but actually they are not running in the same time - the workflow for the next item is triggered in the end of the current item's workflow.

What may be a possible cause of this kind of issue?

  • Can you start the WF for 11th item manually? Is there anything in ULS log? Have you considered using timer job or site workflow to process whole list? – luccio Jan 23 '14 at 12:34
  • and can I use a site workflow or timer job to process the whole list...? without coding I mean, I am not allowed to use coding here. yes, WF for 11th item started manually works just fine, it again works for the next 10 items and then fails for the 21st. I don't have access to the ULS logs – agnieszka Jan 23 '14 at 14:17
  • You will not be able to do it w/o coding. Ask for ULS logs, it can move us forward to solution. – luccio Jan 24 '14 at 13:13
0

Microsoft, in their infinite wisdom, decided that more than 10 recursions was undesirable, and "fixed" this in a cumulative update. More information:

Looping Workflows Blocked

0

I remember back in MOSS 2007 I setup a workflow that worked around a similar problem by using a separate list as a proxy to trigger the workflow. Basically setup a second list with a workflow that the original list triggers by creating/updating something.

The second workflow then calls back to the first list with whatever information the first workflow passed to it, indicating the next item to trigger on. The cycle repeats until some end condition is met. Be careful not to setup an infinite loop here!

Hope that made sense. It worked ok, but it's a bit of a hack and fairly slow when compared to other methods. Quick and dirty solution if you're in a bind.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.