Streamlining Salesforce Approval Processes with Flow Automation

Salesforce is a powerful platform that empowers organizations to manage their business processes efficiently. One critical aspect of business operations is approval processes. However, it can be frustrating when approval processes become stuck, causing delays in decision-making. In this blog post, we will explore how to use Salesforce Flow to automatically approve open approval processes older than a week and send reminders to unresponsive approvers after three days. These automation techniques will ensure that your approval processes flow smoothly and don't get bottlenecked in the system.

Understanding the Requirements:

Our client has two specific requirements for their approval processes:

1. Automatic Approval After One Week:

- When an approval process remains open for more than one week, it should be automatically approved to prevent delays in critical business decisions.

2. Reminder for Unresponsive Approvers:

- If an approver doesn't respond to an approval request within three days, they should receive a reminder to ensure they don't overlook pending approvals.

The Solution: Leveraging Salesforce Flow

Salesforce Flow is a versatile and user-friendly tool for automating business processes. It allows you to build and execute workflows that can interact with approval processes seamlessly. Let's see how we can implement these two requirements using Flow:

1. Automatic Approval After One Week:

To automatically approve open approval processes older than a week, follow these steps:

a. Create a New Flow:

- In Salesforce Setup, navigate to the Flow Designer and click “New Flow” and choose “Scheduled”.

b. Schedule the Flow:

- Schedule the flow to run at a specific interval (e.g., daily) to identify and approve aged approval processes.

c. Add Elements to the Flow:

- Build a flow that queries for approval processes that have been open for more than a week.

- Use a "Get Record" element to retrieve the relevant approval requests where status is “Pending”.

- Use a “Loop” element onto the canvas to loop through the records that match the filter criteria.

- Inside the Loop, use a "Decision" element to check if the approval process has been open for more than a week.

- Use “Assignment” element to assign each records to Record collection

- After the last loop iteration, use the “Apex Action” element to automatically approve open approval processes and pass required parameters(e.g. Record IDs) to the Apex Method.

d. Activate and Test

Automatic Approval

Figure 1: Automatic Approval After One Week Flow

approval process using Apex

Figure 2: Above method is used to automatically approve the approval process using Apex (Assumptions: Opportunity Object is used, Approval Process is already set on the Opportunity.)

ProcessInstanceWorkitem workItem : [Select p.Id from ProcessInstanceWorkitem p where p.ProcessInstance.TargetObjectId =: targetObjectId])

- As you can see, we need to query the object “ProcessInstanceWorkitem“ to get workitemId of the object (In our case targetObjectId is Opportunity’s Record Id).

2. Reminder for Unresponsive Approvers:

To send reminders to unresponsive approvers after three days, follow these steps:

a. Create a New Flow:

- In Salesforce Setup, navigate to the Flow Designer and click “New Flow” and choose “Scheduled”.

b. Schedule the Flow:

- Schedule the flow to run at a specific interval (e.g., daily) to identify and remind unresponsive approvers.

c. Add Elements to the Flow:

- Use a "Get Record" element to retrieve pending approval requests.

- Use a “Loop” element onto the canvas to loop through the records that match the filter criteria.

- Inside the Loop, Use the “Decision” element to check if there are approvers who have not responded within 3 Days.

- use “Assignment” element to assign ApproverId to Record collection

- If the approval request is overdue, use the "Send Custom Notification" element to send a reminder to the approver.

- use “Assignment” element to remove ApproverId from Record collection

d. Activate and Test:

Reminder-for-Unresponsive-Approvers

Figure 3: Reminder for Unresponsive Approvers

Custom Notification sent

Figure 4: This is a screenshot of an actual Custom Notification sent

Benefits of Using Flow for Approval Process Automation:

1. Efficiency: Automating approval processes reduces the time and effort required for manual monitoring and intervention.

2. Consistency: Flow ensures that approval processes are handled consistently and according to predefined rules.

3. Transparency: Flow provides visibility into the status of approval processes, making it easier to track and manage them.

Conclusion:

By leveraging Salesforce Flow, organizations can address the common challenges of approval processes getting stuck and unresponsive approvers. Implementing automatic approval after one week and sending reminders after three days streamlines business operations, enhances efficiency, and ensures that critical decisions are made without unnecessary delays. Salesforce Flow is a valuable tool for achieving these objectives, and it empowers businesses to take control of their approval processes, keeping them in motion and driving productivity.

For any queries please reach out to support@astreait.com