HeadlinesBriefing favicon HeadlinesBriefing.com

n8n Code Node: Import External Libraries

DEV Community •
×

Developers can now extend n8n's Code Node capabilities by importing external Python and JavaScript libraries. The process involves creating a custom Dockerfile based on the `n8nio/runners` image to install packages like `numpy` or `moment`. You must also configure a `n8n-task-runners.json` file to allowlist these dependencies, ensuring the execution environment remains secure while unlocking advanced functionality for complex workflows.

This configuration change addresses a key limitation in hosted automation platforms: restricted access to specialized packages. By managing custom runner images, teams can integrate data science libraries or specific utilities directly into their n8n workflows. This moves beyond standard node actions, allowing for bespoke logic and data manipulation that rivals custom-coded applications.

The workflow requires building your custom image and replacing the default `n8nio/runners` reference in your deployment. Once running, you can verify the setup by importing the allowed libraries directly within a Code Node. This approach gives developers granular control over their automation environment without sacrificing the core stability of the n8n platform.