Loading

Salesforce Flow Error 'Number of Iterations Exceeded' Version 56.0 and Earlier

Publiceringsdatum: Jun 24, 2026
Beskrivning

If your Flow in API version 56.0 and earlier receives the “Number of iterations exceeded” error, it may be because of a Loop element that’s trying to process more records. We have a limit of 2000 executed elements at run time.

Flow Builder

Lösning

Why the 2000 Element Limit Is Hit

In Salesforce Flow API version 56.0 and earlier, a maximum of 2000 Flow elements can be executed at runtime. When a Flow contains a Loop element, each element inside the loop is counted as an executed element for every record that passes through the loop. For example, a Flow with a Get Records element, a Loop containing two Assignment elements, and a final Update Records element counts as: 1 (Get Records) + [number of records × 3 (Loop + 2 Assignments)] + 1 (Update Records). If this total exceeds 2000, the "Number of Iterations Exceeded" error occurs.

Workarounds for API Version 56.0 and Earlier

Note: The following are possible suggestions to work around this limit. Any implementation changes to Flow logic are outside the scope of Salesforce Support.

  • Upgrade API version: In API version 57.0, the limit of 2000 Flow elements was removed. Update the Flow API version to 57.0 or later to eliminate this error entirely.
  • Reduce records processed: Filter the records retrieved by Get Records to process only those required, reducing the loop iteration count.
  • Process records in batches: Add a Number variable to your Flow to count loop iterations. Increment it with each loop pass. Use a Decision element to exit the loop when the counter approaches the limit (for example, at 1900 iterations). Add a Wait element or Screen element before looping through the next batch of records.
  • Consider Apex: For high-volume record processing where Flow limits are consistently exceeded, consider implementing the logic in Apex using batch processing (Batchable Apex) which has much higher governor limits.
Ytterligare resurser

In API version 57.0, the limit of 2000 Flow elements was removed. In API version 56.0 and earlier, flows could have a maximum of 2000 Flow elements.  For more information on the latest version, visit the product Help on General Flow Limits.

Find Salesforce Edition and API Version

Knowledge-artikelnummer

000382258

 
Laddar
Salesforce Help | Article