Enabling Task Runners Breaks Workflows

Hello

I recently enabled task runners on my self hosted instance and lots of my code nodes that use custom npm packages installed in the docker container stopped working with constructor errors.

I note the warning says task runners will be enabled by default soon, so with this in mind, how do we stop the errors?

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hi @Wayne ,
thanks for your question.
Could you please provide some more information?
I’m not an expert in docker, but it might be helpful to see your setup.

Result of my research with the info so far:
Since task runners are separate containers, you must install your npm packages inside them. You can do this by:

  • Customizing the n8n Docker image to pre-install the required npm packages.
  • Creating a Dockerfile and adding:
FROM n8nio/n8n:latest
RUN npm install -g your-package-name

If this helped you, please mark my reply as correct solution✅ and give it a like❤️
Have fun!:robot:

the packages are already installed globally

Hey Wayne. I’ve pinged the team to see if someone knows what’s wrong here.

1 Like

The issue seems to be that we aren’t using the same set of paths to resolve packages when running inside the task-runner sub-process.
This PR should hopefully address that issue.

I have published a custom docker image ghcr.io/n8n-io/n8n:community-83774 with the fix. That way you don’t need to be blocked until the next release.
Can you please try this custom docker image, and let us know if this fixes the issue for you?

2 Likes

This fix has been merged, and will be included in the next release.

2 Likes

New version [email protected] got released which includes the GitHub PR 13652.

1 Like

Thank you @jan

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