Error branch on "Execute SQL" node don't works

Describe the problem/error/question

Hi everyone,

I’m trying to understand how error management works in n8n. I created a workflow with an “Execute SQL” node. In the settings, I configured the “On Error” option to “Continue (using error output).”

In my SQL statement, I included a PL/SQL command to call a procedure:

BEGIN  
  logStuff(:id);  
END;

I tested several use cases, but the workflow never enters the “Error” branch.

Here are the scenarios I tested:

  1. The procedure raises an error for some reason (e.g., different types of ORA- errors).

  2. I call a procedure that doesn’t exist.

In both cases, I receive the error message in the Success branch instead of the Error branch. For example:

[ { "message": "ORA-06550: line 2, column 3:\nPLS-00201: identifier 'LOGSTUFF' must be declared\nORA-06550: line 2, column 3:\nPL/SQL: Statement ignored\nHelp: ".... } ]

However, I expected this error to trigger the Error branch.

What am I missing? Is there something specific about how n8n handles errors in the “Execute SQL” node?

Thanks in advance for your help!

Information on your n8n setup

  • n8n version: 1.120.4
  • Database (default: SQLite): Oracle 19c
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: windows

Hello @Careau, welcome!

In situations like that, I usually set “On Error” to “Continue”, then use a Switch node to parse the error and other branches..

The reason is probably that the node’s internal error handling doesn’t identify the response as an actual error or something similar, not exactly sure about the technical explanation tbh…

1 Like