Automate installing and validating required NPM packages (like axios or cheerio) within your self-hosted n8n environment using a resilient n8n workflow. Perfect for Docker deployments.
Download this n8n workflow template and start using it instantly.
Markdown-formatted:
Users running self-hosted n8n instances (especially Docker) who require custom NPM libraries.
Technical users who write custom JavaScript in Function n8n nodes or utilize third-party modules.
DevOps specialists seeking reliable environment maintenance for their n8n instance.
Developers looking for resilient n8n templates to standardize dependency deployment.
Maintaining consistency in a self-hosted n8n environment, particularly when custom libraries are needed for advanced scripting in Function nodes, can be challenging. Container restarts often reset the environment, removing dependencies. This powerful n8n workflow solves this by automatically checking for and installing essential NPM packages (e.g., axios, cheerio, node-fetch) whenever the n8n instance starts, on a scheduled basis, or via manual command. By utilizing the Execute Command n8n node, this n8n automation ensures that your environment is always ready for complex operations, improving the reliability of all your other n8n templates and custom solutions.
Markdown-formatted:
This comprehensive n8n workflow is designed for maximum operational resilience, featuring three independent n8n trigger nodes.
triggermanual), periodically (triggerschedule), or critically, when the n8n instance initializes (triggerinstance with the init event). This ensures package availability even after a server reboot.librariesset, defines a comma-separated string containing all required packages (e.g., axios,cheerio,node-fetch).librariesarray, converts this string into a processable JSON array using a simple split expression. librariessplit, separates the array so that each package name is handled as an individual item, ensuring the installation process is atomic for every library.libraryinstall. This n8n node executes a Bash script that performs three critical tasks for the given library:nodemodules path.npm install "$LIBRARY_NAME".Markdown-formatted:
librariesset n8n node and update the value in the 'libraries' field to include all the specific NPM packages required by your custom n8n templates and Function nodes.triggerinstance (Init event) is active. The trigger_schedule can be configured for daily or weekly checks if required. Markdown-formatted:
Manual Trigger / Schedule Trigger / n8n Trigger: These three n8n trigger nodes provide flexible initiation points (manual run, scheduled check, and instance initialization) for the dependency management process.
Set (librariesset): Function: Holds the initial list of required NPM packages as a comma-separated string (axios,cheerio,node-fetch). This is the primary configuration point for defining dependencies in this n8n workflow.
Set (librariesarray): Function: Transforms the comma-separated string into a JSON array using the expression {{ $json.libraries.split(",") }}, preparing the data for iteration.
Split Out (librariessplit): Function: Splits the array so that each package name becomes a distinct item, allowing the subsequent n8n node to process each installation request independently.
npm install only if the package is missing. This process ensures necessary libraries are consistently available in the n8n environment.Automate NGO aid request intake using a sophisticated n8n workflow. Transcribe voice messages, categorize requests with GPT-4o-mini, and log all data to Google Sheets for seamless logistics.

Automate Japanese ⇄ English translation in Slack using a powerful n8n workflow integrated with Google Gemini 2.5 Flash. Supports slash commands, mentions, and reactions.

Use this dynamic n8n workflow to automate multi-step onboarding sequences. It integrates n8n Forms, Google Sheets for tracking and templates, and Gmail for personalized, conditional communication.

Automate NPS surveys after a deal closure in GoHighLevel. This n8n workflow captures scores via Gmail, routes feedback, and logs detractors/promoters in Notion.

Use this powerful n8n workflow to automate new customer onboarding. Integrates HubSpot, Gmail, Google Calendar using an n8n AI agent for personalized scheduling and emails. Download the n8n templates today.

Automate scheduled news article extraction using ScrapegraphAI within a powerful n8n workflow. Use a custom n8n node to structure the data and append results directly to Google Sheets for analysis. Get this highly effective n8n template now.








































