# Raise Error

Fails on purpose with an error a step sent to its `error` output.

A step set to **Route to error output** does not fail the run when it fails: its error goes out on its `error` output as a value, and its other outputs end their branches. Raise Error turns that value back into a failure. Use it when a failure was handled (logged, reported, a fallback tried) but should still fail the run, ideally with a clearer message.

## Inputs & Outputs

- **Input:** `error` (required) - the error value from a step's `error` output: `{ node_id, node_type, message, causes }`.
- **Outputs:** none. Raise Error always ends its branch, and it never succeeds.

## Config

- `message` - what failed, in the workflow's own terms, for example `Could not refresh the price list`. Empty by default; when empty, the message is `the error from node '<node_id>' was raised again`, naming the step the error came from.

## Behavior

- The node always fails. Its error is the configured message, and under it, in order, the step the error came from with its message (`node '<node_id>' (<node_type>): <message>`) and then each of that error's causes. The run history shows these under **Caused by**, so nothing about the original failure is lost.
- Its own failure mode decides what the failure does, as for any step:
  - **Stop branch (default):** the run fails, with Raise Error as the step it failed on.
  - **Fail workflow:** the whole run stops at once, including independent branches.
  - **Route to error output:** the error goes out on Raise Error's own `error` output, wrapped in the new message. Its `causes` list every link of the raised chain, so raising again any number of times keeps the original cause.
- Given a value that is not an error value, such as an object built by hand, the node fails with the configured message, or `Raise Error was given a value that is not a node error` when none is set.

## Example

An **HTTP Request** step `fetch_prices`, set to Route to error output, has its `error` wired to a step that posts the failure to a channel, and also to Raise Error with `message` set to `Could not refresh the price list`. When the request fails, the failure is posted and the run still fails. Its history reads like this, with the request's own error in the last line:

```text
Could not refresh the price list

Caused by:
    0: node 'fetch_prices' (http_request): request failed with status 503
```

To recover from a failure instead of raising it, wire `error` into a JavaScript step that returns the fallback value, and that step's `output` into the same input the failing step's output feeds.

## Related Nodes

- [If](/docs/nodes/if) - routes on a condition, the way Route to error output routes on a failure
