Sub topic 10
Flow Error Emails and Monitoring Failed Interviews
This chapter covers how Salesforce reports flow failures after a flow is live, and how you can watch for failures yourself. It assumes you can build a flow with elements and variables, that you know what a fault path is, and that you have a sandbox or Developer Edition org. Apex knowledge is helpful for the optional monitoring section, but it is not required for the rest.
Why failures need monitoring
Debugging in Flow Builder finds problems before release. Once a flow is active, users and automated processes run it thousands of times, with data you never tried. Some of those runs fail. If nobody is told, a failure can go unnoticed until someone asks why a task was never created.
A flow run is called a flow interview. A failed interview is one that stopped with an unhandled error. You need two things to manage these:
- A way to be told when an interview fails.
- A way to look back and see which interviews failed and why.
The standard flow error email
When an interview fails with an unhandled error, Salesforce sends a flow error email. "Unhandled" means no fault path caught the error. The email goes to the person who last modified the flow. This is often a developer or admin who has since moved on, so the email can reach the wrong person.
The email normally contains:
- The flow name and the type of flow.
- The error message.
- The interview's unique ID.
- A list of the elements the interview ran, in order, up to the failing element.
- For record-triggered flows, details of the record that started the interview.
Treat this email as the first diagnostic tool. The element list shows where the interview stopped. The error message usually names the cause, such as a required field that is missing, a validation rule that blocked a save, or a governor limit that was exceeded.
Where the email goes
Where the email goes depends on several settings, and the details differ between flow types and releases. Check your org's current documentation before you rely on one behavior. The general rules are:
- Errors in flows that run for a user, such as screen flows, appear on screen as an error message. The email goes to the flow's last modifier.
- Errors in automated flows, such as record-triggered or scheduled flows, have no user watching. The email is the main signal.
- In Setup, Process Automation Settings has an option to send flow error emails to a chosen person or to the org's Apex exception email recipients. Use it to send errors to a shared team address, not to one individual.
Handled errors and the fault path email
A fault path changes what happens on failure. When a fault connector catches an error, the interview does not fail in the usual sense. It follows the fault path and continues. As a result, Salesforce does not send the standard error email for that error. If you catch an error and do nothing with it, the failure is silent.
This is the main point of this chapter. A fault path must do something visible. Typical actions are:
- Send an email to an admin or team.
- Create a record in a custom logging object.
- Show a clear message to the user, in a screen flow.
- Roll back or stop the work cleanly.
The $Flow.FaultMessage global variable holds the error text inside a fault path. A simple email body can use it like this:
An error occurred in the flow: {!$Flow.FaultMessage}
Flow: {!$Flow.CurrentDateTime}
Record Id: {!$Record.Id}$Record.Id applies only in record-triggered flows. In other flow types, pass the record ID through your own variable. $Flow.CurrentDateTime gives the time of the failure, and $Flow.CurrentRecord or your own variables can supply more context.
Choosing between the standard email and a fault path
| Approach | What you get | Cost |
|---|---|---|
| No fault path | Standard error email, and the interview fails | Email may reach the wrong person, and the transaction may roll back |
| Fault path that emails | Custom message with your own context | You must build and maintain it on each element that can fail |
| Fault path that logs a record | Searchable history, reports, dashboards | Needs a custom object and an extra DML step |
| Both email and log | Immediate alert and long-term history | Most work, but best for important flows |
Add fault paths to elements that can fail, such as Create Records, Update Records, Delete Records, Get Records, and Action elements. Keep the fault-handling elements simple. A fault path that itself fails brings you back to an unhandled error.
What happens to the transaction
For record-triggered flows, a failed interview usually affects the whole transaction. In a before-save flow or an after-save flow that is not caught by a fault path, the error can roll back the user's save. The user then sees an error, and the record is not saved. This is a common surprise: a flow that was meant only to add a task blocks a user from saving an opportunity.
If a fault path catches the error and the flow continues, the save can go ahead. You must decide which is right for each flow:
- If the flow's work is essential, let the error stop the save, and make sure the message is clear.
- If the flow's work is secondary, such as sending a notification, catch the error, log it, and let the save succeed.
Record this decision when you design the fault path, since it determines what users experience.
Monitoring failed interviews in the org
Email is a push signal. You also need a way to look back. Salesforce offers several places to see failures.
Paused and failed Flow Interviews
In Setup, the Paused and Failed Flow Interviews page lists interviews that paused or failed. For each one you can see the flow name, the interview name, the time, and the current element. Use it to:
- Find interviews that failed recently.
- Resume or delete paused interviews.
- See which flows fail most often.
Not every error appears here. Flows that run in the background and fail inside a transaction often appear only in the email or in debug logs. Do not treat the page as a complete failure record.
Debug logs
When you need the full detail of a failure, use a debug log, as described in the earlier chapter on tracing flow execution. Set a trace flag on the user whose actions trigger the flow, reproduce the failure, then read the log. Look for the flow events, the element that failed, and any limit usage lines.
Event Monitoring and Flow Execution Error Events
Orgs with Event Monitoring or related licenses can capture a Flow Execution Error Event. This is a platform event that Salesforce publishes when a flow interview fails. You can subscribe to it with a flow, an Apex trigger, or an external system, and then route it to chat, a ticket, or a log. Availability depends on your edition and licenses, so confirm that your org has it before you design around it.
A custom logging object
If you cannot use platform events, a custom object works well. A common design has these fields:
| Field | Purpose |
|---|---|
| Flow Name | Which flow failed |
| Error Message | Value of `$Flow.FaultMessage` |
| Record Id | The record being processed |
| Occurred At | Value of `$Flow.CurrentDateTime` |
| Resolved | A checkbox for follow-up |
Create one record from each fault path. Then build a report and a dashboard on the object, and consider a scheduled flow that emails a daily summary of unresolved items.
Putting the monitoring pieces together
The diagram shows how an error moves from the failing element to the people who need to know.
Testing your alerting
An alert you have never seen fire is an assumption. Test it:
- In a sandbox, build a flow that deliberately fails, for example by creating a record with a required field left empty.
- Run it without a fault path and confirm that the standard error email arrives at the address you expect.
- Add a fault path that sends an email and creates a log record. Run the flow again.
- Confirm that the custom email arrives, that the log record exists, and that the standard email no longer arrives.
- Check that
{!$Flow.FaultMessage}is filled in and readable.
Repeat the check after you change the recipient settings or move the flow to production.
Common mistakes
- Leaving the error recipient as a former employee.
- Adding a fault path that ends with no action.
- Putting an email action in a fault path but not checking that email deliverability is on in the org. In sandboxes, deliverability is often limited to system email by default, so test emails may never arrive.
- Assuming the Paused and Failed Flow Interviews page shows every failure.
- Forgetting that each email sent from a flow counts toward the org's daily email limit, so a flow that fails in a high-volume process can send many alerts. Consider logging a record instead, or sending a summary.
- Using
$Record.Idin a flow type that has no triggering record.
Summary
The standard flow error email tells you about unhandled failures, but it goes to the last modifier by default, so set a shared recipient. A fault path replaces that email, so each fault path must send or log the error. Use the Paused and Failed Flow Interviews page, debug logs, and, where available, Flow Execution Error Events or a custom logging object to look back. Test your alerts in a sandbox before you rely on them.
Exercise
A record-triggered flow has a fault path on its Create Records element. The fault path connects to an Assignment element and nothing else. The Create Records element fails in production. Does the standard flow error email arrive? What should you change?
Show answer
No. The fault path handles the error, so the interview does not fail in the usual sense and Salesforce does not send the standard error email. The failure is silent. Change the fault path to send an email, create a log record, or both, using {!$Flow.FaultMessage} and the record ID so that someone can find and investigate the failure.
Exercise
Name two reasons a team might not receive flow error emails even though flows are failing, and one fix for each.
Show answer
First, the email goes to the last person who modified the flow, who may have left or may not be watching; fix this by setting a shared recipient in Process Automation Settings. Second, the failing elements have fault paths that handle the error without alerting anyone; fix this by adding an email or log action to each fault path. (Another valid reason is that email deliverability is limited in a sandbox, fixed by changing the deliverability setting.)