Templates / Automatically update n8n version

Automatically update n8n version

Ready for 3.0

by Weilun Β· 2,453 views Β· created 2025-05-23 Β· DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (4)

What it does

πŸ”„ n8n Workflow: Check and Update n8n Version This workflow automatically checks if the local n8n version is outdated and, if so, creates a file to signal an update is needed. --- πŸ–₯️ Working Environment - Operating System: Ubuntu 24.04 - n8n Installation: Docker container --- πŸ“ Project Directory Structure n8n/ β”œβ”€β”€ checkupdate.txt β”œβ”€β”€ check-update.sh β”œβ”€β”€ compose.yml β”œβ”€β”€ updaten8n.cron --- 🧾 File Descriptions checkupdate.txt Contains a single word: - true: Update is needed - false: No update required --- check-update.sh bash !/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin if grep -q "true" /home/sysadmin/n8n/checkupdate.txt; then Place your update logic here echo "Update needed - please insert update logic" echo true > /home/sysadmin/n8n/checkupdate.txt fi Purpose: - Checks the contents of checkupdate.txt - If it contains true, executes update logic (currently a placeholder) - Resets checkupdate.txt to true --- updaten8n.cron cron SHELL=/bin/sh 10 5 /bin/sh /home/sysadmin/n8n/check-update.sh Purpose: - Runs the check-update.sh script daily at 5:10 AM - Uses /bin/sh as the shell environment 🧩 n8n Workflow Breakdown 1. Schedule Trigger πŸ•“ - Purpose: Triggers the workflow every day at 5:00 AM - Node Type: Schedule Trigger --- 2. Get the latest n8n version 🌐 - Purpose: Fetches the latest version of n8n from npm - Endpoint: https://registry.npmjs.org/n8n/latest - Node Type: HTTP Request --- 3. Get Local n8n version πŸ–₯️ - Purpose: Retrieves the currently running n8n version - Endpoint: http://192.168.100.18:5678/rest/settings - Node Type: HTTP Request --- 4. If πŸ” - Purpose: Compares the local and latest versions - Condition: If not equal β†’ update is needed --- 5. SSH1 🧾 - Purpose: Writes the result to a file on the host via SSH - Logic: bash echo "{{ $('If').params.conditions ? 'false' : 'true' }}" > checkupdate.txt Effect: Updates checkupdate.txt with "true" if an update is needed, "false" otherwise. πŸ› οΈ Setting up Crontab on Ubuntu 1. Register the cron job with: bash crontab updaten8n.cron 2. Verify that your cron job is registered: bash crontab -l βœ… Result - 5:00 AM – n8n workflow checks versions and writes result to checkupdate.txt - 5:10 AM – Cron runs check-update.sh to respond to update flag

View the original on n8n.io β†’ Check your own copy

Get the weekly β€œwhat broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.