Make a Flow required in your BPF Stage

Shows an animated gif of a Business Process Flow with a Run Flow step. The Run Flow step is required. The video shows how we want to move to the next stage but it is blocked as the Flow step is in the status "Processing". Once the Flow has run the status changed to "Succeeded" and we can move to the next stage

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!

Confession

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”.

Shows the BPF Cloud Flow step which stays on processing if you do not update the Process Log record.
Cloud Flow step on 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”

Shows a Dataverse Update Record action in Power Automate where the table Process Logs is updated with the status succeeded
Update the Process Log

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.

Shows the BPF Cloud Flow step which now is succeeded if you update the Process Log record.
Succeeded Cloud Flow Run

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.

Shows the options you can choose when updating the status of a Process Logs record inside Power Automate. The values are: Canceled, Failed, In Progress, Succeeded and Waiting
Available values to choose from

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 StatusProcess Logs Status
FailedCanceled, Failed
ProcessingIn Progress, Waiting
SucceededSucceeded
Mapping of the Cloud Flow Step statuses and the Process Logs statuses

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.

Shows an animated gif of a Business Process Flow with a Run Flow step. The Run Flow step is required. The video shows how we want to move to the next stage but it is blocked as the Flow step is in the status "Processing". Once the Flow has run the status changed to "Succeeded" and we can move to the next stage
Cloud Flow Step is now required

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!

Leave a Reply

Your email address will not be published.