Flow Error Handling
On Flow failure, Salesforce rolls back the transaction and sends an email with failure details but there is no ability to return the error details to CSV or REST response.
To allow better error handling and user experience the flow should have an output parameter with the name: FaultFlowMessage
All the create/update/delete/apex invocation flow elements should have a failure handling with the assignment of the $Flow.FaultMessage
Sub-Flows don’t have a failure path - in this case, Sub-Flow also should have a FaultFlowMessage
variable and parent flow needs to have a decision to check how the sub-flow finished.
The processing logic will check when FaultFlowMessage
when flow finished and when it’s populated the transaction will be rolled back and error details added in the CSV output or REST response.