When we create a flow in Salesforce, we often encounter situations where a flow attempts to automate a process but fails due to reasons such as missing or incorrect field data.
In this situation, without error handling, the flow stops, and we are unable to determine the cause of the error. Here, we can utilize the fault paths in Salesforce flow.
In Salesforce flows, a fault path can catch the error and store it in a custom object or send an email alert to the administrator, allowing them to resolve the issue without stopping the entire flow.
In this tutorial, we will learn how to add fault paths in Salesforce Flow to identify the exact error, understand their importance, and utilize them effectively with a real-world example.
What are Fault Paths in Salesforce Flow?
When we create the flow and debug it, it will work fine at that time. However, if any data is changed outside of the flow we created, the flow does not execute properly, and the automated process breaks silently.
Additionally, we didn’t receive the proper error message, and we cannot easily identify which element is causing the issue. For that, we have a feature called Fault Paths in Salesforce Flow.
Similar to a try-catch block in exception handling used in programming languages, we add fault paths to the element where we are using DML operations or where we have developed logic for the flow.
If the flow fails, these fault paths provide us with proper details about the error. Using that, we can easily find the error and resolve it to execute the flow smoothly.
Where can we display errors using Fault Paths in Salesforce Flow?
To display the error that we catch from the fault paths, we can use the following options:
- Screen Flow: When creating the screen flow and displaying an error, we can add a fault path to the element where the error occurs. Then we can add a screen component that displays a proper reason or error message on the screen.
- Send Email: Using the Send Email action, we can send a fault error message to the admin or a specific user.
- Store Error: To display errors instead of just showing them, we can store the error details in an object with the flow name, error message, and other relevant information. This is very helpful for tracking errors, rather than frequently debugging the flow and checking for errors.
Add Faults Path in Salesforce Flow
Below, I will explain in detail how we can add fault paths in Salesforce Flow. Before that, we will understand the use case and the prerequisites to create the flow, and then we will develop the flow accordingly.
Use Case:
To automate the applicant screening process and handle errors effectively using fault paths, I have created a custom object named Job Application__c.
Whenever a new job application record is submitted, the system should:
- Assign a task to the active Hiring Manager user. If the user is inactive, send an email to the owner of the job application record.
- If the user is active, then create the task for that user. Also, add the fault path for the creating task element.
- If an error occurs while creating a task, record the error and send the error details to the administrator.
- After creating the task, create the record for the candidate whose application gets selected.
Prerequisites:
I have created a profile named ‘Hiring Manager’ with a Salesforce License and assigned an active user to that profile.

After that, I created a custom object to store the error details generated from the fault path in flows. You need to create the custom fields to store the flow, record, and error details.

Create Record Trigger Flow:
Since we want to assign a task when a new job application record is created, we need to use the record trigger flow.
To create the flow, navigate to Setup -> in Quick Find search for Flow -> New Flow -> Start From Scratch -> select the Record Trigger Flow -> Next.
In the start element, we have to select the triggering object. In our scenario, Job Application__c is a triggering object because it is created when the user creates a new job application record. For that, in the Configure Trigger, we need to select A record is created.

Then, add a condition: the Status (Job Application field) equals ‘New’. Then, I selected “Actions and Related Records” in the “Optimize the Flow” option.

First, we need to retrieve all the job applications stored in the Job Application object. For that, we need to add the Get Records element and enter a Label and API Name.

After that, again, we need to add the Get Record element to retrieve the user records who are active and assigned to the Hiring Manager profile.
In the Object select User. Then, to filter the user records, add a condition. Here, I provided the Profile ID = ID (number).
To get the profile ID, enter the following query in the query editor of the developer console:
SELECT Id, Name FROM Profile WHERE Name = 'Hiring Manager'After that, add another condition ‘Active = True’ because we only want the active users so that we can assign the task to them.

Next, we need to check whether the user we are getting is active or not. If the user is active, we will assign a task to them; otherwise, we will inform the record owner by sending an email.
For that, we need to add a Decision element and provide the OUTCOME ORDER. Here, I provided ‘Found (active user)‘ and ‘Not Found‘. We can add multiple outcome orders as per our requirement.
Then, for each outcome order, we need to add a condition. For the Found outcome here, I added the following condition:
Get Record (Label) > Profile ID Is Null False. That means if the record element is not empty, then the Found outcome will be executed.
Otherwise, the Not Found outcome will be executed.

Next, in the Found outcome, we need to assign a task to the hiring manager user. For that ass create record element under the found outcome.
Here we are creating a task record. For that, in the Object, we need to select the Task object.
After that, we need to set the field values for the task. As you click on the Fields, you will see all the fields from the task object. To create a task, you need to select the fields to which you want to assign values.
Below, I have explained the fields and values to create a task:
- Subject: I created a Text Template Resource for the subject. To do this, click New Resource. In the Resource Type, select Text Template. Provide the API Name. Then add the subject.
- Assigned To ID: Here, we need to provide the ID of the person you want to assign the task to.
- Related To ID: About which record we are going to assign this task.
- Status: This is a picklist field from the task, allowing you to select the desired status.
- Due Date Only: Here, I also create a Formula Resource to provide the next 5 days due date after creating a task.

