As Dynamics 365 CRM’s native feature, we can call on-demand workflows from inside a business process flow. We can configure this from the new business process flow designer, by dragging a workflow component to a process stage, or to the Global Workflows section.
As you know, we have written a blog on global workflow where we can find its basic information. In this blog, we are continuing this by exploring global workflow with detailed steps.
An on-demand workflow from inside a business process flow executes as usual on Stage Exit of a stage but it does not work, if we call on-demand workflow from on stage exit of a last stage of business process flow.
When we include a workflow that we want to trigger on Stage Exit of a stage in business process flow, and that stage is the last stage in the flow, the designer gives the impression that the workflow will be triggered when that stage is completed. However, the workflow will not be triggered because a stage transition does not take place when BPF is finishing from last stage and not moving to previous stage. We will not receive a warning or error preventing us from including the workflow on that stage. When a user interacts with the business process flow, finishing or abandoning the process does not result in a stage transition, and therefore, the workflow is not triggered.
Consider the following examples:
- We create a business process flow with two stages, “Identify” connects to “Research,” with a workflow on stage “Research,” and set the trigger to Stage Exit.
- We create a business process flow with three stages, “Identify” connects to “Research,” then “Research” branches to “Resolve.” We include a workflow on “Research” and set the trigger to Stage Exit. When condition does not match, then stage does not move to “Resolve.”
The workflow will not trigger in either case.
As shown in below screen shot, on demand workflow on stage “Research,” does not trigger on stage exit, when we click Finish button. My on demand workflow sets the value of Remark field on stage exit of “Research” stage.
To work around this issue, we have added a Global Workflow, and added the workflow which we want to trigger to it so that the workflow is triggered for the business process rather than a stage of the process.
After updating the BPF, as shown in above image, reload the form and click “Finish” button on BPF, and last stage is “Research.” Now workflow triggered as expected.
Also, we can set the trigger for a Global workflow to Process Abandoned or Process Completed to cause the workflow to trigger when a user abandons or completes the business process.
An on-demand workflow from inside a business process flow executes as usual on Stage Exit of a stage. However, it does not work if we call on-demand workflow from stage exit of a last stage of business process flow and finish the business process. For this we need to set the trigger for the Global workflow to Process Completed to cause the workflow to trigger when a user completes the business process.
Cut short 90% of your manual work and repetitive data entry!
Get 1 Click apps and say goodbye to all repetitive data entry in CRM –
Click2Clone – Clone/Copy Dynamics 365 CRM records in 1 Click
Click2Export – Export Dynamics 365 CRM Report/CRM Views/Word/Excel template in 1 Click
Click2Undo – Undo & Restore Dynamics 365 CRM data in 1 Click