This guide introduces the Cancel Selected Notifications with Flow action. This action provides a direct way for Flow builders to close specific notification messages by explicitly selecting which ones to close in the Flow itself.
The Close Message List action enables administrators to automate the closure of open notification messages (Sent Messages) by passing in a selected list of messages. Unlike the Find and Close Notification Message action, which dynamically searches for matching messages, this version puts full control in the hands of the Flow builder β you specify exactly which messages should be closed.
This action allows admins to close a list of selected notification messages. It's perfect for advanced Flow use cases where the messages to be closed are already known or have been identified earlier in the Flow logic.
The action performs the following:
IsClosedand IsAutoClosed to true.Steps:
ActOnIt__MessageRecipient__c records.isSuccess: Indicates if the closure operation was successful.errorMessage: Explains any problems that occurred.closedMessages: A list of messages that were successfully closed.Suppose you're creating a flow that sends and manages onboarding notifications. If a user completes onboarding early, you may want to cancel the remaining messages.
You could:
This gives you full control β only the messages you select will be closed.
After running the flow, inspect the output fields to confirm the operation:
isSuccess = true and closedMessages contains records, the action succeeded.errorMessage is populated, review it to understand what went wrong.Here are some example use cases for this action:
Q1: Can I use this without Flows?
Yes β this Apex action can be called programmatically, but it's built primarily for Flow usage.
Q2: What happens if a message is already closed?
It will be skipped. The action only closes messages that are still open.
Q3: Do I need to specify a reason?
No β but it's highly recommended. The reason is stored on the message for auditing.
Q4: Will the messages disappear from inboxes immediately?
Yes β hidden and closed messages should be removed from the interface shortly after the update.
Q5: Will it throw errors if the list contains invalid messages?
Only valid messages (open + with an Id) are processed. Others are ignored. If an error occurs while updating, it's logged, and other messages continue processing.
The Close Provided Notification Messages action gives administrators fine-grained control to close notification messages directly within Salesforce Flows. Use it when youβve already identified which messages to close and want to ensure precise, targeted cleanup of user inboxes.