Flow
Flow: structured error handler with retry
A reusable Fault path pattern that logs errors to a custom Error_Log__c object, then optionally retries the failed step.
// Pseudocode for the Flow pattern - implement in Flow Builder.
// Element graph:
// Trigger
// -> Try (subflow / action)
// -> Fault
// -> Create Records: Error_Log__c
// { Flow_API_Name__c, Error__c = $Flow.FaultMessage,
// Record_Id__c, Retry_Count__c }
// -> Decision: Retry_Count__c < 3
// -> Yes: Wait 60s, then loop back to Try
// -> No: EndNotes
- Always set Retry_Count__c = 0 on first run; increment on each fault.
- For Apex actions called from Flow, throw AuraHandledException so the FaultMessage is human-readable.