Skip to content
FacebookYouTubeX (Twitter)

Avoid Dead Loops

Sometimes you might see the message MAX_ACTIONS exceeded in your AI workflow:

MAX_ACTIONS exceeded error

This error occurs when an infinite loop (without user interaction) is accidentally created between Blocks:

Example of an infinite loop between blocks

The system limits the number of Actions that can run without user interaction. Each time the user interacts, the MAX_ACTIONS counter is reset.

This protection mechanism prevents:

  • Infinite loops that could crash the system
  • Runaway processes that consume excessive resources
  • Workflows that get stuck in endless cycles

In some cases, a loop in the background is useful — for example, when polling a remote API until the required data is available. If you expect the loop to run many times, you can prevent the MAX_ACTIONS exceeded error by adding a Wait Action with at least 1 second of delay inside the loop:

Adding a Wait Action to prevent MAX_ACTIONS error

Keep in mind that any Flow without user interaction — including loops — can run for a maximum of 4 hours. After this time, the Flow will stop automatically at whatever step it has reached.

This safeguard ensures that:

  • No workflow can run indefinitely
  • System resources are protected
  • Costs remain under control
If condition A → Go to Block B
Block B always leads back to condition A
Loop until data is available
But no fallback if data never becomes available
Block A → Block B → Block C → Block A

If you encounter a MAX_ACTIONS error:

  1. Review your workflow paths - Look for circular connections
  2. Check conditional logic - Ensure all conditions have proper else cases
  3. Add exit strategies - Include timeout conditions and maximum retry counts
  4. Insert Wait Actions - Add delays in any repeated sequences
  5. Test incrementally - Build and test your workflow in small sections

By following these guidelines, you can create robust AI workflows that avoid dead loops while still providing powerful automation capabilities.

If you have questions about Pingstreams features, feel free to contact our support team or leave feedback.