Error Workflow Not Triggered

Hey all,
I’m a relatively new n8n user - we’re having a bit of play with n8n hosted internally here.

I’m having some issues with not being able to get my error workflow to trigger. Its a simple error workflow that just writes a message to a Microsoft Teams channel, and it works when I manually execute it with the test data.

However, when I set it as the error workflow for another workflow that errors out, nothing seems to be triggered.

My main workflow is published and active, and I have set the error workflow in the settings of the main workflow.

I feel like I’m missing something obvious but not sure what it is.

Any help would be appreciated :slight_smile:

Welcome to the community @IbnJubayr !

What n8n version do you use? There was a bug in 0.118.0.

Does your error workflow have an Error Trigger node?

1 Like

Btw. Here is also a blog post:

Hmm, looks like we’re using an outdated version (0.113.0) - I’ll look into upgrading

The only version that caused problems is 0.118.0. So all before and after should work fine. So would still recommend to upgrade but it will likely not fix your issue.

Hi Jan,
Thanks for your help thus far. Upgrading didn’t resolve the issue and I’ve reviewed the blog post, we are doing pretty much the same thing.

I have a workflow called errorWorkflow that contains an Error Trigger and a Microsoft Teams node. This workflow is not active (because it cannot be activated). When I test this workflow, the teams message gets sent correctly.

I have a second workflow that has the errorWorkflow specified in its’ settings and this workflow is active.
This second workflow contains some custom nodes that we’ve written.

In some scenarios, these custom nodes are causing errors (in this case, unexpected end of JSON input), and I was expecting the errorWorkflow to trigger. The failed workflow appears as failed in the executions list, but no Teams message is written and I cannot find (or do not know where to look) any reference to the errorWorkflow being triggered.

Hello,

I’m on 0.120.0 and I’m experiencing the same issue.
Upon debugging, I was able to trigger the error workflow by having the erroring workflow run on webhook or cron, but not by manually executing it.
It would appear that error triggers are only called on automated runs, not on manual ones. Am I mistaken? Is this intended behavior/is it customizable?

@IbnJubayr are you executing the workflow manually too?

Hey @markkuit!

Welcome to the community :tada:

The Error Trigger node is designed to get triggered when the workflows execute automatically. One of the important reason for this is that you don’t see the output in the Editor UI when you’re workflows are active. The Error Trigger node sends you an alert when something is wrong in that active workflow.
But when you’re running your workflows manually, you get the output in the Editor UI. You get the error, if there’s any.

I hope this makes sense.

Hey @IbnJubayr!

Can you create a different workflow that do not use your custom nodes and set up the Error Workflow? This can be a simple Cron node with a Function node (with incorrect code). This will help us understand if something is still wrong with the Error Trigger node or if it’s your custom node :slight_smile:

Hi,
Thanks for that suggestion. I’ve just tried this (cron trigger every minute with a function node that errors on runtime). I’ve activated it and associated it to the same error workflow that just writes a message to a teams channel. I’ve left it running and it has errored out a few times but the error workflow does not seem to trigger.

Is there anything I can check on this end regarding log files to see what is happening?

I just tested again. Works all perfectly fine for me. So no idea right now why it does not work for you.

You can activate logging. You can find some information about that here:

Hope that helps!

1 Like

Hi Jan,
Really appreciate the help and direction you are providing.

I’ve enabled debug level logging and I can see the workflow throwing the error but the logs do not indicate that the error workflow is being called.

5/21/2021 8:57:04 PM2021-05-21T10:57:04.209Z | info     | Start job: 61 (Workflow ID: 10 | Execution: 534) {"file":"worker.js","function":"runJob"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.250Z | verbose  | Workflow execution started {"workflowId":10,"file":"WorkflowExecute.js","function":"processRunExecutionData"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.250Z | debug    | Start processing node "Cron" {"node":"Cron","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.250Z | debug    | Running node "Cron" started {"node":"Cron","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.250Z | debug    | Running node "Cron" finished successfully {"node":"Cron","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.251Z | debug    | Save execution progress to database for execution ID 534  {"executionId":"534","nodeName":"Cron","file":"WorkflowExecuteAdditionalData.js","function":"nodeExecuteAfter"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.272Z | debug    | Start processing node "Function" {"node":"Function","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.273Z | debug    | Running node "Function" started {"node":"Function","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.275Z | debug    | Running node "Function" finished with error {"node":"Function","workflowId":10,"file":"WorkflowExecute.js"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.275Z | debug    | Save execution progress to database for execution ID 534  {"executionId":"534","nodeName":"Function","file":"WorkflowExecuteAdditionalData.js","function":"nodeExecuteAfter"}
5/21/2021 8:57:04 PM2021-05-21T10:57:04.285Z | verbose  | Workflow execution finished with error {"error":{"message":"Cannot set property 'foobar' of undefined","stack":"TypeError: Cannot set property 'foobar' of undefined\n    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes:2:17\n    at Object.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes:3:15)\n    at NodeVM.run (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/main.js:1167:29)\n    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function.node.js:66:31)\n    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:492:37)\n    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:424:62\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"},"workflowId":10,"file":"WorkflowExecute.js","function":"processSuccessExecution"}

We have setup n8n across 4 containers - 2 workers, 1 webhook and 1 for the application. Have we missed something?

Hey @shrey-42!

Can you please open a separate topic? :slight_smile:

Sure, will do :+1:

1 Like