Skip to main content

Automate NPM package installation and updates for self-hosted environments

Workflow preview

Workflow preview
100%
Automate NPM package installation and updates for self-hosted environments preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Are you looking to install external libraries for your self hosted N8N instance? This automated workflow makes adding npm packages to your N8N environment quick and effortless. ![image.png](fileId:...

Best for

  • DevOps automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.manualtrigger, n8n-nodes-base.splitout, n8n-nodes-base.executecommand, n8n-nodes-base.scheduletrigger, n8n-nodes-base.n8ntrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Joachim Brindeau.

Original n8n.io source

1.1 Workflow description

Title
Automate NPM package installation and updates for self-hosted environments
Workflow name
Automate NPM package installation and updates for self-hosted environments

Are you looking to install external libraries for your self-hosted N8N instance? This automated workflow makes adding npm packages to your N8N environment quick and effortless.

Beware, this workflow only works on self-hosted instances.

What This Workflow Does

This solution automatically installs npm packages like axios, cheerio, or node-fetch in your self-hosted N8N Docker container, making them immediately available in Code nodes.

Key features

Automated Installation: No manual npm commands needed ✅ Daily Updates: Scheduled trigger keeps packages current ✅ Smart Installation: Only installs missing packages ✅ Multiple Triggers: Manual, scheduled, and on startup of the N8N instance so you can upgrade your N8N version without worrying about external libraries.

How to install and update external libraries automatically

Step 1: Setting Up Your Environment Variables

Before using external libraries in N8N Code nodes, configure these environment variables in your Docker comppose file.

Option A to allow specific external npm packages in N8N Code nodes
NODE_FUNCTION_ALLOW_EXTERNAL=axios,cheerio,node-fetch
Option B to allow all external npm packages in Code nodes
NODE_FUNCTION_ALLOW_EXTERNAL=*

Step 2: Import the external packages workflow

Import the workflow into your N8N instance by copy pasting all nodes.

Step 3: Input the list of external libraries you need

Edit the libraries_set node Change the comma-separated list (e.g., axios,cheerio,node-fetch).

If you chose Option A above, update your NODE_FUNCTION_ALLOW_EXTERNAL variable with the same packages

Step 4: Start the workflow!

Run the workflow manually or let it trigger automatically

Why use this to install NPM packages in N8N?

Managing external packages manually in N8N can be time-consuming. This workflow automates the entire process, making sure your libraries are always installed and up-to-date.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - libraries_set

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - trigger_manual

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 3 - libraries_array

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - libraries_split

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - library_install

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 6 - trigger_schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - trigger_instance

Type / Role
n8n-nodes-base.n8nTrigger - n8nTrigger
Config choices
Version 1

3. Summary Table

Workflow Automate NPM package installation and updates for self-hosted environments
Complexity intermediate
Nodes 7
Categories DevOps
Author Joachim Brindeau
Published 23 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3293/3293.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate NPM package installation and updates for self-hosted environments do?

Are you looking to install external libraries for your self hosted N8N instance? This automated workflow makes adding npm packages to your N8N environment quick and effortless. ![image.png](fileId:...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.