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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Cancel Flow

(1) ShareShare
ReportReport
Posted on by 39
Hello,
 
I am trying to use the 'Cancel Flow Run' action to halt any other flows connected to the same item on a sharepoint list once one of the 3 flows has completed.
When attempting to use the Cancel Flow Run action, it fails with the following error:
Request to Azure Resource Manager failed with error: '{"error":{"code":"BadRequest","message":"The provided workflow run name is not valid."}}'.
 
How the flow operates:
  • Flow ID is captured using a Compose action action and the formula workflow()?['name']
  • Flow ID is added on the Sharepoint list item in a Text column using a later 'Update an Item' action to store the flow ID to corresponding 1, 2, or 3 column depending on an unrelated branching condition in the flow
  • A 'Send an Email with Options' action is used. Once a response is received it completes a few actions based on the response, then moves on.
  • A 'Get Items' action then pulls the specific list item to capture if any Flow IDs have been populated in the columns.
  • A branching condition moves to a 'Cancel Flow Run' action if the corresponding Flow ID column is not empty
  • The Flow ID is populated into the 'Cancel Flow Run' action as dynamic content from the 'Get Item' action previously mentioned
  • The flow then fails, as it appears to be unable to find the flow in order to cancel it, despite the Run ID it is trying to cancel looking identical to the Flow ID stored in the sharepoint list cell, and corresponding flow still being in 'Running' status.
  • Flow ID from Sharepoint List:
A few notes:
  • One of the flows is a child flow, the other is a normal flow.
  • Both flows are stored within the same Solution
 
Thank you for reading. Please let me know if you need additional info.
 
Cheers
 
Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    14,054 Super User 2026 Season 1 on at
    The workflow name is not the same as the flow run ID, which is most likely the cause of your error. 
     
    This expression generates the link to the flow run: concat('https://make.powerautomate.com/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])
     
    I am not sure your process is the most efficient if you need to cancel flow runs. However, if it works for you, awesome.
  • CU18091915-0 Profile Picture
    39 on at
    @David_MA Changed workflow()?['name'] to workflow()?['run']['name'] in the Compose action and that fixed it, thanks.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard