Multiple Scheduled Actions Within a Single Flow!

Multiple Scheduled Actions Within a Single Flow!

Last Updated on April 2, 2023 by Rakesh Gupta

Big Idea or Enduring Question:

How do you schedule multiple emails with Salesforce Flow? 

Objectives:

In this article, the reader will learn the following:

  • How to use Salesforce Flow to send multiple email alerts using Scheduled Paths
  • and much more

Business Use case

Pamela Kline is working as a System Administrator at Gurukul on Cloud (GoC). At GoC they are using Salesforce Flow to streamline Sales Processes. Pamela received a requirement – as soon as a Case is closed, do the following tasks:

  • Send a follow-up email to the customer 2 days after the Case Closed Date is populated.
  • Send a satisfaction survey to the customer 15 days after the Case Closed Date.

Automation Champion Approach (I-do):

Salesforce Flow is one of the most powerful tools provided by Salesforce to implement business requirements declaratively. By using it, one can minimize usage of codes in their Salesforce org. The best part is, you do not have to write test classes for your Flows! Implementation of Salesforce Flow is very easy – you create a Flow, test it, and then use a Change Set to deploy it to Production. To achieve mastery of Salesforce Flow, you have to understand its capabilities – such as, calling an Apex class, etc. Today we will discuss one of Salesforce Flow’s features – Scheduled Paths.

With Scheduled Paths, it is easier to – (1) optimize sales responsiveness; (2) automate follow-up actions on important Cases and Opportunities; and (3) support your business needs – all within a single process!

Before discussing the solution, let me show you a diagram of the process at a high level. Please spend a few minutes going through the following Flow diagram to understand it.

It is quite easy to create two processes to solve the above business requirement; however, in this case, we will use one process to incorporate both the requirements!

Let’s begin building the automation process. 

Guided Practice (We-do):

There are 5 steps to solve Brenda’s business requirement using After-Save Record-Triggered Flow. We must: 

  1. Create an email template for follow-up email
  2. Create an email alert for follow-up email
  3. Create an email template for satisfaction survey email
  4. Create an email alert for satisfaction survey email
  5. Salesforce Flow Steps:
    1. Define flow properties for record-triggered flow
    2. Add a scheduled path
    3. Add action – follow-up email alert
    4. Add action – satisfaction survey email alert

Step 1: Create an Email Template for Follow-up Email

  1. In the App Launcher, type Email Templates.
  2. Clicks on the New Email Template button
  3. Name the Email Template and,
    1. Select the Public folder to store it in.
    2. Select Case for the Related Entity Type.
  4. Add a Subject line and other relevant information for your recipients.
  5. Click Save.

Step 2: Create an Email Alert for Follow-up Email

  1. Click Setup.
  2. In the Quick Find box, type Email Alerts.
  3. Select Email Alerts, click on the New Email Alert button
  4. Name the Email Alert and click the Tab button. The Unique Name will populate. 
  5. For Object select Case.
  6. For the Email Template choose Follow-up Email
  7. For Recipient Type select Email Field: Contact Email.
  8. Click Save.

Step 3: Create an Email Template for Satisfaction Survey Email

  1. In the App Launcher, type Email Templates.
  2. Clicks on the New Email Template button
  3. Name the Email Template and,
    1. Select the Public folder to store it in.
    2. Select Case for the Related Entity Type.
  4. Add a Subject line and other relevant information for your recipients.
  5. Click Save.

Step 4: Create an Email Alert for Satisfaction Survey Email

  1. Click Setup.
  2. In the Quick Find box, type Email Alerts.
  3. Select Email Alerts, click on the New Email Alert button
  4. Name the Email Alert and click the Tab button. The Unique Name will populate. 
  5. For Object select Case.
  6. For the Email Template choose Follow-up Email
  7. For Recipient Type select Email Field: Contact Email.
  8. Click Save.

