0

I am attempting to run a Flow Loop through a very large collection of records and keep getting an error whose only description is "FLOW_INTERVIEW_LIMIT_EXCEEDED".

I wasn't sure if it was too many iterations or too big of a flow. I've trimmed down the Flow and am able to get through more iterations. As it is now, it is able to get through about 500 iterations of the loop. But that's really not enough for what I need to do.

Here is the error I am receiving in my debug log : "errorId | 1354106587-123901 (-1676517500)"

It's not the SOQL query limit because that is saying I'm at 585, and the limit is 5,000.

My Flow is down to the bare bones so I can't really trim it down any more. Any ideas ?

1

The reason this limit is hit is that when looping through records, each element in the loop counts as an executed element multiple times (once per record that you loop through). Even though the error is not exactly Number of Iterations Exceeded, it is still relevant.

For example, consider the following flow.

enter image description here

Number of records executed: fast lookup element + [number of records * 3 (as we have 3 elements that run for every record in the loop)] + fast update element.

The total value should be less than or equal to 2000. If the values exceeds 2000, you will notice, "Number of Iterations Exceeded" error.

Here are a few suggestions to work around the error.

NOTE: These alternatives are possible suggestions. Any implementation suggestions related to flows will be out of scope for support.

  1. Reduce the total number of records being processed.
  2. Process the records in multiple batches. Keep your own counter using a number variable and increment it every loop, exiting the loop when you're about to hit a limit. Consider adding a screen or wait element before looping through next batch of records.
  3. Check for alternatives using Apex code.(If there more records to deal with preferably async apex)
  4. If you are looking to just count use equalsCount instead of looping
|improve this answer|||||
  • That count/Wait solution will work ? Just by sticking in a Wait within the loop after an acceptable count it will cause it to not time out ? How long would I have to make it wait ? – Zoom_v Nov 6 '18 at 22:30
  • @Zoom_v I haven't tried the wait part myself but in reference to count if your'e just looping to count number of records use a assignement to assign the count of list element to a variable using equalscount and your variable should have the value(you don't have to loop for this). look at get count via flow assignment Other than than the best advice would be going apex route! – codeyinthecloud Nov 6 '18 at 22:33
  • @codyinthecloud - just fyi - Using the Wait element did indeed work. And to make the Wait only last 1min I used {!$Flow.CurrentDateTime} - (0.041) in a formula to make 59min - and then used that formula as the Base Time in the Wait element - and then used 1hr as the Offset. Worked like a charm. Thank you for all of your help. – Zoom_v Nov 8 '18 at 18:51

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.