Customize Error Workflow

Hello n8n community!

I’m unable to find resources that can confirm if n8n supports custom variables to be sent through the error workflow

I have built a custom workflow with over 50 steps and have various actions to 4+ tools over HTTP nodes. These sometimes fail due to incorrect data being sent/created. I have a simple error workflow that triggers and sends slack message with the standard information about what failed. However, I’m hoping to send the exact status of which node executed and which failed within this error workflow.

For example, if 3 tools were updated and the 4th one failed. I want the error message to show that “Organizations were created on Zoho/SentinelOne but failed to update the Monday Board with updates”. Furthermore, if certain other things fails, it should clearly say what was completed and what is still pending for users to manually finish.

Information on your n8n setup

  • n8n version: 1.108.1
  • Database (default: SQLite): N/A
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: N/A

Hey! Going by the documentation, which you have probably seen, seems we only have the node that threw the error.

Also, we have execution ID which we can use to pull more details about the execution, including the order of the nodes. Using all of this, we can iterate the nodes array and stop at the node before the one in the error response (a.k.a. the last successful one). Then, we can even print the remaining nodes, which helps us understand what’s left to execute to finish the workflow later.

Here is an example that pulls the execution data:

Let me know if you like that approach or if you have follow up questions :slight_smile:

3 Likes

That’s very helpful - thank you!

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