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!!
- Assignment to Queues and Groups
- Reassignment of Work Items
- Cancel a running orchestration
- API access to trigger Orchestrations
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
- Exampl 1: Simple Approval Process using the Manager Field
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.
- Example 3: User Can Dynamically Choose Next Approvers:
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
- Assign an approver using a manager field
- Return approval request to previous approver after final approval
- Track and view approval history
- Custom ‘Lock Record Behavior
- Custom notification
- Eemail notification
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
- The Submit for Approval button vanishes. This is enabled in part by the recently introduced Dynamic Actions, a feature that allows admins to choose which actions need to appear in the Highlights Panel on the object’s record page
- The new record type is linked to a read-only page layout, creating the effect of a Lock Record process.
- Additional Notes:
- There is one concern that required fields can not be Read-Only in the layout. Since those fields are always editable, I decided that no fields are required at this object.
- Replace “New” button : There are two reasons for replacement of New button. Users can not skip record type selection page for default new button and after hitting new button, screenflow shows record creation form with validation of required fields.
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
- choose a user or a queue
- approval history
- lock / unlock record
- custom notification
- email notification
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
- route table (custom object) containing three approvers
- choose either parallel or serial orchestrator
- return the approval process to other approvers at serial mode
- approval history
- lock / unlock record
- Change record owner to System User so that submitter and approvers can not edit
- custom notification
- email notification
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
- Control Which Records Apply to an Approval Process
- Record-Trigger Orchestration can narrow down records that can be part of the approval process with setting entry conditions
- Dynamic action can control action buttons on your record pages. You can set action visibility in order to hide/show your action button that executes your Autolaunched Orchestration
- Choose Approval Request Notification Templates
- Not supported yet
- Choose an Automated Approver Throughout an Approval Process
- Interactive steps of Orchestration support User Resources that associate a hierarchy field—such as the user’s manager
- Specify Who Can Edit Locked Records
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.
- Example1 : Dynamic action,record types, replace new button
- Example2 : Apex Approval Class
- Example3 : Change record owner
- Design the Approval Request Page
- You can design whatever you like on Screen flow for the approval request
- Specify Who Can Submit Records to an Approval Process
- Record-Trigger Orchestration can not set an entry condition with a hierarchy field. So you need to go a long way around to achieve it.
- flow action
- Dynamic action can control who can submit records to an approval process
- screen flow
- Update records element update field value
- Updating field value kicks your Record-Trigger Orchestration
- flow action
- Record-Trigger Orchestration can not set an entry condition with a hierarchy field. So you need to go a long way around to achieve it.
- Dynamic action can control action buttons on your record pages. You can set action visibility in order to hide/show your action button that executes your Autolaunched Orchestration
Add an Approval Step to an Approval Process
- Control Which Records Apply to an Approval Step
- You can utilize Decision element of Orchestration
- Identify Assigned Approvers for an Approval Step
- Orchestration with User, Queue, and Group resources implement most ways by the legacy approval process except two things.
- Difficult to implement delegate approval request to other
- When multiple approvers (Queue or Group) are selected, ONLY “the first response to the approval request determines whether the record is approved or rejected.” is supported by Orchestration
- Orchestration with User, Queue, and Group resources implement most ways by the legacy approval process except two things.
- Specify Rejection Behavior for an Approval Step
- You can utilize Background step of Orchestration
Automated Actions to an Approval Process
- Add Automated Actions to an Approval Process
- You can utilize Background step of Orchestration
- Groups of Automated Actions in an Approval Process
- You can manage automated actions in Autolaunched flow called by Orchestration
- Add an Existing Automated Action to Your Approval Process
- You can manage automated actions in Autolaunched flow called by Orchestration
Prepare Your Org for Approvals
- Let Users Respond to Approval Requests by Email
- Not supported yet
- Let Users Respond to Approval Requests from Chatter
- Not supported yet
Approval History Reports
- Fields Available for Approval History Reports
- Use the All Orchestration Runs list view to see all in-progress, cancelled, and completed orchestrations in your org. more detail
Manage Multiple Approval Requests
- Transfer Pending Approval Requests
- When an interactive step in an orchestration runs, it creates a work item and assigns it to a user, group, or queue. You can now reassign a work item that hasn’t been completed to a different user, group, or queue. more detail
- Remove Pending Approval Requests
- Not supported yet
Approval Requests for Users
- Withdraw an Approval Request
- You can now cancel in-progress orchestrations from the orchestration runs list view. more detail
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.