top of page


There are several ways to advance your Business Process Flows (BPF) in an automated manner: server-side or client-side. In the first part of the blog, we were able to see how to advance it on the client-side using JavaScript, and now we will see how to advance it using Power Automate.

Advancing the BPF on the server-side.

To do this within the environment of our solution, we will create a cloud flow.

Following the example from the first part of the blog, we will advance the BPF when the record is created and when the "mar_stage" field is changed. Then, we will simply incorporate the GUIDs of the BPF stages.

To obtain these GUIDs, you will need to execute the following in a browser window:$select=stagename&$filter=processid/workflowid eq <processID>

Substituting the highlighted fields with our own, this will display the following:

           "stagename":"Stage 4",
           "stagename":"Stage 1",
           "stagename":"Stage 2",
           "stagename":"Stage 3",

In this code, we will find the GUIDs of the stages that we will have in the BPF in order to prepare our automations and make the process progress.

We will incorporate these GUIDs into compose actions or variables.

The next step is to obtain the related BPF for the record that we will obtain in the trigger. To do this, we will incorporate the "List rows" action and filter by the GUID of the trigger record.

_bpf_mar_expedienteid_value eq RecordID

Next, we will use the "Parse JSON" action to retrieve the values of the tags from the output of this action. The output is an array, so in the "Content" field of the "Parse JSON" action, we will add the following expression to prevent it from adding an "Apply to each" loop since we expect only one BPF per record.


To generate the schema with the output of the "Get_BPF" action, you can follow these steps:

In the following image, we can see the actions commented on so far.

Finally, we will need to create a switch statement, similar to what we did in code in Part I of the blog, but this time using Power Automate.

With a "Compose" action and the following expression that concatenates the value of the current traversedpath of the process and the GUID of the stage, we will compose the new traversedpath based on the value of the "mar_stage" field.


It is important that at the end, we update the table of our BPF to advance this process, indicating in the record identifier (Row ID) the value of the "businessprocessflowinstanceid" obtained from the "Parse JSON" action.

As a recommendation, at the end of the process, you can incorporate an action that completes the BPF and deactivates the record. If it is an Opportunity in Dynamics 365, you can create a closing activity for the Opportunity.


bottom of page