HELP: Workflow running older version of subworkflow

Describe the problem/error/question

Main workflow is calling an older version of subworkflow, not sure how nor why.

I have 2 instances, homo and prod.

I make changes on homo >> push to git >> merge on branch >> pull to prod. This worked fine so far.

This is my main workflow calling the subworkflow:

As you can see, it is calling an workflow, which has this inside it (by clicking the arrow on the right, by the way):

But if i try to run the main workflow and look into the executions, we can see that it is not the same workflow that is being called. This is an older version, which Ive removed the Code Node and changed it to the Crypto node and it is working in fine in my HOMO branch.

This does’nt makes sense. This was an older version of the same workflow which got pulled and is being used correctly in other places (it has an webhook trigger too, which is being called correctly).

The only problem is when running from this main workflow.

Also, if i try to “Debug in editor” from the errored execution, it shows the updated workflow:

This started when we started the adjustments to prepare for v2, specifically, creating the python runner and setting the native python. In the same time, Ive removed the python node and changed it to a crypto one (as shown in the new version of the workflow).

Please, any help would be much appreciated.

What is the error message (if any)?

There isn’t an error message, just missbehaviour. Also, this problem IS NOT REPRODUCIBLE on another instance (which I have).

Please share your workflow

Can’t do. Too big and with custom nodes.

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.123.7 (on adjustments to v2)
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Oracle Linux

Hi @jgoncalves

What’s happening is that your main workflow is not “looking up the latest code”, it is calling a specific stored version of the sub-workflow.

When a workflow calls another one by ID, n8n uses the version that is currently stored and active in the database on that instance. If, for any reason, the subworkflow in PROD was not actually updated (or was updated but not reactivated), the main workflow will keep executing the old stored definition, even if your HOMO environment and your Git repo already have the new one.

That’s why:

  • running the subworkflow directly works (you’re testing the updated active workflow)
  • webhook calls work (they hit the updated active workflow)
  • but calls coming from this main workflow use an older cached/active version on that PROD instance

This usually happens after migrations, imports from Git, or versioning changes: the workflow record gets updated, but the active version pointer in the DB is still the old one.

The practical fix is simple and resolutive:
in PROD, open the subworkflow, deactivate it, save, then activate it again (or duplicate it and update the main workflow to point to the new copy). This forces n8n to register the latest definition as the active version used by “Execute Workflow”.

If you are syncing via Git, also make sure the import step on PROD is actually updating the existing workflow (same ID) and not leaving the old active version in place.

In short: reactivate (or recreate and relink) the subworkflow in PROD so the main workflow stops calling the stale stored version.

1 Like

Thank you so much!

Deactivating/activating the sub-workflow did the trick, so simple :joy:

1 Like

I’m really happy to hear this helped :blush:

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