> For the complete documentation index, see [llms.txt](https://docs.couchdrop.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.couchdrop.io/automations/error-handling.md).

# Error Handling

Learn how to add Error Branches to Couchdrop Automations

## Introduction

A failed [Workflow Action](/automations/actions.md) can require an immediate response. You may need to alert someone, move a file to an alternative storage location, or run another action when expected processing fails.

Error Branches let you define this response within [Couchdrop Automations](/automations/overview.md). When a Workflow Action fails, Couchdrop can follow its Error Branch and run failover actions or notifications attached to that branch.

## How Error Branches work

An Error Branch creates a separate path from a Workflow Action. Couchdrop uses this path when the originating action fails.

You can use an Error Branch to:

* Send a [custom email](/automations/notifications.md#overview) when Couchdrop cannot retrieve or move a file.
* Move a file to alternative storage when the intended location is inaccessible.
* Run follow-up actions or notifications when expected processing fails.

{% hint style="info" %}
An Error Branch begins at a specific Workflow Action. Attach the branch to the action whose failure you want to handle.
{% endhint %}

## Adding an Error Branch

In the Workflow builder, hover over the output of an action node and select **Error**.

Couchdrop creates an Error Branch from that action. Add the actions or notifications that should run when the original action fails.

## Example failure responses

| Workflow failure                   | Error Branch response                            |
| ---------------------------------- | ------------------------------------------------ |
| Couchdrop cannot retrieve a file   | Send an email alert                              |
| A file cannot be moved             | Notify the person responsible for the Workflow   |
| A storage location is inaccessible | Move the file to an alternative storage location |
| Expected processing fails          | Run a follow-up action or notification           |

## Frequently asked questions

<details>

<summary>What causes an Error Branch to run?</summary>

An Error Branch runs when its originating Workflow Action fails.

</details>

<details>

<summary>Can an Error Branch send a notification?</summary>

Yes. You can add a [Send Email action](/automations/actions/email-files.md#create-custom-email-action) to the Error Branch to alert someone when the originating action fails.

</details>

<details>

<summary>Can an Error Branch move files elsewhere?</summary>

Yes. An Error Branch can move files to alternative storage when the intended location is inaccessible or another expected action fails.

</details>

<details>

<summary>Where do I add an Error Branch?</summary>

Hover over the output of a Workflow Action and click Error. Couchdrop will create the branch from that action node.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.couchdrop.io/automations/error-handling.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
