Executing workflow fails

Describe the issue/error/question

Hey, I’ve been using the execute workflow node quite a lot to split up my codebase but one thing that I regularly come across, is seeing this node fail in the automated executions (mostly triggered by webhooks). I don’t quite know why this is happening and would love to get some pointers on how to fix this

What is the error message (if any)?

TypeError: Cannot read properties of undefined (reading 'stack')
    at Object.executeWorkflow (/usr/local/lib/node_modules/n8n/dist/src/WorkflowExecuteAdditionalData.js:552:66)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ExecuteWorkflow/ExecuteWorkflow.node.js:162:34)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:451:47

Please share the workflow

I don’t think that these specific nodes matter too much, I’ve had it happen multiple times already in different workflows, in different constellations as well. Anyways, this time it was the second node that produced the error message

Information on your n8n setup

  • n8n version: 0.169.0
  • Database you’re using (default: SQLite): default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: cloud

Hey @jodeldiplomant, I am sorry to hear you’re having trouble. I did not run into this problem on my own side, even when executing several thousand sub-workflows.

As an initial pointer, could you check the execution data of your sub-workflow? Which node errors in your sub-workflow and what’s the error message?

Thats the weird part… The subworkflow got executed without any problems, but almost half an hour later. The workflow with the node which failed ran for 3.3 seconds, so the delay in time doesn’t make any sense. The subworkflow has a wait node which is supposed to wait for 10 minutes, but the workflow took 0.3 seconds to execute according to the execution history.
In the startnode of the subworkflow, the passed data is:

[
{
"error": "Cannot read properties of undefined (reading 'stack')"
}
]

All of these things really aren’t adding up…
Let me know your thoughts, in case you understand what is going on here…

I am also experiencing this issue with the “Execute workflow” node.

“ERROR: Cannot read properties of undefined (reading ‘stack’)”

This just started happening out of the blue, and it is not preventing the executed workflow from being executed successfully… it just shows as an error in my execution log.

Hi @matt.dick,

How do you have n8n installed / running? Are you also using a workflow to trigger another one?

@Jon
We are using n8n cloud. After further investigation, this error happens when we trigger a different workflow with long Wait nodes from inside the erroring workflow. Our solve was to replace Execute Workflow node with a webhook. Is this best practice?

Hey @matt.dick,

Cloud is a bit different as I think there are execution timeouts so you could be hitting those limits.

You should be able to still use the execute workflow option but maybe check the wait times and tweak them or depending on the flow maybe implement some kind of batch processing to store them somewhere and run in one hit.

I’d love to know more about this issue, as I have the same problem. I’m using the Execute Workflow node, and getting the same error there:

ERROR: Cannot read properties of undefined (reading ‘stack’)

The second workflow has a Wait node, and the Wait node is an essential part of the workflow. If I remove the Wait node, then it all runs, but I need the workflow to wait! It seems that the reason for the error is directly coming from the Wait node being part of the second workflow.

Here is the setup of my Wait node:

It doesn’t have a preset time to Wait, it waits for a webhook, and the time for that is something I can’t predict.

Please help?

EDIT:
Perhaps it’s worth adding that the second workflow can also be run without the first by triggering a webhook. It has 2 options for how it’s triggered. When it runs from the Webhook it all works, including the Wait node, perfectly.

Sorry to bring this back from the dead, but did you ever manage to reproduce this issue @Jon? I am having the same issue. The wait node in my case waits for a webhook postback. When running the nodes directly in a flow it works fine, after extracting them into an external process they fail (But run fine when run directly through the editor UI or through a webhook. It’s only when using the Execute Workflow node.

Hey @Calvin_Mann,

Welcome to the community :raised_hands:

I think we did manage to reproduce this but I can’t remember if we have fixed it yet. Are you using n8n in queue mode or is it just one instance you have running?

I’m on n8n cloud (Using the ai enabled version if that helps).

To add to my previous information, the flow also works when invoked from a webhook (Which is what I’m using currently to get around the issue)

I have nothing very secret in the account yet. I would be happy to share access for you to take a look

Hey @Calvin_Mann,

It sounds like we possibly have not yet fixed it then. I will see if I can find the dev ticket and get an update.

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