> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zentien.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow Fault Path Monitoring

> Add the Zentien subflow to your Flows to capture faults explicitly.

## Overview

Salesforce Flows can fail silently — fault path emails often go unread, and there is no central place to see which Flows are failing and why. Zentien provides a pre-built subflow you can drop into any Flow's fault path to capture errors in real time.

## The Zentien Log Flow Error subflow

The `Zentien Log Flow Error` subflow is included in the Zentien package (v0.2.0+). It takes three inputs:

| Input          | Required | Description                                              |
| -------------- | -------- | -------------------------------------------------------- |
| `flowName`     | Yes      | Name of the calling flow (hardcode the API name)         |
| `errorMessage` | Yes      | Pass `{!$Flow.FaultMessage}` here                        |
| `recordId`     | No       | ID of the record being processed when the fault occurred |

## How to add it to your Flow

1. Open your Flow in **Flow Builder**
2. On any element that can fail, connect the **fault path** (the red connector)
3. Add a **Subflow** element on the fault path
4. Select **Zentien Log Flow Error** as the subflow
5. Set the input variables:
   * **Flow Name** → type the API name of your flow (e.g. `Order_Processing`)
   * **Error Message** → select the `$Flow.FaultMessage` global variable
   * **Record ID** → (optional) pass the ID of the record being processed
6. Save and activate your Flow

<Note>
  Always connect the fault path to something — even if you just want to log and continue. Leaving a fault path unconnected causes Salesforce to send an email and stop the flow.
</Note>

## Example

A Flow that processes orders and sends an error to Zentien if anything fails:

```
[Get Record] → [Update Record] → [Send Email]
      ↓fault          ↓fault         ↓fault
      └──────────────────────────────┘
                      ↓
            [Zentien Log Flow Error]
              flowName: "Order_Processing"
              errorMessage: {!$Flow.FaultMessage}
              recordId: {!recordId}
```

## What you see in Zentien

Flow faults captured via the subflow appear in your **Errors** page with:

* **Event Type:** `FLOW_FAULT`
* **Automation Name:** the flow name you passed
* **Error Message:** the fault message from Salesforce
* **Record ID:** the record being processed (if provided)

They are grouped and deduplicated like all other errors — repeated failures in the same flow appear as one group with an occurrence count.

## Next step

<Card title="Callout Monitoring" icon="arrow-up-right-from-square" href="/setup/callout-monitoring">
  Track every outbound HTTP callout from your Salesforce org.
</Card>
