Joachim Brindeau
Workflows by Joachim Brindeau
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.
Simple Google indexing workflow in n8n
# What it does The workflow is a simple yet efficient way to automate the process of indexing your website on Google using the Google Indexing API. # How it works It works by extracting information from your sitemap, converting it into a JSON file, and looping through each URL to submit it for indexing. Here's a brief rundown of the workflow: 1. The workflow can be triggered manually via the "Execute Workflow" button or scheduled to run at a specific time using the "Schedule Trigger" node. 2. The sitemap of your website is fetched using the "sitemap_set" node with a HTTP Request to the sitemap URL. 3. This XML sitemap is then converted into a JSON file using the "sitemap_convert" node. 4. The "sitemap_parse" node splits the JSON file into individual URLs. 5. The "url_set" node then prepares each URL to be sent to the Google Indexing API. 6. A loop is created using the "loop" node to process each URL individually and make a POST request to Google Indexing API indicating that the URL has been updated. 7. If the POST request is successful and the URL has been updated, the workflow waits for 2 seconds before moving to the next URL. 8. In case the daily limit for the Google Indexing API is reached (200/day by default), an error message is triggered using the "Stop and Error" node. # Before you use the workflow ## Activate the indexing API * Create an account with Google Cloud Platform > Console and then create a new project * Search for the Indexing API in the Library * Activate the API ## Create a Service Account and get credentials * Open the Service accounts page. If prompted, select a project. * Click add Create Service Account, enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. * When done click Create. * On the Grant users access to this service account screen, scroll down to the Create key section. Click add Create key. * In the side panel that appears, select the JSON format * Click Create. Your new public/private key pair is generated and downloaded to your machine. * Open the file and copy the private key. * Add the credentials in the url_index node  ## Add the user as owner of the site Beware, for each site you need to add the user as a owner like this:  ## Set your sitemap * Open the sitemap_set node and add the url to your sitemap. ------- *Now you should be able to ensure that Google is always up-to-date with the latest content on your website, improving your website's visibility and SEO rankings, have fun!*