Get additional data from Error Workflow

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

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

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 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 to interact with the API.

1 Like

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