After finding the active user, we assigned the task to them. Now, if we do not find active users, we need to send an email to the record owner, informing them that there is an active user in the Hiring Manager profile.
For that, add the Send Email action under the Not Found outcome decision. Here you need to select the field values to send an email, such as sender email, subject, body, recipient address, etc.
In the body, we inform the record owner that there is no active user associated with the profile.

What if we got an error while creating the task? So, to identify the exact error, we need to add the Fault Path to create the task element.
To add the fault path, click the three dots, and you will see the “Add Fault Path” option. Click on it.

Store Flow Errors in Object:
To display errors instead of just showing them, we can store the error details in a custom object, including the flow name, error message, and other relevant information.
This is very helpful for tracking errors, rather than frequently debugging the flow and checking for errors.
For that, add the Create Record element and select the object where we want to store the error details. We need to select manually in the set records field values.
After that, in the Object, select the Flow Log Error that we created. Then set the field values for the object.
The fields you will get from the object, and we need to set the values from the $Running Flow Interview global variable.
To store flow details and flow errors, select the global $Flow resource. There, you will find the details to set the field values.

Send Flow Errors Via Email:
Additionally, if you need to report flow details or errors, please send them to the administrator.
Add the Send Email action, and to add the error message and other information, click Insert a resource. Then, select the global $Flow resource. There you will see the Fault Message.

Now, add Transform Element, where we transfer the record from the job application to the candidate profile object.
Next, we have two options: Source Data and Target Data.
- Source Data(Where the data comes from):
- We can use source data to select the values that we want to transform or map to another object.
- This data or records we already have in the flow. Here we have a job application (record collection).
- Target Data(Where the data will go):
- We use target data to determine where the data or record will be directed.
- This data we want to create or send after the transformation. Here is the candidate profile (object) records we want to create.
To select the source data, click the + icon and select the record, collection, variable, or Apex-defined data that matches your data source.
Here, we have created a collection in the Get Record (Get Applications) section. You can see that after selecting the source data-related fields, they are also visible to map with the target data.
Next, click the + icon in the Target Data. There, we need to configure the resource.
Here, we want to create a record for a specific object. For that, in the Data Type select Record. Check the Allow multiple values and choose the Object to which you want to create the record.

After selecting the target data, you will see the fields related to the selected object. Here we have candidate profile object fields.
Next, we need to map the fields from the source data to the target data. For that, you need to select a field from the source data, and in the target data, with which field you want to map, click on that field.
In this way, we need to map fields so that when the record gets transferred from source to target, the value gets assigned to the mapped fields.

After mapping the fields, we need to create the record for those that get transferred from the source to the target data.
To do this, add the Create Record element, providing a Label and API Name. After that, in ‘How to set record field values‘, we need to select ‘From a Record Variable‘. Because in the target data, we configured the resource to allow multiple values.
Then, in the Record Collection option, we need to select the transfer element (the label we provided to the transfer element).

Now we are ready to save the flow. For that, click the Save button, provide the flow Label, and the API Name will be automatically populated.
After that, always debug the flow before activating it to ensure that the working flow is correct and that there are no runtime errors. Then activate the flow.

Proof of Concept:
After activating the flow, navigate to the Job Application tab to create a new record that will trigger the flow. Additionally, we need to set the Status field to ‘New‘ according to the condition defined in the flow.

As you save the record to check whether the assigned task is to the Hiring Manager user, we need to log in with Jimmi Anderson, who is an active user.
Since the user is active, the task is successfully assigned to the user with the Task field values that we assigned in the flow.

Also, check the Flow Log Error object tab; is any error stored there? Because a task is assigned to a user, it means that no errors have been encountered in the workflow.

Now, let’s intentionally make changes to the create task element so that we can trigger the error, check the error message, verify if the error is stored in the object, and send an email to the admin.
In the Create Task element, I have changed the Assigned to ID, which is a required field on the task, and I provided a random User ID, which is invalid. And again, save the flow.

Again, I created the record to trigger the flow.

Additionally, as I log in with a user, you can see that we only have one task assigned, which is for the record that we created previously. That means, for the record, that the record we just created will not be assigned.

To determine the cause of the record not being assigned to the user, we can refer to the Flow Log Error object, which provides details about the flow and the error that occurred to prevent the task from being assigned.

Also, you can see the Admin received an email with the flow error details, so that the Admin can resolve that error.

In this way, we can add fault paths in Salesforce flow to determine the exact error that occurred in the flow.
Conclusion
I hope you have got an idea about how to add fault paths in Salesforce Flow to identify the exact error, understand their importance, and utilize them effectively with a real-world example.
I have explained the use case and how to store errors in a Salesforce custom object, as well as how we can send them to the admin via a flow.
You may like to read:
- Send HTML Emails Using Salesforce Flow
- Run Flow as Another User in Salesforce
- Flow User Checkbox vs Run Flows in Salesforce
- Wait Element in Salesforce Flow
- Use Formulas in Salesforce Flow
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.