You are here:
Create the Product Limit Alerts Flow
Create a scheduled flow to monitor product limits and send custom notifications when usage thresholds are crossed.
Before you begin, did you complete the recommended preparation tasks in Manage Product Limits Threshold Alerts and Notifications?
This flow automates product limits monitoring for your org by using the Create Product Limit Alerts action. You set threshold percentages (like 75%, 80%, or 100%). Then you configure which users receive notifications when each utilization threshold is reached or exceeded. The flow runs on a schedule you define—daily, weekly, or at whatever interval meets your needs.
The following steps outline one way that you can build this flow. We’ve included suggested naming conventions for your resources and actions to keep the setup logical and intuitive. Following this guidance also helps to ensure that the flow is easy to follow, test, and maintain.
- From Setup, find and select Flows.
- Click New Flow.
- Select Scheduled Automations, then Schedule-Triggered Flow.
- Indicate a future date, then select how often the flow runs.
Create Resources to Store Notification Type and Recipient IDs
Resources store values for use in elements during flow execution.
-
Click the Toggle Toolbox icon (1), then click New Resource.
-
Create the notification type ID resource.
Resource Type Constant API Name NotificationTypeId Data Type Text Value Custom notification ID. See Create a Custom Notification Type for information on how to obtain the ID. - Click Done.
-
Click New Resource to create a resource to collect recipient
IDs.
Resource Type Variable Name NotificationUserIds Data Type Text Checkbox Allow multiple values (collection) - Click Done.
You use these resources when building your flow (2).
Assign User IDs to the Notification User IDs Resource
This part of the flow indicates the user IDs to notify when the alerts trigger.
-
Click Add Element
under the Schedule element, then select Assignment.
-
Gather your list of notification recipient IDs (005x), then build the list in the
flow.
Label Assign Notification User IDs Variable NotificationUserIds Operator Add Value <005x user ID> - (Optional) Click Add Assignment to add more user IDs.
Create Alerts for the Product Limits
This part of the flow indicates which product limits to monitor and the thresholds that trigger the alert notifications. It’s built upon the Create Product Limit Alerts invocable action.
-
Click Add Element
under the Assignment element.
-
In Search, find and select Create Product Limit Alerts.
Create Product Limit Alerts creates Utilization Alerts when utilization crosses a threshold and marks existing Utilization Alerts as “Cleared” when utilization drops below the threshold.
Label Create Product Limit Alerts Product Limits A list of Product Limits that are enabled in the org. Select which Product Limits to create Utilization Alerts for when a threshold is reached or exceeded. Utilization Thresholds (%) A whole number that represents the percentage of utilization that is reached or exceeded before a Utilization Alert is created. Defaults are 80 and 100. Click the X to remove a default value, or add other thresholds, if required.
Next, retrieve the alert records. -
Click Add Element
under the Create Product Limit alerts element, then find and select Get
Records.
Get Alert Records retrieves the Utilization Alert records to determine which alerts the flow created and which threshold triggered each one.
Label Get Alert Records Salesforce Object Utilization Alert Filter Utilization Alert ID Operator In Value {!Create_Product_Limits_Alerts.createdAlertIds} -
For How Many Records to Store, select All records.
Loop Through the Alert Records
This part of the flow iterates through the retrieved alert records to determine which have been triggered so the appropriate users can be notified.
-
Click Add Element
under the Get Alert Records element, then find and select
Loop.
Label Alert Collection Variable Utilization Alerts from Get Alert Records -
Click Add Element
under For Each, then find and select Send Custom
Notification.
Here, you indicate the details for the notification messages. You reference the resources that you created for the custom notification type and the list of recipients, indicate the text of the notification, and set the Target ID to the record that the notification links to.
Label Send Notification Custom Notification ID NotificationTypeId Notification Body {!Alert.AlertScope} has exceeded {!Alert.TriggerValue}% Notification Title Product Limits Alert Triggered Recipient IDs NotificationUserIds Target ID {!Alert.Id}
-
(Recommended) Debug and test the flow.
See Salesforce Help: Testing Flows for details.
- Save and activate the flow.
