Docker Self-Hosted Instance Auto-Updater with AI Approval - n8n Workflow

Automate updates for your self-hosted n8n Docker instance. This n8n workflow uses SSH and AI (Gemini) for release note summarization and Telegram approval before executing the update.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • System administrators and DevOps engineers managing self-hosted infrastructure.

  • Users running critical n8n workflows who need controlled, scheduled updates.

  • Developers looking for advanced n8n templates integrating Docker management and AI summarization.

  • Anyone seeking a reliable, approval-gated mechanism for maintaining their n8n installation.

Overview

Keeping a self-hosted n8n instance up-to-date is crucial for security and access to new features. This sophisticated n8n workflow solves the manual burden of this process. Running on a schedule set by an n8n trigger, it automatically verifies the version discrepancy using Docker image digests. A key feature of this specific n8n workflow is the integrated safety check: it retrieves the new release notes, uses the Google Gemini n8n node to generate a concise, user-friendly summary, and sends a notification via Telegram. The core update action is blocked until the user explicitly approves the change via the Telegram interface. This balance of automation and human oversight ensures stability while maintaining a perfectly optimized n8n environment.

How it Works

This comprehensive n8n workflow starts with the 'Every Hour' Schedule n8n trigger, initiating a maintenance check.


  1. Initial Checks: The n8n workflow first uses an HTTP Request n8n node to fetch instance settings, confirming it is a Docker installation. The subsequent 'Docker Path' n8n node sets critical variables, including the server path to the docker-compose.yml file.

  2. Version Detection: An SSH n8n node runs a Docker inspect command to find the currently running image tag. This is followed by HTTP requests to Docker Hub to retrieve the unique cryptographic digests of both the running version and the latest available version.

  3. Update Logic: The 'Needs Update?' If n8n node compares these two digests. If they are different, an update is required, and the flow proceeds.

  4. Release Note Summary: The n8n workflow fetches the raw GitHub release notes. If the release is new (checked by the 'Published In Last Hours?' n8n node), the data is passed to the 'Google Gemini Chat Model' n8n node, which, in conjunction with the 'Release Overview' Chain LLM n8n node, generates an easy-to-read summary of important changes based on a detailed instruction prompt.

  5. Manual Approval: The summary and version number are sent via the 'Approve Update' Telegram n8n node, which pauses the n8n workflow. The flow only continues if the user clicks the 'Update' button.

  6. Final Execution: Upon approval, the final 'Update Docker' SSH n8n node executes the Docker update sequence (docker compose pull, down, up -d) in the background (nohup), ensuring the self-hosted n8n instance is updated safely and without crashing the execution itself.

Installation Guide

To use this n8n workflow template, follow these steps:


  1. Import: Import the provided n8n workflow JSON into your n8n instance.

  2. Credentials Setup:

Set up an SSH Password credential for your host machine (the server running Docker). This credential must have permissions to execute Docker commands in the specified path.
Set up a Telegram Bot credential for the 'Approve Update' n8n node. You will need your bot token and chat ID for notifications and approval.
* Set up a Google Gemini/Palm API credential if you intend to use the AI summarization features.

  1. Configure Paths: Go to the 'Docker Path' n8n node and update the dockerpath value to the absolute path of your docker-compose.yml directory on the server (e.g., /home/user/n8n-docker-data). Also, adjust the workercommand if you run scaled workers.

  2. Optional: Full Automation: If you prefer automatic updates without Telegram approval, delete the nodes between 'Needs Update?' and 'Update Docker' (as indicated in the Sticky Note) and connect the 'True' output of 'Needs Update?' directly to 'Update Docker'.

  3. Activate: Save and activate the n8n workflow.

Node Details


  • Schedule Trigger (Every Hour): The starting n8n trigger, ensuring the update check runs hourly.

  • HTTP Request (Get Instance's Settings): Verifies that the running n8n instance uses Docker and retrieves its current CLI version number.

  • Set (Docker Path): Stores configuration variables like the server's dockerpath (critical for the SSH commands) and any optional workercommand for scaling.

  • SSH (Get n8n Current Version & Update Docker): Executes commands on the remote server. The 'Update Docker' n8n node runs a crucial background command using nohup for safe, non-blocking updates.

  • HTTP Request (Docker Hub Version Checks): Queries the Docker Hub API to fetch the unique digest IDs used for precise version comparison.

  • If (Needs Update?): The core decision-making n8n node, comparing the running digest against the latest Docker Hub digest.

  • LLM Chat Google Gemini & Chain LLM (Release Overview): These n8n nodes analyze the raw release notes fetched from GitHub, applying a complex prompt to summarize technical changes for user convenience.

  • Telegram (Approve Update): An interactive n8n node that sends the AI summary and pauses the n8n workflow until the user provides manual approval, acting as a critical security gate before the final update execution.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Innovative builder with a passion for crafting automation solutions that solve real-world challenges. From streamlining workflows to driving efficiency, my work empowers teams and individuals to achieve more with less effort. Experienced in developing scalable tools and strategies that deliver results with n8n, supabase and cline.

Featured*