The Alerter Subflow
Summary
The Alerter Subflow is a reusable subflow designed to handle all email and notification alerts.
By creating a single, centralized flow for alerting, you can ensure consistency across automation processes and reduce duplication. Other flows can easily invoke this subflow by providing the required input variables.
Objective
To create an Autolaunched Flow that can send either an email or a notification, depending on the input provided.
Before You Begin
Make sure you have the following:
Permission to create and modify Flows in Salesforce.
Access to create or reference a Custom Notification Type (for notifications).
Step 1: Create an Autolaunched Flow
From Setup, navigate to
Process Automation → Flows → New Flow.Select Autolaunched Flow (no trigger) and click Create.
Step 2: Define the Variables
Input Variables (Available for Input)
Create the following variables to make them available for other flows to populate:
Variable Name | Data Type | Description |
| Text (Collection) | List of User IDs to receive the alert |
| Text | The content or message body |
| Text | The subject line for the alert |
| Text | The related record ID (optional) |
| Text | Determines the alert type ( |
Internal Variable
Create the following internal variable (not available for input):
Variable Name | Data Type | Description |
| Text | Used internally to store email addresses in text format |
Tip: Name your flow descriptively — for example, Alerter or Send Alert Subflow.
Step 3: Add a Decision Element
Add a Decision element to the flow and name it Determine Alert Type.
Configure it to evaluate the
typevariable:If
type = email→ Go to the Email Branch.If
type = notification→ Go to the Notification Branch.
The decision block, which checks for the type variable value, email or notification
Step 4: Configure the Email Branch
When the alert type is email, the subflow must translate User IDs into email addresses, since email delivery requires explicit addresses.
Get Records:
Loop Through Users:
Add a Loop element to iterate through the retrieved user records.
Assign Email Addresses:
Inside the loop, create an Assignment element.
Concatenate each user’s email address into the
recipientsEmailAsTextvariable, separated by commas.recipientsEmailAsText = recipientsEmailAsText + currentUser.Email + ","
Send Email:
Add a Send Email element.
Populate it with the following variables:
To Address:
recipientsEmailAsTextSubject:
subjectBody:
bodyRelated Record ID:
targetId
Tip: You can enhance this branch later by adding rich text support or including templates.
Step 5: Configure the Notification Branch
To send a notification, you first need a Custom Notification Type.
Create the Custom Notification Type:
Navigate to Setup → Notification Builder → Custom Notifications.
Click New, define the notification, and note the Developer Name.
Retrieve the Notification Type:
Add a Get Records element to retrieve the Custom Notification Type by its Developer Name.
Store only the ID field.
Send Notification:
Add a Send Notification element and populate it with:
Notification Type ID: From the Get Records element
Recipient IDs:
recipientIdsTitle / Message:
subjectandbodyTarget Record:
targetI
Step 6: Save and Activate the Flow
Click Save and give your flow a clear name (e.g.,
Alerter_Subflow).Click Activate to make the subflow available for other flows to call.
Result
You now have a fully functional Alerter Subflow that can:
Send emails by converting recipient IDs to addresses, or
Send notifications through Salesforce’s in-app system.
Other flows can now call this subflow by passing in the appropriate variables, streamlining how alerts are sent across your org.
This is what your diagram should look like:
Related Resources
Have any questions or concerns? Feel free to reach out to your Customer Success Manager!








