Use this robust n8n workflow to automate Docker-based n8n updates securely. Features scheduled checks, digest comparison, and required email approval before executing critical SSH commands.
Download this n8n workflow template and start using it instantly.
Maintaining a self-hosted application like n8n requires regular updates to benefit from new features and security patches. However, automated updates should never run without oversight. This highly secure and efficient n8n workflow solves this challenge by acting as a controlled self-updating agent.
The automation initiates a check every three days (customizable using the n8n trigger), comparing the currently running Docker image digest against the latest digest on Docker Hub without pulling the image—saving bandwidth and time. If an update is detected, the n8n node responsible for emailing sends a request for explicit approval. Only when the user clicks 'Approve' will the subsequent SSH n8n node execute the safe update commands, ensuring complete control over the deployment schedule. This is a critical n8n workflow designed for stability and security.
The n8n workflow follows a strict, multi-stage approval and execution process:
Schedule Trigger n8n node, starts the process every 72 hours (3 days).:latest tag, ensuring the check is bandwidth-efficient.updateavailable flag is true or false based on the digest comparison.updateavailable status. If no changes are found, the workflow ends silently. If an update is detected, it proceeds to the approval step.update_docker.sh) via SSH. If the script is missing, a new SSH n8n node generates the file containing the necessary docker compose pull, docker compose down, and docker compose up -d commands, prefixed with a 30-second sleep timer.nohup and &. The 30-second delay ensures the n8n workflow completes its current execution successfully before the n8n container restarts, guaranteeing a graceful shutdown of the initiating session.To deploy this powerful n8n workflow, follow these setup steps:
root), and Password/Key.Ask For Approval to Update n8n node and update the To Email and From Email fields to your administrative email addresses./opt/n8n-docker-caddy), as specified in the script creation logic.Schedule Trigger n8n node. Run a manual test first to confirm email receipt and SSH connectivity before letting the n8n workflow run automatically. Schedule Trigger: This n8n trigger sets the schedule for the update check. Configured to run every 3 days at 16:00 UTC, ensuring timely, yet infrequent, update checks.
SSH Node (Get Current n8n Version/Digest, Check Script, Create Script, Execute Script): Multiple SSH n8n nodes are fundamental to this n8n workflow. They are used to securely run remote commands on the Docker host server. Key configurations include dynamic commands (docker exec n8n --version, digest retrieval commands, and the final nohup execution command) and specific working directories (/root).
HTTP Request (Get Remote Image Digest): Queries Docker Hub API to get the latest digest. This n8n node operates without needing Docker installed on the n8n host itself, only relying on API access.
Set Node (Prepare Update Data): An essential logic n8n node that aggregates data from the version checks and calculates the boolean value update_available by comparing the local and remote digests.
Email Send Node (Ask For Approval to Update): Uses SMTP credentials to send a rich HTML email detailing the update status. Crucially, it uses the sendAndWait operation with approval options, transforming this into a human-in-the-loop n8n workflow step.
If Nodes (If No Changes, If Approved, If File Exists): These n8n nodes control the flow based on dynamic data. They ensure the email is only sent if an update exists, and the SSH update commands are only executed if explicit approval is granted.
Use this powerful n8n workflow to automate checking and updating your self-hosted n8n Docker instance. This n8n template integrates SSH for executing Docker commands and Telegram for secure, manual approval.

Automate digital product delivery using this n8n workflow. Triggered by Stripe payments, it handles logging in Google Sheets, securing file links from Google Drive, and sending the product via email.

Automate your e-commerce backend using n8n. This n8n workflow processes Stripe payments, sends product-specific emails, logs sales to Notion, and notifies Telegram upon successful checkout.

Automate sophisticated multi-level document approval processes using this n8n workflow template, leveraging Supabase as the backend database and Gmail for secure, tokenized approval links. Track every step with audit logs.

Use this powerful n8n workflow to automatically ingest, chunk, embed, and index Google Drive documents into Pinecone for a custom RAG (Retrieval Augmented Generation) knowledge base, powered by OpenAI. Discover how to create efficient n8n templates.

Use this powerful n8n workflow to automatically deploy and orchestrate multiple RAG agents via Contextual AI and Gemini. This advanced n8n template leverages sophisticated n8n nodes, memory, and specialized tools, starting with the n8n trigger.








































