Posts

Showing posts from December, 2023

Cancel Ongoing Flow Runs in Microsoft Dynamics 365 Dataverse: Complete Guide

Image
We came across an issue that a lot of flow runs that were accidentally triggered based upon a mutation of a Dataverse/CRM entity action in a specific flow. Microsoft does have a solution to cancel runs using the power automate template ( Power automation cancel bulk template ) However, the issue is that this cancel around 5000 flow runs in 18 hours since there is a delay of around 10 seconds. If you remove the delay, the flow does not give the expected results. Authorization Now the question is how to fix this issue? There is a flow api that allows you to cancel flow runs, but there are some steps to take to be able to do this. Create an app registration in microsoft azure ad/entra with the permission 'Flows.Manage.All' and add the redirect url 'https://global.consent.azure-apim.net/redirect' under Authentication Add a secret to the app registration write this down because you won't be able to see it anymore after creation. In postman create a collection with the au...