Invoking Messaging with a Flow

You can use Salesforce Flows to invoke messaging for the declarative automation you have built. This action can be specified to execute an Apex action on an object, and you can define criteria associated with the object to determine when the action must be performed.

Creating an Immediate Custom Action

To create a custom action that is executed immediately:

  1. Navigate to Setup | Process Automation | Flows.
  2. Click New Flow to open the Flow Builder.
  3. In Flow Builder, locate the canvas where you can design your flow. On the left side, you will find the palette containing various elements.
  4. Drag and drop the required object onto the canvas from the palette.
  5. Configure the object element to specify the criteria that will trigger the flow, and click Save to save the changes.
  6. Drag the Record Update element from the palette onto the canvas.
  7. Configure the record update element based on your requirements, such as specifying the fields to update and their new values.
  8. Add any additional elements you need, such as decision elements, assignment elements, or email alerts, by dragging and dropping them onto the canvas.
  9. Test the flow to ensure its accuracy and required behavior using the Debug feature in the Flow Builder.
  10. Once the flow has been thoroughly tested and meets your requirements, click Activate in the upper-right corner of the Flow Builder to activate it.

Creating a Scheduled Custom Action

To create a scheduled custom action:

  1. Follow steps 1-6 of Creating an Immediate Custom Action.
  2. Click the palette and drag the Scheduled Path element onto the canvas.
  3. Configure the scheduled path element with the required criteria to determine when the action must execute.
  4. Click Save.
  5. Proceed with steps 7-11 of Creating an Immediate Custom Action.

Adding Criteria to an Active Process

To add more criteria to an active process clone it, make the changes you want and then activate it.

  1. Clone the active flow that you want to add more criteria to.
  2. Make the required changes to the cloned flow.
  3. Activate the cloned flow.
Note:

The active flow will be automatically deactivated, and the cloned flow will be activated.

By following these steps, you can create custom actions using Salesforce Flows, specify Apex actions, and add criteria to determine when the actions must be executed.

Using Record-Triggered Flows for Sending FDN Messages

In most cases, you opt for a record-triggered flow when sending FDN (Flow-Driven Notification) messages. Follow these steps to set up your flow:

  1. Navigate to Setup | Process Automation | Flows.
  2. Click New Flow to open the Flow Builder.
  3. Select the Record-Triggered Flow.
  4. Select the Trigger Object. Typically, you will choose the object from which the message will originate. This is often the source object in your message.
  5. Configure the Trigger.
    Tips: We recommend you use the Create and Update and Action and Related Records options for optimization.
  6. Click Done.
  7. Add an Action Element. For more information, see the Salesforce Help.
  8. Add the Action element to your flow.
  9. Configure the Action.
  10. In the search area, type deliver, this will narrow down the search options to the two we provide:
    • Send FDN Messages Asynchronously: This is used with a scheduled job to define when messages are sent. For more information, see Scheduling Message Delivery.
    • Send FDN Messages Synchronously: Sends messages as soon as the record is triggered.
  11. Specify a name for your Action.
  12. Populate the Publication Field.
    Notes: In the Action configuration, you populate the Publication field with the Identifier value associated with your message type’s publication.
    For more information see, Publication and Subscription Fields.
  13. Specify the Record ID. As a standard flow-building behavior, specify the record ID from where your flow is initiated. This ensures that the flow operates on the correct record.
  14. Click Done.
    Note: If you have specific criteria for determining which records should trigger this flow, define them in the start block, where you specify the object.
  15. Connect your flow then Save, Test and Activate accordingly. For more information on how to view your newly created flow in Messaging, see Relationship Activation Overview.