Prevent excessive looping

Excessive looping iterations can occur when loop actions are configured for workflows to process through actions many times without a pause. This behavior might lead to other workflows having limited availability to resources and reducing performance as a result.

For example, when a looping action starts in a worklow, if the workflow exceeds the resource limit in SharePoint Online, it automatically increases the execution time. If this happens, each looping iteration can take longer to execute.

Best practices to follow to prevent excessive looping

  • Add a action Inside each looping iteration. The Pause for Duration action adds a hidden delay at the end of each iteration.
  • Guideline: Use a 30-second or 1-minute delay for each iteration.

  • If a workflow contains any loop logic such as the For Each action, consider leaving out actions such as as they can quickly fill a workflow history list if left unchecked.
  • Split large workflows into smaller sub workflows with fewer actions. This reduces the number of requests from a workflow instance. For more information about splitting workflows, see Splitting large workflows