Step 5.1: Define Flow Properties

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows then click on the New Flow.
  4. Select the Record-Triggered Flow option, click on Create and configure the flow as follows:
    1. Object: Case
    2. Trigger the Flow When: A record is created or Updated
    3. Set Entry Criteria
      1. Condition Requirements: All Conditions Are Met (AND)
        1. Row 1:
          1. Field: IsClosed
          2. Operator: Equals
          3. Value: {!$GlobalConstant.True}
    4. When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
    5. Optimize the Flow For Action and Related Records
  5. Click Done.

Step 5.2: Salesforce Flow – Add Scheduled Paths

The purpose of using a scheduled path to send email alerts in different days.

  1. Under Start, select Add Scheduled Paths (Optional).
  2. Under Scheduled Path Details, enter the Label the API Name will auto-populate.
  3. Input the following information
    1. Time Source: Case: Closed Date
    2. Offset Number: 2
    3. Offset Options: Days After
  4. Click the + in the left-side panel to add a second Scheduled Path, and repeat Step 2.
  5. Enter the Label the API Name will auto-populate.
  6. Input the following information
    1. Time Source: Case: Closed Date
    2. Offset Number: 15
    3. Offset Options: Days After
  7. Advanced Options
    1. Batch Size: 200
  8. Click Done.

Step 5.3: Add Action – Follow-up Email Alert

The next step is to add follow-up email alert to the Flow. We will use the Action element.

  1. Under Follow-up Email node, select Action.
    1. Below Filter By, select Type
    2. Select the Email Alert.
    3. Select the Email Alert Follow-Up to Customer from the drop-down menu (the email alert which we created in Step #2)
  2. Label the new action Send Follow-up Email.
  3. Set Input Values
    1. {!$Record.Id}
  4. Click Done.

Step 5.4: Add Action – Satisfaction Survey Email Alert

The next step is to add satisfaction survey email alert to the Flow. We will use the Action element.

  1. Under Satisfaction Survey node, select Action.
    1. Below Filter By, select Type
    2. Select the Email Alert.
    3. Select the Email Alert Satisfaction Survey from the drop-down menu (the email alert which we created in Step #4)
  2. Label the new action Send Satisfaction Survey.
  3. Set Input Values
    1. {!$Record.Id}
  4. Click Done.

 In the end, Pamela’s Flow will look like the following screenshot:

Once everything looks good, perform the steps below: 

  1. Click Save.
  2. Enter Flow Label the API Name will auto-populate.
  3. Click Show Advanced.
  4. API Version for Running the Flow: 57
  5. Interview Label: Case Close Notifications {!$Flow.CurrentDateTime}
  6. Click Save.

Almost there! Once everything looks good, click the Activate button.  

Proof of Concept

Now onwards, when a support agent closes a case the processes will fire and schedule two actions.

  1. Navigate to Setup (Gear Icon) | Environments | Monitoring | Time-Based Workflow.
  2. Click Search.
  3. Now look for your Scheduled Flow job displaying information as shown in the following screenshot:
  4. Use the Delete button to delete the time-based Flow job from the queue.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

Preferred Timing(required)

6 thoughts on “Multiple Scheduled Actions Within a Single Flow!

  1. I don’t see a way to have multiple criteria that contain scheduled actions. For example, I want to one schedule action for a criteria and if that I was to move on to the next criteria and schedule a different action for this criteria. Am I right?

    As an alternative, even if I call a different process in the second criteria, I can’ schedule an action in a ‘called’ process. Can I?

  2. HI Rakesh,
    i have small doubt. is it possible Creating recurring time-based actions in workflow or process builder. i want fire the my workflow rule every day. is it possible or not?

    Thanks,
    Venkat.

      1. Hi Rakesh,
        Thanks for your quick reply.
        My requirement is i have one object on that one filed is picklist it contains the yes or no values and also another field that is end date. when ever end-date is cross automatically my picklist value change into no. I tried with work-flows but some times it is failed updating picklist value is no.

        can you please help me on this, if it is possible.

        Thanks,
        Venkat

        1. You do not need a recurring process. Here is my suggestion for you

          – Create a process that will fire when end-date is greater than today, while updating a record Update pick-list value.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Automation Champion

Subscribe now to keep reading and get access to the full archive.

Continue reading