Nested Subflows

Describe the problem/error/question

I have a main workflow (Main) that calls a subflow (Sub A) and this flow calls another subflow (Sub B). Now when I trigger Sub A the flow correctly calls Sub B and works fine. When I run Sub B standalone it runs fine as well.
The problem arises when I run my Main Flow. Then I get an error message “Problem in node ‘Call Subflow’. Workflow is not active and cannot be executed.”
n8n version: 2.3.2
Database: default
Running via Docker on Windows

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

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

hello @Error

You should hit the Publish button in both the Sub workflow A and B

1 Like

Thank you a lot, this worked. Yet, a new question arose: I have not published Subflow A, but calling this chain works, if I ONLY publish Subflow B. Apparently, subflows can be called without publishing if there is only one level. Is this wanted?

yep :slight_smile:

You are seeing it because of multiple things:

  • When you hit the “Execute workflow” button in the main WF, it is able to call the nested workflow without the need to be published, as it sees that you run the workflow manually. However, when the sub workflow A executes the chained workflow B, the last one doesn’t see that it is a manual run and behaves like it is a production run (which requires publishing).
  • The same logic would apply if you hit the “Execute Workflow” button in the sub workflow A. In that case the workflow B could be executed without publishing.
  • However, if you enable the production runs for the main WF (hit the publish button and a trigger will be activated), you will get the same error for the sub WF A.
1 Like

Thank you so much for this explanation. Now it’s clear!

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