5

I have a site workflow terminating automatically, after a short run time, with the error message:

The workflow instance exceeded the throttle of 10000 activities executed in a row and could not be unloaded because it was not persistable.

Is the 10,000 activities limitation strict for the workflow? I couldn't find documents detailing this out.

I put together this workflow that loops over two dictionaries built using REST calls to two separate lists. Each entry in list one will potentially have zero or more matching records from list two. The intent is to group records from list two, by field match in list one, into an email.

Presently list one has 97 records. This may increase over time, but not drastically. List two's records will fluctuate week over week but should expect to be in the range of 100-200 pertinent records for this loop.

The workflow functioned as intended during test with a smaller group which leads me to believe that the only problem now is that the scale of processing exceeds some hard limit.

5
  • but is it really doing 10000 activities before it shows you this message?
    – Vamsi K K
    Sep 24, 2015 at 21:00
  • Execution appears to halt after processing 80 of 97 records from list one. Assuming each action in the workflow is one activity, and based on the observed output before termination, then yes, it should be at around 12,847 activities before terminating.
    – Joe
    Sep 24, 2015 at 21:15
  • Reducing from 97 to 73 records for processing in list one resulted in successful completion of the workflow. This particular use case is still on the low end of the spectrum for projected activity volume however, so I'm left with the original question regarding workflow limitations.
    – Joe
    Sep 24, 2015 at 21:31
  • A developer encountered the same issue with VS Workflow. So, it is a limitation from the workflow manager itself - not SPD / VS. There is no mention of this in the documentation of SP 2013 boundaries, thresholds and limits. You may have to the cheat the system by developing multiple copies of the workflow which work on different sets of the same list. e.g. WF1 - 1 - 50 records, WF2 51 - 100, etc. social.technet.microsoft.com/Forums/en-US/…
    – Vamsi K K
    Sep 24, 2015 at 21:42
  • hope your SharePoint is up to date in terms of CU that may have resolved this issue if it is a defect but if it is by design, this could be a show stopper! This limit is really shocking, more so cause it is undocumented!
    – Vamsi K K
    Sep 24, 2015 at 21:45

2 Answers 2

4

I still could not find documentation supporting the 10,000 activities limit, however I have found a solution which allows the workflow to process in full.

The solution was inspired by a little note in this article:

https://msdn.microsoft.com/en-us/library/jj680843(v=azure.10).aspx

The limit of the memory allocated by a workflow instance. The quota resets each time the workflow is persisted, for example, if it waits for a message or waits on a timer.

Setting a pause activity periodically throughout the workflow's processing of records in list one seems to reset the number of continuous activities. So after 5 records from list one, I pause for a minute, then continue as normal.

The workflow completed processing with higher parameters than those which caused the suspension earlier, so I think this is a success.

Speculating it seems that the Workflow Manager counts the activities and upon reaching 10,000 or more, it halts the workflow to protect against infinite loops.

2

As suggested by Joe, I inserted pause statements after end of each loop block. The shortest pause possible is of 1 minute so avoid putting them in the inner loops because it can delay the workflow a lot. A judicious placement of pause statements through the workflow can help avoid this issue of workflow terminating suddenly. Refer the image for guidance. Inserting pause statement right after the loop block ends

Edited: 20-Apr-2016

Have found another way to pause SharePoint workflow for less than a minute. The steps are mentioned below and this is the source.

step1: Create a workflow variable called "delay_timer": Number setp2: Use Calculate action to get required delay/pause time and save in workflow variable "delay_timer" (eg: 1 divided by 20 = 3 seconds) step3: Pause workflow for "delay_timer" duration.

Another way that comes to mind is to use the mod operation in calculate function to pause the workflow after 5 steps only. So if there are 20 loops then counter mod 5 will be true only 4 times so you can reduce the number of times pause gets called. Will depend on the amount of processing happening in a single loop I guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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