cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Safe Looping Stuck At Its Own Pause

My daily site workflow which needs to loop over 1,500 items started yesterday at 2.00pm in the afternoon, and seems to have gotten stuck at 8.32pm. Workflow status remains "In progress".

 

It's now 8.00am and it still hasn't moved. Should the SharePoint Timer Service be restarted? Should I attempt tweaking the workflow to perform a batch loop?

 

This happens approximately 2-3 times out of every 10 schedules. Sometimes it resumes after this long pause. Once in a rare while it randomly errors. Most of the time, it completes without a hitch.

 

2019-12-06_8-04-17.jpg

Labels: (1)
0 Kudos
Reply
9 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: Safe Looping Stuck At Its Own Pause

Hi,
I think you should go with your suggestion of batching the looping.
In my experience doing that resolves this issue.
Reply
Highlighted
Automation Master
Automation Master

Re: Safe Looping Stuck At Its Own Pause

@furstlars .....what's the logic of your workflow, instead of loop, did you explore the possibility of for loop?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Safe Looping Stuck At Its Own Pause

@kunalpatel I always use the for each loop. I have nested another loop (which also needs to query/filter a large list) inside the main loop so as you can guess it's a pretty repetitive process.

I ran this site workflow on Friday 6.00pm, this time batch looping the main loop. The workflow ended on Sunday 1.35am with no glitches. The downside here, clearly, is a prolonged workflow duration. Ideally I would like to be able to run this daily. Without batch looping, it normally completes by mid-morning the next day.

 

On the side, the batch loop didn't process 25 items before pausing. I counted anywhere between 8-13. It's an irregular count. Why?

 

I will disable the batch loop and see how it fares tonight.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Safe Looping Stuck At Its Own Pause

@kunalpatel I always use the for each loop. I have nested another loop (which also needs to query/filter a large list) inside the main loop so as you can guess it's a pretty repetitive process.


I ran this site workflow on Friday 6.00pm, this time batch looping the main loop. The workflow ended on Sunday 1.35am with no glitches. The downside here, clearly, is a prolonged workflow duration. Ideally I would like to be able to run this daily. Without batch looping, it normally completes by mid-morning the next day.

 

On the side, the batch loop didn't process 25 items before pausing. I counted anywhere between 8-13. It's an irregular count. Why?

 

I will disable the batch loop and see how it fares tonight.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Safe Looping Stuck At Its Own Pause

@furstlars ....Will it be possible to share details on query list actions? Which fields you're trying to get and what are the filter parameters?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Safe Looping Stuck At Its Own Pause

@kunalpatel the workflow makes list queries 3 times:

 

Query List A, where Field A1 is not null. Store Field A1 into collection (there will be similar values in this collection and a collection operation removes these duplicates)

 

Inside parent loop (for each Field A):

 

Query List A again, filter where Field A1 is equal to the current Field A1

Query List B, get all items, store Fields B1 and B2 into their own collections

 

Nested loop (for each B1)...

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Safe Looping Stuck At Its Own Pause

@furstlars 

For list A's query....I can't think of any alternate logic but for list B, I don't see any filters when querying it or any dependencies on list A collection value in querying list B. Can't you move it outside parent's loop? This way it won't be querying multiple times (i.e. for each collections value of list A).

 

Also, can your logic work as a list workflow? What if you start a list workflow on your items from a site workflow or put a schedule on your list items? Just a thought !!!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Safe Looping Stuck At Its Own Pause

@kunalpatel I would like to figure a way to substitute the 2nd list query in the loop by way of looking at a collection instead.

 

To this end, I need to COUNT the number of items in that collection that is of a SPECIFIC VALUE corresponding to the current value in the loop.

 

For e.g. using a COUNT collection operation: count the number of items that has a value of 75 (where 75 is the current value in the loop). It's exactly for this reason why I'm querying the list at this point.


Any thoughts how this can be done?

 

N.B. - Ran the site workflow manually yesterday at 7:00am with no batch loop this time. It finished today at 12:00pm with no glitches. (it's cross referencing about 2,000 items in List A and 600 items in List B).

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Safe Looping Stuck At Its Own Pause

@furstlars ....I'm not sure below approach will work or not but can you try it?

 

  • Query all items from list A and all items from list B
  • Get all the fields you need....even the one which needs for filter
  • Now using RegEx and split option, you can store the values in a new collection
  • Using num variable for index and collection operation actions, can you get what you need?
0 Kudos
Reply