Efficiently Canceling Numerous Flow Runs Using a Reusable Power Automate Flow

Are you managing numerous flows in Power Automate and need an efficient way to cancel more than 20 runs at once? Here’s a handy guide to streamline this process using a special template.

Key Points to Remember:

  • The template processes about five runs per minute. Altering the delay period might lead to throttling, so it’s advisable to use it as is.
  • Note: This template requires a license that includes premium connectors.

Step-by-Step Guide to Cancel Flow Runs:

Gather Your Environment and Flow IDs:

  • Finding the Environment ID: Go to ‘Home‘ in Power Automate and check your browser’s address bar. Your Environment ID is the string between ‘environments/‘ and ‘/home‘.
  • Finding the Flow ID: Navigate to ‘My flows’, select your flow, and check the address bar on the Details page. The Flow ID is between ‘flows/‘ and ‘/details’.

Access the Template:

  • Log in to Power Automate and locate the ‘Cancel all my flow runs‘ template.

Set Up the HTTP with Microsoft Entra ID:

  • Don’t check the Gateways box.
  • For Base Resource URL, enter https://api.flow.microsoft.com.
  • In Azure AD Resource URI, input https://service.flow.microsoft.com.

Configure Power Automate Management:

  • In the Authentication Type, select ‘First Party‘.
  • Save the flow in the designer.

Run the Flow:

  • Input the Environment and Flow IDs you obtained earlier.
  • Execute the flow, which will cancel all the runs.

Confirm Cancellation:

  • Check the ‘Run history‘ page to ensure the cancellation of the runs.

This method is an effective way to manage your flow runs, especially when dealing with a large number. Remember, the key to a smooth process is ensuring you have the correct IDs and following the steps carefully.

This approach is identical to the one we explored in a previous article. However, Microsoft has now conveniently introduced a template to simplify the setup process for us.

Leave a comment