Use this comprehensive n8n workflow to automatically monitor and safely update your self-hosted n8n instance. It checks for running executions before updating and sends alerts via Telegram.
Download this n8n workflow template and start using it instantly.
Keeping a self-hosted n8n instance updated is crucial for security and accessing new features, but manual updates risk triggering downtime while workflows are running. This robust n8n workflow solves this challenge by automating the version check and the update process. It starts daily or upon n8n initialization, determines if a newer version is available, and, critically, checks for active workflow executions. The update is only performed if the system is idle, ensuring zero interruption to running automation tasks. All events—updates available, instance is current, or update initiated—are reliably communicated via Telegram, making this a truly 'set-it-and-forget-it' maintenance n8n solution. This specific n8n template provides critical DevOps functionality.
This automation begins via two potential n8n trigger points: either on a daily schedule (using the Daily Trigger n8n node) or immediately upon n8n startup (using the n8n Startup Trigger n8n node).
n8n -v to get the current installed version and an HTTP Request n8n node to query the GitHub API for the latest official release version.updateAvailable flag to true if a discrepancy is found.updateAvailable flag.runningCount is zero, setting the canUpdate flag.canUpdate. If false, the workflow enters a safety loop: it uses the Wait n8n node for one minute and retries the execution check. If true (it is safe to update), a final Telegram n8n node announces the update is commencing, followed by an Execute Command n8n node running the update script (sudo npm install -g n8n && sudo systemctl restart n8n). This robust n8n workflow structure ensures minimal operational risk.To deploy this powerful n8n workflow template, follow these steps:
Notify Update Available, Notify Latest Version, and Notify Update Start).Execute Update n8n node is configured for a Linux/NPM self-hosted environment (sudo npm install -g n8n && sudo systemctl restart n8n). If you are using Docker, Kubernetes, or another environment, you must replace this command with the appropriate update method (e.g., pulling a new Docker image).This n8n workflow leverages several specialized n8n nodes:
Daily Trigger & n8n Startup Trigger: These act as the starting n8n trigger points, initiating the maintenance check daily and upon initialization.
Execute Command (Get Current Version): Runs the system command n8n -v. It is fundamental to retrieving the installed version needed for comparison in this n8n template.
HTTP Request (Get Latest Version): Queries https://api.github.com/repos/n8n-io/n8n/releases/latest to retrieve the latest version tag from the official n8n repository.
Code (Compare Versions): A core n8n node for logic. It cleans the version strings and compares them, outputting a clear boolean flag updateAvailable.
n8n Node (Get Executions): A self-referential n8n node that communicates with the local n8n API to pull a list of all current workflow executions. This is vital for the safety check.
Function (Check Running Workflows): Analyzes the list provided by the n8n node to count executions with a status of 'running', generating the canUpdate flag.
Execute Command (Execute Update): Contains the update and restart command. Key configuration is the command itself: sudo npm install -g n8n && sudo systemctl restart n8n (must be customized for non-NPM installations).
Wait: Used in the 'unsafe' path of the IF node to pause for 1 minute before retrying the running workflow check, creating a resilient wait-and-retry mechanism.
Use this robust n8n workflow to automatically monitor SSL/TLS certificate expiry dates across all your domains. This automation checks certificates via an API and triggers high-priority alerts via Slack 30 days before expiration, preventing downtime.

Automate daily SSL certificate monitoring using this free n8n workflow. Check expiry dates via API, update Google Sheets, and send alerts for soon-to-expire domains. This n8n template is perfect for DevOps.

Learn how to build a complex n8n workflow to pull data from MySQL, structure it, convert it to XML, and format it using a dynamically served XSLT template for modern web delivery.

Deploy an advanced AI Sales CRM chatbot using this n8n workflow. It leverages GPT-4o-mini, Google Sheets, and conversation memory for real-time lead and opportunity lookups. Get this n8n template now.

Automate deep sales research using this powerful n8n workflow. Match contacts, enrich data with Apollo, and generate personalized AI-driven pain point summaries using Linkup to prepare for outreach. Get started with n8n templates today.









































