The auto launched flow is a sub flow that can called from other flows, DML operations, if any platform event occurs, and process builders.
In this Salesforce tutorial, we will learn about auto launched flow in Salesforce. In that, we will discuss the following points:
- What is auto launched flow in Salesforce?
- Example 1- create auto launched flow in Salesforce.
- Example 2- create auto launched flow in Salesforce.
What is Auto Launched Flow in Salesforce
In Salesforce, the auto launched flow cannot run itself; it needs to be called by another tool, such as flow, apex, process builder, REST API, and more. This auto launched flow runs in the background.
The auto launched flow does not require any user interaction. It acts like a sub flow to other flows.
Uses of Auto Launched Flow in Salesforce
- Suppose we have a task to create multiple flows and need the functionality that needs to be performed by all the flows; then, we can use an auto launched flow as a sub flow that comprises the functionality required by all flows.
- The auto launched flow will run in the background. We can’t use any UI element on this one; it will just execute the logic.
- The auto launched flow saves time, and we don’t need to create the same functionality repeatedly. It also helps us build a very simplified flow.
Example 1- Create Auto Launched Flow in Salesforce.
For example, we have a screen flow and a record trigger flow. Now, the requirement is that we need to send an email from both flows.
- One option is to send an email from both flows individually by creating an Email Action on both flows.
- The second option is instead of creating an email action on both flows, we can use the auto launched flow as a sub flow. On this flow, we will create an email action, and then we will call it from other flow whenever we need.
Prerequisites:
- We need a screen flow where we can create a record and then email the user to confirm the account’s creation.
- But we don’t create email action on the screen flow. We will call sub-flow, which is the auto-launched flow for sending an email.
We will create the auto-launched flow in Salesforce using the above scenario and the following steps.
Edit Screen Flow in Salesforce
1. We need to send an email when the account is created. For this, we need two things: the Recipient’s Email address and the Email Body.