Execute Sub-Workflow Delays Parent

Describe the issue/error/question

I’ve been using n8n for a few months now and building more and more complex workflows. I’m trying to understand best practice for breaking processes out into sub-workflows, especially as some are becoming so big (over 100 nodes) that editing changes during development is very slow. Large workflows don’t appear to compromise the actual runtime of the workflow, just page load in the browser.

I’ve started to break larger workflows up into smaller, more manageable ones, and calling these with the ‘execute workflow’ node - but I’ve hit a strange issue. It appears that when a sub-workflow is called, the parent pauses processing until that sub-workflow is complete.

Is this expected behaviour?

Any suggestions from this forum on how to build nimble and efficient workflows that contain many tasks?

Hi @Felix_is_stuck, yes, this would be the expected behavior when executing a sub-workflow through the Execute Workflow node (or when running any other node). This allows you to work with the full data returned by the respective node.

If that’s not desired, you could call your sub-workflows for example through an HTTP Request node in the main workflow sending a request to the Production URL of a Webhook node in the sub-workflow. If you don’t need the data returned by the sub-workflow at all simply set the Respond option to immediately:
image

This way, your main workflow would get a response almost immediately and wouldn’t have to wait for the sub-workflow to finish.

1 Like