You are a Salesforce expert in Flow failure design. Your goal is to make Flows fail predictably, surface useful errors, and avoid silent rollback or bulk-data surprises. Flow failures are not just bugs — they are an architectural concern. A Flow without fault handling is a Flow that rolls back transactions, hides root causes, and turns one bad record into a batch-wide outage. The job of fault handling is to convert failures from "mystery at 3 AM" to "row 47 failed this validation, here's the log entry, here's the remediation."
This skill covers the full fault-handling design space: when to add connectors, how to shape the user message vs the diagnostic log, how to keep record-triggered flows bulk-safe when one record trips, and how to align the Flow's failure posture with the Well-Architected pillars (Reliability, Scalability, Operational Excellence). Use it for new-design, review, and troubleshooting work.
Before Starting
Check for salesforce-context.md in the project root. If present, read it first. Only ask for information not already covered there.
Gather if not available:
- Is the Flow record-triggered, screen, scheduled, auto-launched, or orchestration?
- Which elements can fail: DML, subflow, Apex action, email action, HTTP action, or managed-package invocable?
- What should happen on failure: user message, admin notification, error log, explicit termination, or transaction rollback?
- Is the Flow invoked in bulk through data load, integration (REST/SOAP/Bulk API), or upstream Apex?
- Is there an existing error-log object (
Application_Log__c, Flow_Error_Log__c, custom) or should one be proposed?
- Does the org have a fault-email recipient configured under Process Automation Settings?
How This Skill Works
Mode 1: Build from Scratch
For a new Flow that must fail predictably from day one.
- Inventory fallible elements before the happy path. List every
Get Records, Create, Update, Delete, Action, Subflow, and HTTP Callout element. Each is a potential fault source; each needs a routing decision.
- Classify failure severity per element. Validation failure (user-recoverable) vs platform limit (batch-wide impact) vs integration timeout (transient, potentially retry-able) vs managed-package exception (third-party, opaque).
- Choose the fault-routing pattern per element — see "Fault-Routing Patterns" below. Not every element needs a unique fault branch; several can converge on a shared error-logging tail.
- Design two messages per fault: the user-safe message (plain English, action-oriented) and the diagnostic detail (captures
$Flow.FaultMessage, element name, record id, user id).
- Keep record-triggered flows bulk-safe — query once outside loops, avoid per-record DML inside loops, verify after-save DML fan-out is within governor bounds at the expected input cardinality.
- Test five failure paths: happy path, validation failure, duplicate-rule failure, platform-limit failure (CPU or SOQL), and integration-action failure. Unit-test each with a controlled input.
- Wire observability: the error-log object, a notification (custom notification > email > push-to-chat), and a run-summary metric if the Flow runs in background (
FlowInterviewLog is the Salesforce-native place to watch).
Mode 2: Review Existing
For auditing a Flow that may already be in production.
- Single-pass map of every element against the fault-routing checklist below. Even one missing connector on a fallible element is a P0 finding.
- Verify user-facing messages are plain English. Any message containing
$Flow.FaultMessage raw, System. tokens, or HTML artifacts is a UX failure.
- Confirm diagnostic detail is logged separately. The raw
$Flow.FaultMessage must end up somewhere an admin can read later — error-log record, custom notification with attached detail, Chatter post to a triage group, or an email to an ops distribution list.
- Review after-save flows for DML fan-out. Count DML operations per interview; multiply by expected bulk cardinality; check against the 150 DML statements per transaction limit.
- Confirm subflows and invocable Apex fail observably. A subflow without its own fault handling can bubble a useless generic error to the caller. An invocable Apex that swallows exceptions silently is worse than one that throws.
- Check for fault-email recipient config at org level. If Process Automation Settings has no default workflow user, unhandled faults go to the org's automated workflow email — often a mailbox nobody reads.
- Flag any Flow that can fail silently. Silent failure is strictly worse than a loud failure; a loud failure at least gets noticed.
Mode 3: Troubleshoot
For a Flow that is already failing.
- Read
$Flow.FaultMessage from the Flow error email or FlowInterviewLog. This is the ground-truth error; everything else is interpretation.
- Identify the failing element (name and type). The error email includes the element name — use it.
- Classify the underlying cause: business validation (a Validation Rule fired — expected but perhaps not routed), platform limit (SOQL/CPU/DML exceeded — bulk issue), missing fault routing (the element simply has no fault connector), shared-transaction conflict (Apex + Flow contending for governor budget).
- Check whether the Flow is invoked in a shared transaction. Apex callers of invocable Flows share CPU + SOQL + DML budgets with the Flow's elements. One element's exhaustion can be another caller's fault.
- Add or repair the fault path BEFORE attempting any other optimization. Without fault routing, every future iteration is blind.
- If the failure is at scale, profile a single successful interview first (
FlowInterviewLog with debug logging) and multiply. Bulk failures are usually linear multiplications of a per-interview waste that wasn't visible at single-row volume.
Fault-Routing Patterns
Four canonical patterns. Combine them — most production Flows use a mix.
Pattern A: User-safe branch + diagnostic log
For user-facing screen flows and user-initiated quick actions.
[DML or Action]
├── Success → [Next business step]
└── Fault → [Assignment: userMessage = "We could not complete your request right now. Please try again or contact support."]
→ [Assignment: diagnosticDetail = {!$Flow.FaultMessage}]
→ [Create Records: Application_Log__c with diagnosticDetail + recordId + userId + elementName]
→ [Screen: show userMessage + link to support]
→ [End]
The user sees a message they can act on. The admin sees the raw fault detail in the log object.
Pattern B: Retry-once for transient failures
For HTTP callouts, integration actions, and other elements where the first failure may be transient.
[HTTP Action]
└── Fault → [Decision: is error code 5xx or timeout?]
├── Yes → [Wait 30s via Platform Event delay] → [HTTP Action retry]
│ ├── Success → [continue]
│ └── Fault → [log + notify + end]
└── No → [log + notify + end] // 4xx errors are not retried
Retry once. Retrying more than once inside a Flow is an anti-pattern — escalate to Platform Events or a separate scheduled retry Flow.
Pattern C: Continue-on-error for bulk safety
For record-triggered flows that need to survive one record failing out of many.
Per-record element in a loop
└── Fault → [Assignment: add record to failed_records collection with reason]
→ [continue to next iteration]
After loop:
→ [Decision: failed_records.size > 0]
├── Yes → [Create Records: Flow_Error_Log__c for each entry]
│ → [Send notification to admin]
│ → [End — successful records are committed]
└── No → [End]
Caution: this pattern only works if the individual element is INSIDE a loop. Record-triggered flows without an explicit loop process each record in a separate interview; Salesforce already handles the "one record fails, continue others" case at the interview boundary — but only if the per-interview Flow has a fault connector that ends cleanly.
Pattern D: Explicit termination
For critical-path flows where partial success is worse than total failure.
[DML or Action]
└── Fault → [Assignment: diagnosticDetail = {!$Flow.FaultMessage}]
→ [Create Records: Application_Log__c (if possible — but this may roll back too)]
→ [Send Email Alert via Email Alert action] // Decoupled from the transaction
→ [End — DO NOT suppress the error]
In Pattern D, the Flow's fault path ends WITHOUT suppressing the failure, so the transaction still rolls back. The log and the email alert are best-effort notifications. This is the right pattern for "order placement failed" — you don't want partial data committed.
Flow Fault Handling Rules
Elements That Must Be Treated as Fallible
| Element Type |
Typical Failure Modes |
Required Fault Routing |
| Get Records |
Query limit, unexpected empty result assumptions, too-many-rows |
Pattern A or C; assume zero rows + handle "not found" case explicitly |
| Create/Update/Delete |
Validation rule, duplicate rule, required field, record lock, FLS denial |
Pattern A (user-initiated) or C (bulk) |
| Subflow |
Downstream failure propagates up; managed-package subflows are opaque |
Parent calls with Pattern A; inner subflow should fault-handle its own elements |
| Apex or invocable action |
Thrown AuraHandledException, unhandled business error, governor exhaustion |
Pattern A; the invocable Apex itself should honor with sharing and FLS |
| HTTP action / external step |
Timeout (default 120s), auth failure, 4xx/5xx response, rate-limit |
Pattern B for 5xx/timeout; Pattern A or D for 4xx |
| Email action |
No active recipient, template reference invalid, org-level send-limit exhausted |
Pattern A — but NOT Pattern D for notification paths (losing the notification is worse than a partial send) |
| Send Custom Notification |
Notification Type not active, recipient reference invalid |
Pattern A; fall back to email or log-only |
| Platform-event subscribe |
Delivery miss, replay buffer expiry, subscriber session timeout |
Requires out-of-band monitoring; not a fault-connector concern at the Flow level |
Minimum Fault Pattern
Every fallible element must route to:
- A user-safe message or business-logic branch (Pattern A / C) OR an explicit termination decision (Pattern D).
- A diagnostic detail capture using
$Flow.FaultMessage — NEVER discarded.
- A log record, notification, or explicit observable termination decision.
For screen flows, the user must see a clear next step. For record-triggered flows, the support team must have enough context to diagnose rollback causes — minimum: failing record id, element name, timestamp, user id, fault message.
Error-Message Design
The UX cost of a raw fault message is real. Design two messages per fault:
| Audience |
Message content |
Example |
| User (screen flow) |
Plain English, action-oriented, no technical jargon |
"We couldn't save your changes. Please check the required fields and try again." |
| Admin (log + email) |
Full diagnostic detail preserved |
Element: Update_Case. Error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Priority cannot be set to Urgent without a justification. Record: 500xx00000ABCD |
| Integration (caller) |
Machine-parseable where the calling system needs to branch |
HTTP status + JSON body including fault code (FLOW_FAULT_VALIDATION_RULE, FLOW_FAULT_LIMIT_EXCEEDED, etc.) |
Raw $Flow.FaultMessage belongs in the admin audience only.
Bulk-Safety Deep Dive
Record-triggered flows fire once per interview; bulk DML (data load, integration, upstream Apex) triggers many interviews in a single transaction. Three bulk-safety risks dominate:
Risk 1: Repeated Get Records per interview
Every interview's Get Records counts against the transaction's 100-SOQL limit. For a 200-record load, 2 Get Records per interview = 400 SOQL calls — over the limit, every record in the batch rolls back.
Safer patterns:
- Query once outside the loop if possible (auto-launched flow called by a single
Get Records in a parent Flow).
- Use before-save logic for same-record reads (
$Record and $Record__Prior are free — no SOQL).
- Cache lookups via Custom Metadata or Platform Cache for reference data.
Risk 2: After-save DML fan-out
Each interview's DML elements count against the 150-statement limit. An after-save flow that creates 3 related records per source record hits the limit at 50 source records — far below typical data-load batch sizes.
Safer patterns:
- Aggregate the source records into one DML call via a Get-then-Update loop outside individual interviews (usually requires an invocable Apex to bulk).
- Move fan-out to async: Platform Event fire-and-forget, or schedule a Platform Event Flow for deferred creation.
- Reduce the fan-out — is every related record actually needed?
Risk 3: Invocable Apex not list-safe
An invocable Apex with a method signature void doWork(MyInputType input) and an @InvocableVariable on the INSTANCE level receives one call per interview. A method signature void doWork(List<MyInputType> inputs) receives ONE call per batch. The former fires 200 times in a 200-record load; the latter fires once.
Safer pattern: every invocable method used from a Flow should accept a List<T> of inputs and return List<Result>. Flow automatically aggregates and de-aggregates.
Bulk Safety Checklist
Fault Review Checklist
Recommended Workflow
Step-by-step instructions for an AI agent or practitioner activating this skill:
- Gather context — confirm the org edition, relevant objects, and current configuration state
- Review official sources — check the references in this skill's well-architected.md before making changes
- Implement or advise — apply the patterns from Fault-Routing Patterns above
- Validate — run the skill's checker script and verify against the Fault Review Checklist above
- Document — record any deviations from the canonical patterns and update the template if needed
Salesforce-Specific Gotchas
| Gotcha |
Why it bites |
| Missing fault connectors roll back more than one record |
In record-triggered automation, one unhandled error can fail the whole batch save. Highest-impact fault-handling gap. |
$Flow.FaultMessage is for diagnostics, not polished UX |
Log it or email it — do not dump it raw to business users. |
| Shared transactions still share limits |
Apex, Flow, and invocable actions consume the same governor budget. A Flow that works on UI edits may fail under Bulk API load when same-object triggers consumed SOQL budget first. |
| Screen flows and record-triggered flows need different failure design |
One is user-guided UX (must have a next step); the other is transaction safety (must not roll back good records). |
| Subflows do not isolate bad design automatically |
Fault handling still needs to exist at the calling boundary. A subflow fault connector handles failures THROWN by the subflow; it does not retroactively fix the parent. |
| Fault connectors on non-DML elements are easy to forget |
Assignment, Decision, and Loop elements don't have fault connectors — but the Action elements around them do. |
| Screen flow back-button can skip fault paths |
A user clicking back AFTER a fault can re-enter with state that doesn't match the fault branch's assumptions. Test explicitly. |
| Error emails go to the Process Automation user |
If that user is inactive or reassigned, fault notifications disappear silently until an outage exposes the gap. Audit annually. |
| Orchestration flows have their own fault semantics |
Stage-level faults are handled by stage transitions, NOT fault connectors inside the invoked flows. Don't mix paradigms. |
Proactive Triggers
Surface these WITHOUT being asked:
- Any DML or action element with no fault connector → Flag as Critical. This is an avoidable rollback risk.
- Generic system error shown to users → Flag as High. Replace it with a controlled message and a logged diagnostic path.
- Flow used in data-load contexts with repeated reads or writes → Flag as High. Bulk behavior must be reviewed before production use.
- Apex action used with no evidence of list-safe design → Flag as High. Invocable Apex can still fail at scale.
- No logging or notification on failure for background flows → Flag as Medium. Silent failures become support incidents.
- Fault-email recipient is inactive or unset at org level → Flag as High. Unhandled faults go to an unread mailbox.
- Retry loop with no termination bound → Flag as Critical. A retry-until-success loop inside a Flow is an infinite-loop risk masquerading as resilience.
- Different elements route to the same fault tail without discriminating source → Flag as Low. Not wrong, but it collapses diagnostics; recommend adding the source element name to the log record.
Output Artifacts
| When you ask for... |
You get... |
| Fault-handling review |
Missing connectors, bulk risks, message design findings, WAF pillar tagging |
| New Flow pattern |
Fault-routing structure + logging + user-facing guidance + bulk-safety math |
| Failure triage |
Root cause + smallest safe Flow redesign + prevention recommendations |
| Org-level fault posture |
Fault-email recipient check + error-log object inventory + FlowInterviewLog guidance |
Related Skills
- admin/flow-for-admins: Use it for broader Flow type decisions and admin automation design.
- flow/flow-bulkification: Companion skill — fault handling and bulk-safety are deeply coupled; missing fault connectors make bulk failures rollback-the-batch failures.
- flow/record-triggered-flow-patterns: Record-triggered fault semantics differ from screen flows — read that skill for the record-triggered-specific concerns.
- flow/scheduled-flows: Scheduled flow faults route differently (no user is present); specialized handling required.
- apex/governor-limits: Shared Flow and Apex transactions still need limit-aware design.
- apex/exception-handling-patterns: For Apex invoked from Flows — failures in invocable Apex are where many Flow faults actually originate.
- omnistudio/integration-procedures: Use it when the failure path belongs in OmniStudio orchestration rather than Flow.
1---2name: fault-handling3description: "Use when designing, reviewing, or troubleshooting Salesforce Flow fault handling, error logging, and bulk-safe automation paths. Triggers: 'fault connector', '$Flow.FaultMessage', 'flow failed', 'record-triggered flow rollback', 'screen flow error'. NOT for diagnosing a fault email you already got — use flow/flow-runtime-error-diagnosis. NOT for Apex exception handling — use apex/exception-handling."4category: flow5salesforce-version: "Spring '25+"6well-architected-pillars:7 - Reliability8 - Scalability9 - Operational Excellence10tags: ["flow-faults", "fault-connectors", "error-logging", "record-triggered-flow", "screen-flow"]11triggers:12 - "flow fails and rolls back the entire transaction"13 - "unhandled fault in record triggered flow"14 - "how do I catch errors in a flow"15 - "how do I send flow error notification to admin"16 - "bulk data load causing flow to fail on one record and roll back all"17 - "flow error email message is confusing to users"18 - "what happens when flow fails"19 - "flow fails fault path"20 - "fault path subflow"21 - "fault path in flow"22 - "fault path connector"23 - "subflow fault handling"24inputs: ["flow type", "failure points", "user impact"]25outputs: ["fault handling review", "error path recommendations", "bulk safety findings"]26dependencies: []27version: 2.0.028author: Pranav Nagrecha29updated: 2026-04-2830metadata:31 source: https://skillmd.com/skills/pranavnagrecha/fault-handling32---3334You are a Salesforce expert in Flow failure design. Your goal is to make Flows fail predictably, surface useful errors, and avoid silent rollback or bulk-data surprises. Flow failures are not just bugs — they are an architectural concern. A Flow without fault handling is a Flow that rolls back transactions, hides root causes, and turns one bad record into a batch-wide outage. The job of fault handling is to convert failures from "mystery at 3 AM" to "row 47 failed this validation, here's the log entry, here's the remediation."3536This skill covers the full fault-handling design space: when to add connectors, how to shape the user message vs the diagnostic log, how to keep record-triggered flows bulk-safe when one record trips, and how to align the Flow's failure posture with the Well-Architected pillars (Reliability, Scalability, Operational Excellence). Use it for new-design, review, and troubleshooting work.3738## Before Starting3940Check for `salesforce-context.md` in the project root. If present, read it first. Only ask for information not already covered there.4142Gather if not available:43- Is the Flow record-triggered, screen, scheduled, auto-launched, or orchestration?44- Which elements can fail: DML, subflow, Apex action, email action, HTTP action, or managed-package invocable?45- What should happen on failure: user message, admin notification, error log, explicit termination, or transaction rollback?46- Is the Flow invoked in bulk through data load, integration (REST/SOAP/Bulk API), or upstream Apex?47- Is there an existing error-log object (`Application_Log__c`, `Flow_Error_Log__c`, custom) or should one be proposed?48- Does the org have a fault-email recipient configured under Process Automation Settings?4950## How This Skill Works5152### Mode 1: Build from Scratch5354For a new Flow that must fail predictably from day one.55561. **Inventory fallible elements before the happy path.** List every `Get Records`, `Create`, `Update`, `Delete`, `Action`, `Subflow`, and `HTTP Callout` element. Each is a potential fault source; each needs a routing decision.572. **Classify failure severity per element.** Validation failure (user-recoverable) vs platform limit (batch-wide impact) vs integration timeout (transient, potentially retry-able) vs managed-package exception (third-party, opaque).583. **Choose the fault-routing pattern** per element — see "Fault-Routing Patterns" below. Not every element needs a unique fault branch; several can converge on a shared error-logging tail.594. **Design two messages per fault**: the user-safe message (plain English, action-oriented) and the diagnostic detail (captures `$Flow.FaultMessage`, element name, record id, user id).605. **Keep record-triggered flows bulk-safe** — query once outside loops, avoid per-record DML inside loops, verify after-save DML fan-out is within governor bounds at the expected input cardinality.616. **Test five failure paths**: happy path, validation failure, duplicate-rule failure, platform-limit failure (CPU or SOQL), and integration-action failure. Unit-test each with a controlled input.627. **Wire observability**: the error-log object, a notification (custom notification > email > push-to-chat), and a run-summary metric if the Flow runs in background (`FlowInterviewLog` is the Salesforce-native place to watch).6364### Mode 2: Review Existing6566For auditing a Flow that may already be in production.67681. **Single-pass map** of every element against the fault-routing checklist below. Even one missing connector on a fallible element is a P0 finding.692. **Verify user-facing messages are plain English.** Any message containing `$Flow.FaultMessage` raw, `System.` tokens, or HTML artifacts is a UX failure.703. **Confirm diagnostic detail is logged separately.** The raw `$Flow.FaultMessage` must end up somewhere an admin can read later — error-log record, custom notification with attached detail, Chatter post to a triage group, or an email to an ops distribution list.714. **Review after-save flows for DML fan-out.** Count DML operations per interview; multiply by expected bulk cardinality; check against the 150 DML statements per transaction limit.725. **Confirm subflows and invocable Apex fail observably.** A subflow without its own fault handling can bubble a useless generic error to the caller. An invocable Apex that swallows exceptions silently is worse than one that throws.736. **Check for fault-email recipient config at org level.** If Process Automation Settings has no default workflow user, unhandled faults go to the org's automated workflow email — often a mailbox nobody reads.747. **Flag any Flow that can fail silently.** Silent failure is strictly worse than a loud failure; a loud failure at least gets noticed.7576### Mode 3: Troubleshoot7778For a Flow that is already failing.79801. **Read `$Flow.FaultMessage` from the Flow error email or FlowInterviewLog.** This is the ground-truth error; everything else is interpretation.812. **Identify the failing element** (name and type). The error email includes the element name — use it.823. **Classify the underlying cause**: business validation (a Validation Rule fired — expected but perhaps not routed), platform limit (SOQL/CPU/DML exceeded — bulk issue), missing fault routing (the element simply has no fault connector), shared-transaction conflict (Apex + Flow contending for governor budget).834. **Check whether the Flow is invoked in a shared transaction.** Apex callers of invocable Flows share CPU + SOQL + DML budgets with the Flow's elements. One element's exhaustion can be another caller's fault.845. **Add or repair the fault path BEFORE attempting any other optimization.** Without fault routing, every future iteration is blind.856. **If the failure is at scale**, profile a single successful interview first (`FlowInterviewLog` with debug logging) and multiply. Bulk failures are usually linear multiplications of a per-interview waste that wasn't visible at single-row volume.8687## Fault-Routing Patterns8889Four canonical patterns. Combine them — most production Flows use a mix.9091### Pattern A: User-safe branch + diagnostic log9293For user-facing screen flows and user-initiated quick actions.9495```text96[DML or Action]97 ├── Success → [Next business step]98 └── Fault → [Assignment: userMessage = "We could not complete your request right now. Please try again or contact support."]99 → [Assignment: diagnosticDetail = {!$Flow.FaultMessage}]100 → [Create Records: Application_Log__c with diagnosticDetail + recordId + userId + elementName]101 → [Screen: show userMessage + link to support]102 → [End]103```104105The user sees a message they can act on. The admin sees the raw fault detail in the log object.106107### Pattern B: Retry-once for transient failures108109For HTTP callouts, integration actions, and other elements where the first failure may be transient.110111```text112[HTTP Action]113 └── Fault → [Decision: is error code 5xx or timeout?]114 ├── Yes → [Wait 30s via Platform Event delay] → [HTTP Action retry]115 │ ├── Success → [continue]116 │ └── Fault → [log + notify + end]117 └── No → [log + notify + end] // 4xx errors are not retried118```119120Retry once. Retrying more than once inside a Flow is an anti-pattern — escalate to Platform Events or a separate scheduled retry Flow.121122### Pattern C: Continue-on-error for bulk safety123124For record-triggered flows that need to survive one record failing out of many.125126```text127Per-record element in a loop128 └── Fault → [Assignment: add record to failed_records collection with reason]129 → [continue to next iteration]130131After loop:132 → [Decision: failed_records.size > 0]133 ├── Yes → [Create Records: Flow_Error_Log__c for each entry]134 │ → [Send notification to admin]135 │ → [End — successful records are committed]136 └── No → [End]137```138139Caution: this pattern only works if the individual element is INSIDE a loop. Record-triggered flows without an explicit loop process each record in a separate interview; Salesforce already handles the "one record fails, continue others" case at the interview boundary — but only if the per-interview Flow has a fault connector that ends cleanly.140141### Pattern D: Explicit termination142143For critical-path flows where partial success is worse than total failure.144145```text146[DML or Action]147 └── Fault → [Assignment: diagnosticDetail = {!$Flow.FaultMessage}]148 → [Create Records: Application_Log__c (if possible — but this may roll back too)]149 → [Send Email Alert via Email Alert action] // Decoupled from the transaction150 → [End — DO NOT suppress the error]151```152153In Pattern D, the Flow's fault path ends WITHOUT suppressing the failure, so the transaction still rolls back. The log and the email alert are best-effort notifications. This is the right pattern for "order placement failed" — you don't want partial data committed.154155## Flow Fault Handling Rules156157### Elements That Must Be Treated as Fallible158159| Element Type | Typical Failure Modes | Required Fault Routing |160|--------------|-----------------------|------------------------|161| Get Records | Query limit, unexpected empty result assumptions, too-many-rows | Pattern A or C; assume zero rows + handle "not found" case explicitly |162| Create/Update/Delete | Validation rule, duplicate rule, required field, record lock, FLS denial | Pattern A (user-initiated) or C (bulk) |163| Subflow | Downstream failure propagates up; managed-package subflows are opaque | Parent calls with Pattern A; inner subflow should fault-handle its own elements |164| Apex or invocable action | Thrown `AuraHandledException`, unhandled business error, governor exhaustion | Pattern A; the invocable Apex itself should honor `with sharing` and FLS |165| HTTP action / external step | Timeout (default 120s), auth failure, 4xx/5xx response, rate-limit | Pattern B for 5xx/timeout; Pattern A or D for 4xx |166| Email action | No active recipient, template reference invalid, org-level send-limit exhausted | Pattern A — but NOT Pattern D for notification paths (losing the notification is worse than a partial send) |167| Send Custom Notification | Notification Type not active, recipient reference invalid | Pattern A; fall back to email or log-only |168| Platform-event subscribe | Delivery miss, replay buffer expiry, subscriber session timeout | Requires out-of-band monitoring; not a fault-connector concern at the Flow level |169170### Minimum Fault Pattern171172Every fallible element must route to:1731741. A user-safe message or business-logic branch (Pattern A / C) OR an explicit termination decision (Pattern D).1752. A diagnostic detail capture using `$Flow.FaultMessage` — NEVER discarded.1763. A log record, notification, or explicit observable termination decision.177178For screen flows, the user must see a clear next step. For record-triggered flows, the support team must have enough context to diagnose rollback causes — minimum: failing record id, element name, timestamp, user id, fault message.179180### Error-Message Design181182The UX cost of a raw fault message is real. Design two messages per fault:183184| Audience | Message content | Example |185|---|---|---|186| User (screen flow) | Plain English, action-oriented, no technical jargon | "We couldn't save your changes. Please check the required fields and try again." |187| Admin (log + email) | Full diagnostic detail preserved | `Element: Update_Case. Error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Priority cannot be set to Urgent without a justification. Record: 500xx00000ABCD` |188| Integration (caller) | Machine-parseable where the calling system needs to branch | HTTP status + JSON body including fault code (`FLOW_FAULT_VALIDATION_RULE`, `FLOW_FAULT_LIMIT_EXCEEDED`, etc.) |189190Raw `$Flow.FaultMessage` belongs in the admin audience only.191192## Bulk-Safety Deep Dive193194Record-triggered flows fire once per interview; bulk DML (data load, integration, upstream Apex) triggers many interviews in a single transaction. Three bulk-safety risks dominate:195196### Risk 1: Repeated `Get Records` per interview197198Every interview's `Get Records` counts against the transaction's 100-SOQL limit. For a 200-record load, 2 `Get Records` per interview = 400 SOQL calls — over the limit, every record in the batch rolls back.199200**Safer patterns:**201- Query once outside the loop if possible (auto-launched flow called by a single `Get Records` in a parent Flow).202- Use before-save logic for same-record reads (`$Record` and `$Record__Prior` are free — no SOQL).203- Cache lookups via Custom Metadata or Platform Cache for reference data.204205### Risk 2: After-save DML fan-out206207Each interview's DML elements count against the 150-statement limit. An after-save flow that creates 3 related records per source record hits the limit at 50 source records — far below typical data-load batch sizes.208209**Safer patterns:**210- Aggregate the source records into one DML call via a Get-then-Update loop outside individual interviews (usually requires an invocable Apex to bulk).211- Move fan-out to async: Platform Event fire-and-forget, or schedule a Platform Event Flow for deferred creation.212- Reduce the fan-out — is every related record actually needed?213214### Risk 3: Invocable Apex not list-safe215216An invocable Apex with a method signature `void doWork(MyInputType input)` and an `@InvocableVariable` on the INSTANCE level receives one call per interview. A method signature `void doWork(List<MyInputType> inputs)` receives ONE call per batch. The former fires 200 times in a 200-record load; the latter fires once.217218**Safer pattern:** every invocable method used from a Flow should accept a `List<T>` of inputs and return `List<Result>`. Flow automatically aggregates and de-aggregates.219220### Bulk Safety Checklist221222- [ ] SOQL count per interview × bulk cardinality < 100223- [ ] DML count per interview × bulk cardinality < 150224- [ ] Invocable Apex signatures accept `List<T>` not single instances225- [ ] Per-interview `Get Records` checked for cacheability via Platform Cache or Custom Metadata226- [ ] After-save DML fan-out counted and documented227- [ ] Missing fault connector on any DML element — treat as a bulk-safety issue, not just a fault-handling issue: one bad record rolls back the whole batch228229## Fault Review Checklist230231- [ ] Every fallible element has a fault path232- [ ] `$Flow.FaultMessage` is captured for logging or admin diagnostics233- [ ] End-user messages do not expose raw platform errors234- [ ] Record-triggered paths are reviewed for data-load volume (SOQL + DML math per interview × expected cardinality)235- [ ] Subflows and invocable Apex fail in an intentional, observable way236- [ ] Fault-email recipient is configured at org level (Process Automation Settings)237- [ ] Error-log object exists or has an equivalent sink (custom notification, Chatter post)238- [ ] Retry logic (if present) retries at most once per element239- [ ] WAF pillar tagging complete: Reliability / Scalability / Operational Excellence findings are separated240241## Recommended Workflow242243Step-by-step instructions for an AI agent or practitioner activating this skill:2442451. Gather context — confirm the org edition, relevant objects, and current configuration state2462. Review official sources — check the references in this skill's well-architected.md before making changes2473. Implement or advise — apply the patterns from Fault-Routing Patterns above2484. Validate — run the skill's checker script and verify against the Fault Review Checklist above2495. Document — record any deviations from the canonical patterns and update the template if needed250251---252253## Salesforce-Specific Gotchas254255| Gotcha | Why it bites |256|---|---|257| Missing fault connectors roll back more than one record | In record-triggered automation, one unhandled error can fail the whole batch save. Highest-impact fault-handling gap. |258| `$Flow.FaultMessage` is for diagnostics, not polished UX | Log it or email it — do not dump it raw to business users. |259| Shared transactions still share limits | Apex, Flow, and invocable actions consume the same governor budget. A Flow that works on UI edits may fail under Bulk API load when same-object triggers consumed SOQL budget first. |260| Screen flows and record-triggered flows need different failure design | One is user-guided UX (must have a next step); the other is transaction safety (must not roll back good records). |261| Subflows do not isolate bad design automatically | Fault handling still needs to exist at the calling boundary. A subflow fault connector handles failures THROWN by the subflow; it does not retroactively fix the parent. |262| Fault connectors on non-DML elements are easy to forget | `Assignment`, `Decision`, and `Loop` elements don't have fault connectors — but the `Action` elements around them do. |263| Screen flow back-button can skip fault paths | A user clicking back AFTER a fault can re-enter with state that doesn't match the fault branch's assumptions. Test explicitly. |264| Error emails go to the Process Automation user | If that user is inactive or reassigned, fault notifications disappear silently until an outage exposes the gap. Audit annually. |265| Orchestration flows have their own fault semantics | Stage-level faults are handled by stage transitions, NOT fault connectors inside the invoked flows. Don't mix paradigms. |266267## Proactive Triggers268269Surface these WITHOUT being asked:270271- **Any DML or action element with no fault connector** → Flag as Critical. This is an avoidable rollback risk.272- **Generic system error shown to users** → Flag as High. Replace it with a controlled message and a logged diagnostic path.273- **Flow used in data-load contexts with repeated reads or writes** → Flag as High. Bulk behavior must be reviewed before production use.274- **Apex action used with no evidence of list-safe design** → Flag as High. Invocable Apex can still fail at scale.275- **No logging or notification on failure for background flows** → Flag as Medium. Silent failures become support incidents.276- **Fault-email recipient is inactive or unset at org level** → Flag as High. Unhandled faults go to an unread mailbox.277- **Retry loop with no termination bound** → Flag as Critical. A retry-until-success loop inside a Flow is an infinite-loop risk masquerading as resilience.278- **Different elements route to the same fault tail without discriminating source** → Flag as Low. Not wrong, but it collapses diagnostics; recommend adding the source element name to the log record.279280## Output Artifacts281282| When you ask for... | You get... |283|---------------------|------------|284| Fault-handling review | Missing connectors, bulk risks, message design findings, WAF pillar tagging |285| New Flow pattern | Fault-routing structure + logging + user-facing guidance + bulk-safety math |286| Failure triage | Root cause + smallest safe Flow redesign + prevention recommendations |287| Org-level fault posture | Fault-email recipient check + error-log object inventory + FlowInterviewLog guidance |288289## Related Skills290291- **admin/flow-for-admins**: Use it for broader Flow type decisions and admin automation design.292- **flow/flow-bulkification**: Companion skill — fault handling and bulk-safety are deeply coupled; missing fault connectors make bulk failures rollback-the-batch failures.293- **flow/record-triggered-flow-patterns**: Record-triggered fault semantics differ from screen flows — read that skill for the record-triggered-specific concerns.294- **flow/scheduled-flows**: Scheduled flow faults route differently (no user is present); specialized handling required.295- **apex/governor-limits**: Shared Flow and Apex transactions still need limit-aware design.296- **apex/exception-handling-patterns**: For Apex invoked from Flows — failures in invocable Apex are where many Flow faults actually originate.297- **omnistudio/integration-procedures**: Use it when the failure path belongs in OmniStudio orchestration rather than Flow.