problem is that when running a workflow with “execute workflow” trigger the sub-workflow is always running with $exectuion.mode = production.
I couldn’t find if this is a “feature” but for me it is confusing that is why I wanted to ask you.
Workflow which was run as a test calls the same workflow but through the other trigger but this time the mode is production
I would assume this happens because sub-workflows triggered via the “Execute Workflow” node always run in production mode, regardless of how the parent was started (manual, schedule, webhook, etc.).
It’s not a bug per se — but the way n8n handles context across executions can be confusing, especially when $execution.mode is used for logic branching. The UI makes it look like the context is shared, but under the hood, it’s a separate execution without inherited metadata.
As much as I was expecting that it is just a “feature” that is a little confusing to me it still does NOT explain why it displays “test” for starting the workflows directly (with form trigger and without subworkflow call)
Even with such workflow when you start it with “production URL” it displays wrong value, this must be a bug, isn’t it?
When viewing your workflow within the n8n editor (specifically within the expression preview pane), expressions like $execution.mode default to pulling data from the live editor context, which typically returns "test" . This behavior occurs because the editor itself is always in test mode.
When invoking the workflow manually from within the editor, this is accurately considered a test execution, hence explicitly showing "test" in the preview pane.
However, when calling this workflow from another workflow or triggering it via the production URL (webhook, form submissions, schedules, or external API calls), the actual runtime environment takes effect. In these real runtime scenarios, $execution.mode correctly reflects the execution context, displaying "production" , as confirmed in your actual node output data.
Regarding your screenshot from the executions tab: Ideally, the executions history view should reflect "production" as the actual context used during execution. However, it seems the GUI incorrectly pulls the $execution.mode metadata from the live editor context (which is always in test mode), rather than from the execution data itself. Thus, it incorrectly displays "test" despite the execution being in "production" mode.
For additional details, you can refer to official documentation here:
You can always pin the data the sub-workflow would receive and then test from there by clicking the little play button on the node you want to start test execution from. This way you can test different starting points from the workflow you want to test.
In your case the workflow calls itself, so pin data on the “When Executed…” node, then click the play button on that node. Then click the play buttons on the next node and so on. Hope that makes sense?