Prevent excessive looping iterations

Excessive looping iterations can occur when a loop is configured to run for many iterations without a pause or when the environment, variables, or business logic conditions cause workflows to iterate through actions indefinitely (or for a great number of times). This occurrence can reduce performance and starve other workflows of resources.

The following farm-wide settings are available to help prevent excessive looping iterations and thus safeguard performance.

  • Enforce safe looping (enabled by default): Automatically adds a hidden delay at the end of each iteration of a loop action (Loop only) if the child actions are not guaranteed to cause the workflow to stop and wait. This delay can cause a 2- to 7-minute pause between each run of the loop. Delays are added when the workflow is published; to see the change in behavior, republish existing workflows that use loop actions.
  • Enable maximum loop threshold (enabled by default with a threshold of 250): Traps excessive iterations, stopping workflow instances containing loop actions (​Loop or State Machine) that iterate beyond the specified threshold. If the threshold is exceeded, an error is logged to the workflow history.

As administrator, you can change the above settings. For more information, see Configure security settings.

Related information

Loop

State Machine