I have a site workflow that has a for each loop in it. The loop looks in a list and checks to see if it should create a document in a library for the list item. It used to work well but since we upgraded to SharePoint 2013 when it runs, it quits after 4 loops. We must restart it ever 4 iterations. Any idea why this would happen?
No, I do not think so. We filter the lookup for the loop on the pertinent data so that should not be an issue. Besides, the very predictable 4 and no more behavior would seem to rule out the randomness of ragged data.
What I mean is, check the count inside the collection. The query you are doing that fills the collection prior to entering the For Each may have changed in the number of results it is returning. Hence the sudden change of iterations.