Fault Path in Salesforce Flow

If your Flow includes a DML element such as Create, Update or Delete records, or a Submit for Approval core action, then there is a possibility that it might fail. For example, a create or update may fail if it does not pass the validation rule. And when the flow fails, Salesforce displays a standard message in red text that reads “An unhandled fault has occurred in this flow”. But with an error message like this, users will have no clue of what happened and if they did anything wrong.

A better option is to use something called ‘Fault’ path in Flow. Fault Path is also called Fault Connector or Fault Line. With Fault path, you can display a more meaningful message and guide users on what to do. To create a fault path, create a screen element with useful message and connect it to the DML element. 

Customize the Error Message

For screen element you can use  ‘Display Text’ or ‘Display Image’ components to make the error message visually appealing, pun-intended and in-context. For e.g. you can add an emoji with some stylized text to inform users of the error that happened. 

Taking Error Handling to Next Level

With Fault path, you are not restricted to just displaying a custom error message. You can also add other components of Flow such as

  • Assignment Element – To capture some information in a variable
  • Text Template Resource – To draft a template with variable values to be used in email
  • Send Email Core Action – Use the values from variable to send an email with error details to system administrator
  • Create Records Element – to create a Case and assign it to your IT department

Error handling in Salesforce Flow seems like an interesting feature with multitude of possibilities. In this short guide we will be building on the Flow that we configured in the Step By Step Guide to creating Screen Flow in Salesforce. If you haven’t looked at the screen flow guide, I will recommend that you go through that post first, configure the Flow and then come back here to continue with this guide. In this guide you will learn how to:

  • Add a Static Resource in Salesforce
  • Add Fault Path to Flow Element
  • Test Custom Flow Error Message

and it won’t take more than 10-15 minutes of your time

Want to download this PDF or watch a training video? We are now offering a complete course on Salesforce Flows called “Mastering Salesforce Flows”. To find out more about the course and watch a free preview, please click here.

References & Useful URLs: