Error Workflow on an API

Hello! I’m trying to add some error handling to our internal API which is an n8n workflow. The issue im having is that im using the respond to webhook node to output data back to the node that requested it so as far as I know, I can’t use a different workflow for error handling because I can’t use a different workflow to respond to the initial webhook since n8n automatically responds with error 500 once it errors. How can I catch errors without having a giant spaghetti net pointing to 1 node?

At the moment im just using the error output on a per node basis but ideally I would just catch any error using another workflow and handle it over there…

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: 1.46.0
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Not sure.
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS

You still should be able to use a separate “Error workflow” as per Dealing with errors in workflows | n8n Docs and catch any failures including error 500.

Yea but as soon the workflow ends it responds to the webhook so offloading it via error trigger wouldn’t work

" * The workflow errors before the first Respond to Webhook node executes: the workflow returns an error message with a 500 status." as per documentation

The absolute best scenario would be using an error trigger on a seperate workflow and having that respond to the webhook

I’m afraid that cannot work like that. The Webhook and Respond to Webhook nodes have to be part of the very same workflow.

I believe what you have built is already the best solution to accommodate both - the custom response and to trigger the Error workflow.

My understanding is your workflow does work as expected and it is just the extra connections (“spaghetti net”) that bothers you. Looks like you would have to live with that for now (unless there is something else to it I missed).

Yup I think so too, thanks for the confirmation anyways :slight_smile:

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