Missing fault path in flows
Why is this an issue?
Flows that interact with the Salesforce database or call external actions can fail at runtime. When a Get Records, Create Records, Update Records, Delete Records, or Action element fails without a defined fault path, the entire flow crashes with an unhandled fault error. This results in a poor user experience and can leave data in an inconsistent state.
By adding a fault connector to elements that can fail, you can gracefully handle errors, log diagnostic information, and display user-friendly messages instead of cryptic system errors.
Examples
Example of incorrect code: The following flow excerpt shows a record update element without a fault connector.
<recordUpdates>
<name>Update_Account</name>
<connector>
<targetReference>Success_Screen</targetReference>
</connector>
<inputAssignments>
<field>Status__c</field>
<value><stringValue>Active</stringValue></value>
</inputAssignments>
<object>Account</object>
</recordUpdates>
Example of correct code: The following flow excerpt includes a fault connector that routes to an error handling element.
<recordUpdates>
<name>Update_Account</name>
<connector>
<targetReference>Success_Screen</targetReference>
</connector>
<faultConnector>
<targetReference>Error_Handler</targetReference>
</faultConnector>
<inputAssignments>
<field>Status__c</field>
<value><stringValue>Active</stringValue></value>
</inputAssignments>
<object>Account</object>
</recordUpdates>
How can I fix violations?
To fix this violation in Flow Builder:
Select the element that was flagged (a record operation or action call).
Click Add Fault Path in the element's configuration panel.
Connect the fault path to an error handling element, such as a screen that displays a user-friendly message, or an assignment element that logs error details for debugging.
When should I disable this rule?
You may dismiss specific violations for flows where an unhandled failure is acceptable, such as non-critical background processes where silent failure is preferable to partial completion. However, adding fault handling is generally recommended for all database operations.
Resources
