Error communication between parent and sub workflows

Hey guys,

I’m using sub workflows for recurring operations. At the beginning of every sub workflow I check for the required input parameters. If they are not satisfying the minimum requirements, an error should be thrown. So imagine this the sub process:


The parent workflow triggers the sub workflow and gets an error:


IMHO it would be great, if the parent workflow would receive the error message or the error object from the sub workflow to handle the error (“continue on fail”) or just to see what went wrong durin sub workflow execution.

Instead I get the message:
ERROR: Cannot read property ‘main’ of undefined

Or did I get something wrong? Of course, in the sub workflow I could use “Set” instead of “Stop end Error”, but I think this would be the more explicit and obvious way of dealing with errors.

n8n version: 0.152.0

Hi @BenW, thanks very much for sharing! I don’t think you did anything wrong here, this is how the Execute Workflow node behaves at the moment I am afraid. This is unrelated to the Stop And Error node in your sub-workflow and would also happen for other errors.

So for now if you need the error data in your parent workflow, you would need to use the Continue On Fail setting:

You would then get an error field in the parent which you can use to handle the error:

Hi @MutedJam,

ok, I just wanted to make sure that I have no chance to get error messages from sub processes to parent process unless I use some kind of Set or Function Node.

Thank you!

The Continue On Fail setting should be available on all nodes so this should would work for most cases (with the Stop And Error node being an exception seeing it’s sole raison d’être is to stop and error).