Schedule Triggered Flow in Salesforce

In Salesforce, we use a Schedule-Triggered Flow to schedule operations like sending an Email or creating a Task. The Schedule-Triggered Flow launches at a specific time for each record in that batch.

In this Salesforce tutorial, we will learn about Creating a Schedule Triggered Flow through the following points:

  • What is Schedule-Triggered Flow in Salesforce
  • Use Schedule-Triggered Flow in Salesforce
  • Create a Schedule Triggered Flow in Salesforce

What is Schedule-Triggered Flow in Salesforce

The Schedule-triggered flow is a flow that will get executed at a specific time and repeated at specific frequencies (intervals) for each record in that batch. When we want to perform any automated task and execute it frequently, once, daily, or weekly, with specific meeting criteria, we can use schedule trigger flow.

Sometimes, we need to perform a type of automation to maintain the organization’s data or complete routine tasks (for example, sending a reminder email) at a scheduled time or frequency; at that time, we can use schedule trigger flow.

This flow runs in the background, so unlike the screen flow, the user doesn’t interact with it.

Use of Schedule-Triggered Flow in Salesforce

  • When we want to schedule any task with flow automation, such as sending an email or creating a task and executing it frequently, once, daily, or weekly, with defined criteria, we can use schedule trigger flow.
  • By using the Schedule-triggered flow, we can avoid writing code in Apex triggers in some conditions.
  • In real-time use cases, Scheduled-Triggerd flows are generally used to send customers and users birthday emails, surveys, and reminders.

Create a Schedule Triggered Flow in Salesforce

Let’s understand this flow with the help of a scenario where we will create a reminder Task for the currently open Opportunities using the Schedule-triggered flow.

Suppose we set the frequency daily to run this schedule-triggered flow. Then, it will create a task for all open opportunities every time.

To avoid recreating tasks for previously open opportunities, create a Checkbox field “Task created” in the Opportunity object. When the Task Created field is true, the flow will not recreate the reminder task for those opportunities.

Follow the below steps to create a Schedule Triggered Flow.

1. On the Setup page, go to the Quick Find box and search, then select Flows.

Scheduled trigger flow in Salesforce

2. In the flow setup, click on the New Flow button.

3. Select the option Start from Scratch and click Next. In the next window, select Schedule Triggered flow and click the Create button.

how to create a schedule triggered flow

4. In the flow builder, set the Start time, Start Date, and Frequency for the flow to trigger.

Scheduled trigger flow salesforce

5. Click Choose Object in the flow canvas, and select the Opportunity object.

How to schedule a flow in salesforce

6. In the Filter Conditions, set the following conditions to filter the open opportunity records.

FieldOperatorValue
StageNameNot equals toClosed won
StageNameNot equals toClosed lost
Task_created_cequals to False
schedule trigger flow salesforce

7. Add a Create record element to the flow. Enter the Label for the create record element, then in the field “How to set record field values,” select Manually.

In the Object field, select Task and map the following fields and values.

FieldValue
WhatId (related id)Record > Opportunity ID
OwnerIdRecord > Owner ID
SubjectEnter task subject
StatusSelect Task Status
PrioritySelect priority level
schedule triggered flow salesforce

8. Add an Update Record element to the flow to update the checkbox field task_created_c as ‘True‘ so that when the flow triggers at the next interval, it won’t trigger for the Opportunity records in which a task is already created.

Enter the label for the Update Record element. Under How to Find Records to Update and Set their Values, select the first option, ‘Use the $Record global variable.’

In the section Set Field Values, set the value Task_Created_C as True.

Salesforce Scheduled trigger flow

9. Save the flow with the relevant label.

Schedule a trigger flow in Salesforce

10. Click the Activate button in the flow builder to activate the flow.

Create a Scheduled trigger flow in Salesforce

Now, according to the scenario, the Schedule trigger flow will start from the specified date and run daily at the time intervals we selected while configuring.

Check the Task object for the scheduled date and time. You will see that the Reminder task has been created for all the open Opportunities.

How to use Schedule trigger flow in Salesforce

This way, we can create and use the Schedule-Triggered flow in Salesforce.

Conclusion

In Salesforce data management, schedule trigger flows are helpful when you need to automate creating or updating records at regular intervals or when you want to schedule any automation using the flows.

In this Salesforce tutorial, you might have gained insights about the Schedule triggered flow and its use in Salesforce. Following the above steps, you can create a schedule-triggered flow in your Salesforce instance.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.