web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Cancel long flow runs

(1) ShareShare
ReportReport
Posted on by 123
The Power Automate flow aims to identify and cancel flows running or queued for excessive durations, improving system performance and avoiding task bottlenecks. However, the primary challenge has been that notifications in Microsoft Teams do not display the name of the flow or its run ID. The messages only indicate whether the flow was in a "running" or "queued" state, making it harder to trace specific flows.
 

Detailed Actions in the Flow:

  1. Fetch Flow Run Data:

    • Use the Power Automate Management connector or Flow API to list flows and their current statuses (running, succeeded, queued, etc.).
  2. Filter Long-Running or Queued Flows:

    • Compare each flow's runtime or queue duration with a predefined threshold (e.g., 1 hour for running flows, 30 minutes for queued flows).
  3. Identify Relevant Flows:

    • Create conditions to identify flows exceeding the threshold. Tag them as “To Be Canceled” for further processing.
  4. Cancel Flows:

    • Use the "Cancel Flow Run" action or API endpoint to terminate flows flagged as exceeding the time limits.
  5. Send Notifications to Microsoft Teams:

    • Notify stakeholders via Teams about the canceled flows. Include details such as:
      • Flow status (Running or Queued).
      • Additional data available from the API (e.g., timestamps, correlation IDs).

    Current Issue: Notifications in Teams fail to include the flow name or run ID, limiting traceability. This is a key pain point being addressed.

Categories:
I have the same question (0)
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    How are you listing the flow runs to cancel them?  

    I'm not aware of a Power Automate Management action that lists flow runs in Power Automate, though you can do it by invoking an API request.

    The Power Automate Management "List Flows as Admin (v2)" will give you the display name of each flow,
    so if you can use it and then list and cancel the running flows under each one you should be able to append that to your array or whatever is returning the list of canceled flows you can include the flow name.

    It's under "properties/displayName"

     

     
  • razec18 Profile Picture
    123 on at
    Hi Mark!

    I'm using List Rows from a selected environment to do this.
     
     
    With this, I can discover with flows are running for more than X hours and on the queue for more then X hours.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard