drop, cool backgrounds, 4k wallpaper 1920x1080-3698073.jpg

Salesforce Flow Automation: Standardized Fault Path Error Messaging

Salesforce Flow Automation: Standardized Fault Path Error Messaging

Salesforce Flow includes a powerful feature called fault paths, but it’s rare to see it implemented in any organization. The fault path allows you to send a message or initiate an action when a Salesforce Flow encounters an error on a pink DML node (Create, Update, Delete). However, taking full advantage of this feature requires configuring an error response for each individual node in your Flows, which can be time-consuming and tedious. As a result, many users skip this step.

If you’re not subscribed to APEX exception emails, you’ll miss out on notifications about Flow errors entirely. Even if you do receive these emails, it can be challenging to decipher what went wrong. 

To simplify this process, I will show you how to set up a subflow that triggers whenever any node encounters an error, automatically sending you a standardized fault email. This approach will save you a significant amount of time and hassle.

Let’s get started.

  1. Create a new Auto Launched Flow in Salesforce.
  2. Create a Variable resource
    1. API Name = FlowCurrentRecord
    2. Data Type = Text
    3. Check the Available for Input box
  3. Create another Variable resource
    1. API Name = FlowFaultMessage
    2. Data Type = Text
    3. Check the Available for Input box
  4. Create a Text Template resource
    1. API Name = EmailBody
    2. Body = 
      1. There is a fault in a flow affecting this record: {!FlowCurrentRecord}.
      2. Message: {!FlowFaultMessage}
      3. Please address
  5. Add an action node to the Flow
    1. Choose the Email category and the “Send Email” action. Label it how you wish
    2. Under the Body input action, add the {!EmailBody} text template resource you created earlier.
    3. Under the Recipient Address List input action, put in a comma-separated list of email addresses of your recipients.
    4. Under the Sender Type input action, type in “DefaultWorkflowUser”
    5. Under the Subject input action, type in “There’s a Flow error in the [company name] org”
  6. Save the Flow, label it “ALF: Fault Line Error Email”, and Activate it.

 

In any subsequent Flow you create, on any pink DML node for Create or Update actions, complete the following actions:

  1. Add a fault path
  2. Add a Subflow action and select the Auto Launched Flow you just created
  3. Label it “Send Fault Email”
  4. Type in {!$Flow.CurrentRecord} in the FlowCurrentRecord input value
  5. Type in {!$Flow.FaultMessage} in the FlowFaultMessage input value
  6. Save and Activate.

 

You now have a custom fault email set up to notify you whenever a create or update node in a Flow encounters an error. This email will specify which Flow experienced the error and provide the error message. Most importantly, it will be much easier to understand than an APEX Exception Email.

**Special bonus** Add additional input variables to the EmailBody to include the location of the node that errored out. You get more specific error messaging than Salesforce deems worthy to grace its certified Admins with.

You’re Welcome.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

On Key

Related Posts