# Get additional data from Error Workflow

**URL:** <https://community.n8n.io/t/get-additional-data-from-error-workflow/28797>\
**Category:** Questions\
**Created:** [July 31, 2023, 3:07pm UTC](https://community.n8n.io/t/get-additional-data-from-error-workflow/28797 "2023-07-31T15:07:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottyb](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@scottyb](https://community.n8n.io/u/scottyb)\
**Post date:** [July 31, 2023, 3:07pm UTC](https://community.n8n.io/t/get-additional-data-from-error-workflow/28797/1 "2023-07-31T15:07:35Z")

</div>

## Describe the problem/error/question

I have an error handling workflow setup that sends me an e-mail when something goes wrong. I’d like to include debugging information, such as the data that was included in the “Start” node of the workflow where the error happened.

When I load the execution, all it returns is the about the node where it failed, but I have key information that is set at various points throughout a workflow which would allow me to log the error in my external systems.

For example, I have a “site\_id” variable set at the beginning of the workflow, if this value was passed to the error handling workflow, I could then log the error against the site in my database.

## Information on your n8n setup

- **n8n version:** 0.228.2
- **Database (default: SQLite):** Cloud hosted

---

<div class="post-metadata">

**Author:** ![scottyb](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@scottyb](https://community.n8n.io/u/scottyb)\
**Post date:** [August 1, 2023, 6:56am UTC](https://community.n8n.io/t/get-additional-data-from-error-workflow/28797/3 "2023-08-01T06:56:36Z")

</div>

This isn’t ideal, as it only captures errors at common points (rather than the entire workflow), but what I’ve done is use a “Stop and Error” node, and then I add a JSON string to the error message. From there, I have an Error Workflow which decodes the json in the errorMessage and then I can process as I need to

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/d/f/df6b5db6b4692d43e10b0d56df31e21f627f159a.png)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 1, 2023, 9:59am UTC](https://community.n8n.io/t/get-additional-data-from-error-workflow/28797/5 "2023-08-01T09:59:55Z")

</div>

Hi @scottyb, sounds like you’ve already found a workaround.

However, seeing you’re looking for a more universal way of retrieving data from the failed workflow in your error handling workflow, perhaps you want to consider using the [REST API](https://docs.n8n.io/api/) n8n provides in your error handling workflow? Using the API you can fetch the full execution data from your failed workflow. There is also a pre-built [node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.n8n/) to interact with the API.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 30, 2023, 10:00am UTC](https://community.n8n.io/t/get-additional-data-from-error-workflow/28797/6 "2023-10-30T10:00:25Z")

</div>

Closed on October 30, 2023, 10:00am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
