It is good practice to make steps required in your Business Process Flow Stage. This will help guide the user what needs to be completed in the process before moving to the next stage. To add a requirement to a Power Automate Cloud Flow step however, is not as easy as it would seem! In this post I show you how you can make a Cloud Flow step required in a BPF stage.
Last time I promised this was the last blog in a series of posts about Approval Flows. However this is a hidden gem and after my research I want you all to know about this! If you want to know more about Approval Flows inside a BPF, you can check this overview. Subjects like writing result data back to Dataverse, adding a hyperlink to the Approval Flow for easy reference and automatically change the stage of the BPF based on the outcome.It also includes a sample solution with these examples for you to download and play around with!
Let me start off by confessing that I did not know how to fulfil this requirement until recently! I received a tip from Rudi Louw in a comment on a previous blog post about Approval Flows. It is a feature that is not documented in the Microsoft documentation about Cloud Flows inside a Business Process Flow. When you run a Flow inside a stage you will see that the status changes to “Processing”.
The tip from Rudi is about updating the Process Log record of the Cloud Flow. Because this record is where the status of the Cloud Flow step is saved. You can (and should!) update the Process Log after the Flow has run to completion. You get the Process Log Id from the “When a flow step is run from a business process flow” trigger. It is called: “Flows Workflow Log Id”
This tip works like a charm. No longer do we need to look at the status Flow and wonder if it was successful! If you add the Update Record action at the end of your Flow you will see the status change.
Researching the Possibilities!
Now setting the status to “Succeeded” is not the only possibility we have. We can choose from various other statuses. I ran some tests and without doubt I am a little surprised by the results.
The first idea I had was related to my Approval Flow. It would be real handy to change the Cloud Flow Step status to waiting while the approver was deciding. This however did not work. When put on the status “Waiting” the Flow Step is still “Processing”. In fact the status of the Step only shows 3 different results; “Failed”, “Processing” and “Succeeded”.
|Cloud Flow Step Status||Process Logs Status|
|Processing||In Progress, Waiting|
Now that did not stop me from continuing with my tests. In fact this actually gave me another idea! Can we use these Status changes to make a Flow step required? Can we block moving to the next stage if the status is not on “Succeeded”?
Cloud Flow is now Required
Yes this actually works! I guess this is the product teams design all along. I suppose that sometimes it takes a while for things to click, in my head at least 😅
Now go check that checkmark in the Flow step in the Business Process Flow designer. Afterwards make sure to add the Process Log Update Record action and put it on “Succeeded”. Only if this succeeds you can move the Business Process Flow to the next stage. See this in action below.
Super handy for making sure the flow has run to completion before we can move on. For instance, you can no longer forget to start that automation to send the e-mail. This also opens more scenario’s. For instance we can only allow moving to the next Stage if our manager gives Approval in an Approval Flow.
Thank you for reading and at least I hope this helps some of you from pulling your hear why that Cloud Flow step stays on Processing!
This helped me a lot, thank you, a new problem now exists. I have a user that can run said flow, but on their session it never updates to Succeeded and goes form in progress to blank, while my session (System admin rights) shows the Succeeded, I have to then go to the next stage for them (the flow did complete successfully). I have given them full rights to the Process under BPF Security roles
Hi Casper, glad you like it!
I am not sure what causes this, I have not encountered this before. I think you are on the right track that this could be a security issue. You can check the rights of the Process Logs table as well. Can you let me know if that fixes it?
A good good document!
Thank you for share this info! It makes me happy.
Thank you Jordi, always nice to hear. Glad I could help!