Custom Notifications
Custom Notifications are admin-defined notification types that Flow, Apex, or process automation can fire to specific Salesforce users via the desktop notification bell, the Salesforce mobile app push channel, or both.
Definition
Custom Notifications are admin-defined notification types that Flow, Apex, or process automation can fire to specific Salesforce users via the desktop notification bell, the Salesforce mobile app push channel, or both. Each notification type carries a title, body, and a target record URL that opens when the user clicks. Custom Notifications replaced the older Push Notification API as the modern way to send alerts without writing Apex.
A Custom Notification Type is metadata: configured in Setup, deployed across orgs like any other metadata. The notification itself is sent at runtime via the Send Custom Notification action in Flow, the Messaging.CustomNotification class in Apex, or the REST API. The receiving user sees a desktop notification through Salesforce Lightning Experience and a push notification on the Salesforce mobile app, with the receiving channels controlled by the notification type's configuration. No code is required for the most common use cases.
How Custom Notifications send targeted alerts to specific users without custom Apex
Notification Type metadata and the two channels
Each Custom Notification Type is a metadata record defined under Setup, Notification Builder, Custom Notifications. The type specifies a name, an API name, and which channels are supported: Desktop (the bell icon in Lightning Experience) and Mobile (the Salesforce mobile app push). You can enable one or both per type. Mobile push requires the recipient's device to be registered with Salesforce mobile and the user to have granted notification permissions on the device. Desktop notifications fire instantly through Lightning's notification framework.
Firing notifications from Flow
The Send Custom Notification action is a standard Flow Builder action. Configure it with the Notification Type (pick from the list of types defined in Setup), the recipient (user, group, or set of user IDs), the title, the body, and a target record ID. The action runs in any flow context: record-triggered, screen, scheduled, autolaunched. Recipients can be a single user, a public group, a queue, or a comma-delimited string of user IDs. Title and body support merge fields from the flow variables, so the notification is personalized per recipient.
Firing notifications from Apex
The Messaging.CustomNotification class is the Apex equivalent. Instantiate it, set the type ID, title, body, target ID, and target page reference, then call send(Set of user IDs). The class supports bulkified sends; one call can notify up to 500 users at a time. Use the SOQL query SELECT Id, CustomNotifTypeName FROM CustomNotificationType WHERE DeveloperName = ''YourType'' to find the type ID. The send method runs synchronously by default; wrap in Queueable for high-volume bulk operations.
Notification routing and the user notification settings
Each user can mute or enable notification types under their personal Notification Settings. A muted type for a given user is silently dropped at send time; the Apex method returns success but the user never sees the alert. Admins cannot override per-user mute settings without a UserPreference update. This catches admins who configure a notification, test as themselves, see it work, and then field complaints from users who muted the type because the org started with too many notifications enabled by default.
Target page reference and click-through behavior
Every notification carries a target record ID or page reference. When the user clicks the notification, Salesforce opens the target in a new tab. For records, pass the standard 15- or 18-character record ID; Lightning resolves the right record page automatically. For custom destinations (a specific tab, an external URL, an LWC page), build a PageReference object in Apex or use the Flow URL formula to construct the target. Without a target, the notification is informational only and clicking does nothing useful.
Limits and throttling
Per-org limits cap Custom Notifications. The 500-recipient cap per send call is per notification, not per minute; you can send to thousands of users by batching. There is a daily org-level cap (currently 100,000 notifications per 24 hours) that scales with edition. Exceeding the cap silently fails after the limit; build error handling that checks the response and queues retries. The cap is rarely an issue for normal operational alerts but matters for bulk notifications during major business events.
Custom Notifications versus the older Push Notification API
Two notification systems coexist. The Push Notification API (PushNotification class in Apex, around since API 23.0) is the legacy path; it requires Connected App configuration, mobile app registration, and code for every send. Custom Notifications is the modern declarative path. The two are not interoperable; a Custom Notification Type cannot be sent via the Push Notification API and vice versa. New work should use Custom Notifications. Legacy code using the Push Notification API still works but does not benefit from the declarative routing.
Creating a Custom Notification Type and firing notifications
Setup work has two halves: define the notification type in metadata, then wire up Flow or Apex to send notifications using that type. Type definition is one-time; the send wiring is per-use-case.
- Create the Custom Notification Type
Setup, Quick Find, Custom Notifications. New. Enter a name (Approval Required), an API name (Approval_Required), and select supported channels (Desktop, Mobile, or both). Save. The type is now available to flows and Apex.
- Wire up the Flow action
Flow Builder, add Action, search Send Custom Notification. Pick the type. Set the recipients (single user, public group, queue, or comma-list of IDs), the title (supports merge fields), the body, and the Target ID (typically the triggering record's Id). Activate the flow.
- Or wire up Apex
Query the type ID, instantiate Messaging.CustomNotification, set typeId, title, body, targetId, then call send(Set of UserIds). Bulkify by passing a Set with up to 500 IDs per call. Wrap in Queueable for higher volumes.
- Test as the recipient
Switch user to a recipient or use Login As. Confirm the notification appears in the bell icon. Click through to verify the target page resolves. Test mobile separately by triggering from a device where the Salesforce mobile app is installed and notifications are enabled.
- Audit user notification settings
Each user can mute notification types in their personal settings. After rollout, check user adoption; muted notifications fail silently. Communicate the new notification type to users before enabling it on production data.
Desktop, Mobile, or both. Desktop covers the Lightning bell icon. Mobile covers iOS and Android push through the Salesforce mobile app. Enabling Mobile without device registration leads to silent drops.
Single user, public group, queue, or set of user IDs. Flow exposes all four; Apex takes a Set of IDs and resolves group or queue membership at send time.
Record ID for the click-through. Lightning resolves the page type from the record prefix. Custom destinations (tabs, URLs) require building a PageReference object instead.
Setup, Notification Builder controls which standard and custom types are available org-wide. Disabling a type here hides it from all users without deleting the metadata.
- Users can mute notification types in personal settings. Muted types silently drop on send; the Apex call returns success.
- Mobile push requires the Salesforce mobile app installed, registered, and with notification permissions granted on the device. Otherwise the notification only appears on the desktop bell.
- The 500-recipient-per-call cap requires batching for larger audiences. The platform does not auto-batch; you have to chunk the set yourself.
- Custom Notifications and the older Push Notification API are independent. Migrating from one to the other requires rewriting the send logic.
- Title and body are limited to 80 and 750 characters respectively. Long messages truncate silently on mobile push.
Trust & references
Cross-checked against the following references.
- Custom Notifications OverviewSalesforce Help
- Send a Custom NotificationSalesforce Help
Straight from the source - Salesforce's reference material on Custom Notifications.
- Messaging.CustomNotification Apex ReferenceSalesforce Developer Docs
- Flow Send Custom Notification ActionSalesforce Help
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. Can a Salesforce admin configure Custom Notifications without writing code?
Q2. In which area of Salesforce would you typically find Custom Notifications?
Q3. What is the primary benefit of Custom Notifications for Salesforce administrators?
Discussion
Loading discussion…