Site icon UnofficialSF

From Akihiro Iwaya: Adding Approval Functionality to Orchestrator

Akihiro-san has done some of the most in-depth early consumption of Orchestrator. Here he demonstrates a number of techniques for lighting up approval processes.

Orchestrator goes GA in Spring ‘22 with new enhancements!!

I have been exploring the use of Orchestrator for approvals use cases. Previously I concluded that  “I have confidence in replacing the approval process with Flow Orchestrator because I believe that new functionalities related to the approval process will be available at GA. My implementation of the approval process is a little bit complicated because of lacking standard functions such as supporting Autolaunched Flow, recall approval process (back to previous stage), standard actions (lock & unlock record, get queue member) but I am very excited to continue to watch new features.

In this post I’ll look more deepily at approvals use cases using the GA Orchestrator feature set. I will show three approval process examples using a simplified Employee Time Off Application with minimum automated actions. 

Examples

Automatically assign an approver using the manager field in User.

The second example is using the new enhancement of “Assignment to Queues and Groups”. Submitter and the first approver can choose either a user or a queue. 

The final example makes use of the new enhancement of “API access to trigger Orchestrations”.  Submitters can select one of the orchestrators to initiate new orchestration on Screen flow calling Apex action. This is a great enhancement because the user dynamically chooses any orchestrator on the fly. At this Example, the submitter selects a route table record containing three approvers and serial or parallel orchestrator during submit for approval. Again you can add functionalities that are implemented at case1 and case2.

Example 1: Simple Approval Process1 using the Manager Field

The first example is very simple and familiar with the legacy approval process. Automatically assign an approver using a manager field in the user table. There are only two approval steps but you can add more steps.

Features

Video

Creating Custom ‘Lock Record’ Behavior using Record Type

When the user clicks on this custom Submit for Approval button, the record type of the underlying record is changed. There are two record types, new and read-only with corresponding page layout

. This allows for these behaviors:

Custom Notification

The Messaging Notification(?) action is used to generate custom notifications:

Work Guide Usage

Approval is done in the Work Guide, where conditional field visibility shows only the necessary fields:

Approval History

Approval History items are logged to enable the full history to be easily views:

Recording

Orchestration

Example 2 Approval Process Using Queues/Groups

The second example highlights the abillity of Spring ‘22 Orchestrator to “Assignm to Queues and Groups”. This example doesn’t provide a way to  return the approval request to other approvers but you can easily add that as was shown in  Example1.

Features

Choosing a Queue with a Custom ‘Submit for Approval’ Flow

Recording

Orchestration

Example 3 :User Can Dynamically Choose The Next Approvers

The final example demonstrates the power of the new feature  “API access to trigger Orchestrations”.  Submitters can select one of the orchestrators to initiate new orchestration on Screen flow calling Apex action. This is a great enhancement because the user dynamically chooses any orchestrator on the fly. 

To enable this, I created a custom object called  a route table where I can configure different combinations of approvers:  

Features

When the record is submitted, this version of the orchestration let’s them choose between Serial and Parallel, and lets them choose one of the predefined routes:

Serial mode

Parallel mode

Recording

Orchestration

Serial mode

Parallel mode

Legacy Approval Process Features

There are legacy approval process features and corresponding implementation ideas on Orchestration. 

Create an Approval Process with the Standard Wizard

There are three ways to implement “No one can edit a record after submit for approval except admin” functionalities in my examples. The legacy approval process allows administrators to edit or the both administrators and the assigned approver to do. In case you need that the assigned approver also edit a record, “Changing record owner” may be one you take. Before assigning a work item to an approver, the record owner is updated to the approver in flow.

Add an Approval Step to an Approval Process

Automated Actions to an Approval Process

Prepare Your Org for Approvals

Approval History Reports

Manage Multiple Approval Requests

Approval Requests for Users

Conclusion

Orchestrator CAN be a replacement of the legacy Approval Process and implemented with a more complicated scenario. But in case the legacy approval process supports your requirement, then implement it by legacy one. Otherwise you develop your own approval process on Orchestrator. Before Approval Process Flow Templates will be officially distributed, we utilize a hybrid of the legacy and orchestrator for the approval process.

Exit mobile version
Skip to toolbar