Akihiro Iwaya Explores Approval Use Case in Flow Orchestrator


Flow Orchestrator takes a wide range of rich, sophisticated, and complex business process use cases that require code today and makes them easy to create with clicks. It makes it possible to automate multi user processes so I try to verify if Flow Orchestrator replaces the standard approval process.

Use case

A SaaS company provides various products with their customers. They give free trials for their products to their prospects and manage this process using a custom object called “Free Trial”, which contains Start Date of trial, End Date, Products, and related Opportunity.

The Sales VP would like all Free Trial requests to be routed controlled by an Approval Route table which is a custom object and it to be routed with serial and parallel mode.


  • Send an email to approvers
  • Lock & unlock a record
  • Three Approval Steps
    • Serial mode : same as standard approval process
    • Parallel mode
      • Majority Wins
      • CEO Overrides where a particular approver can override the majority
  • Approval History 
  • Approval Route
  • Custom Notification for only parallel mode

Demo Video


AI Approver Screen

This is a screen flow where an approver decide to approve or reject and return result parameter (approved is 1 otherwise 0)


AI Requester Screen

This screen flow receives is_approved (boolean)  and recordId (string) as input parameters and update a Free Trial record’ status based on is_approved value. In case it is rejected, Apex action for unlocking the record is executed. Finally it shows whether the approval process is accepted or rejected to a requester. This implementation looks weird to you because the status of the record is updated after the requester executes this screen flow. Yes, it does. The current Flow orchestrator supports only screen flow. We can not hook up an event where three approvers complete their decisions for parallel mode (send approval request to approvers simultaneously) Do not worry about it. Flow orchestrator will support Autolaunched Flow soon. Once it comes true, we can get rid of updating and unlock record logics from this screen flow.


AI Submit Approval Process Action

Custom action of Free Trial record calls this screen flow. After requester completes to submit for approval process, Submit_Approval__c of the target Free Trial record is set to true. This triggers AI Approval Process Orchestration.


AI Parallel Approval Decision Flow

One of my favorite features of Flow orchestrator is that we can customize how a step or a stage will be triggered or considered complete. We can invoke an evaluation flow to evaluate the entry condition of a stage or step. This flow is an evaluation flow for parallel mode. An evaluation flow must be Autolaunched Flow and returns isOrchestrationConditionMet parameter (boolean). Since autolaunched flow can query objects and make API calls via Apex , execute logic, and so on, you can make complicated decision logic.

The flow receives parallel decision mode (Majority wins or CER overrides), role names for three approvers, three approver’s decisions, and “from approved stage” ( boolean value, from approved stage or rejected stage) as input parameters and returns isOrchestrationConditionMet boolean value. The current Flow orchestrator does not support evaluation flow within the Decision element so I need “from approved stage” input parameter so that only proper step is triggered. I will jot about this at AI Approval Process Orchestration section below.


AI Approval Process Orchestration

It is Record-Triggered Orchestration where object is Free Trial and condition is Submit_Approval__c Equals true. It orchestrates AI Parallel Approval Decision Flow, AI Submit Approval Process Action, AI Requester Screen, and AI Approver Screen.

Serial mode


Parallel mode


As I mentioned necessity of “from approved stage” input parameter at AI Parallel Approval Decision Flow section. I want to execute either a Work step named “Approved” or “Reject”. For instance, AI Parallel Approval Decision Flow returns true at Work step named Approved and do false at Work step named Rejected under approved Free Trial record. 


Not implemented

  • Recall approval process
  • Assign Queue
    • This can be implemented using Select Id from Group where type=’Queue’ and Name=’Queue Name’ and Select UserOrGroupId From GroupMember where GroupId =:Id  but complicated
  • Custom Notification for serial mode
    • Supporting Autolaunched Flow will fix easily


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. 

You want to try?


  • Unlimited, Enterprise, Developer Editions have Flow orchestrator enabled

Package Installation 

  1. Check https://youtu.be/DhnkMsQwImA at youtube for install package
  2. Go to https://sforce.co/3qEh40g 
    1. Enter your credentials for your org
    2. Select “Install for All Users” at Install AI Flow Orchestration Approval Process screen and hit Install button

Post Installation

  1. Setup → Process Automation → Process Automation Settings
    1. Check “Allows Apex code to set and remove approval process locks. Enable record locking and unlocking in” checkbox
    2. Hit Save button
  2. Setup → Users → Profiles
    1. Search “Demo Salesforce Platform” profile
    2. Hit edit link
    3. Check the both “Run Flows” and “Send Custom Notifications” checkboxes
    4. Hit Save button
  3. Setup → User Interface → Path Settings
    1. Hit “Enable” button
  4. Create three “Salesforce Platform” user license users with “Demo Salesforce Platform” profile
    1. By Hand
      1. Role must be specified and one of three must be CEO role
      2. image.png
  1. By Apex code
    1. Open developer console
    2. Debug→ Open Execute Anonymous Window
    3. Aki.createUsers(‘YOUR_REAL_EMAIL_ADDRESS’); and Hit Execute button
    4. You will receives password reset emails for three users at YOUR_REAL_EMAIL_ADDRESS.
    5. image.png
  1. Select “Approval App” at App Launcher
  2. Select “Approval Route” tab
    1. Hit New button
    2. Create a Approval Route record
      1. Approval Route Name : High Priority
      2. Approver1 : one of users created at post installation step
      3. Approver2 : one of users created at post installation step
      4. Approver3 : System Admin user

Demo Steps


  1. Login in as the user which is not in the Approval Route record you defined
  2. Select Approval App at App Launcher
  3. Select Free Trial Tab
    1. Hit New button
    2. Fulfill fields
      1. Opportunity in the form is a custom object because  “Salesforce Platform” user license user can not access standard Opportunity
    3. Hit Save button
  4. Hit Approval Process Action
    1. Fulfill all fields because I do not implement proper error handling ;(
  5. Check if the record is locked


  1. Login in as the user based on the selected Approval route record
  2. Select Approval App at App Launcher
  3. Select Free Trial Tab
  4. Select the record
  5. Enter your decision at the Work Guide

# The custom notification is not implemented for serial mode and you need to refresh a Free Trial detail page to change status after requester confirms at Work Guide

Uninstall Package

Since the uninstall package contains flow orchestrator, you need to delete some components manually first.

Please check https://youtu.be/mwIVAZb9pVA at youtube for uninstall the package