Leverage this powerful n8n workflow to monitor Docker containers via webhooks and manage them using a Telegram bot. Features AI-powered log analysis via OpenAI and remote SSH commands.
Download this n8n workflow template and start using it instantly.
This advanced n8n workflow is designed to centralize Docker infrastructure management and monitoring. It addresses the common pain point of diagnosing container failures by integrating an AI model (via the n8n OpenAI node) directly into the operational flow. The workflow has two primary interfaces: an external webhook for proactive monitoring alerts (e.g., container crash notifications) and a Telegram bot for reactive, on-demand commands (like fetching logs, checking status, or performing restarts). By using the SSH n8n node, it securely executes Docker commands on a remote server, while the AI component provides expert, structured analysis of complex log files, transforming raw data into actionable insights. This robust n8n automation significantly reduces downtime and accelerates debugging cycles, proving the power of a well-configured n8n workflow.
The entire flow leverages two main n8n trigger mechanisms:
ERROR Message is instantly sent via Telegram, offering actionable inline buttons (Logs and Restart) corresponding to the problematic container.Extract the Service Name) first parses the command to identify the target container.docker logs --tail 100. The resulting output is forwarded to the Message a model (OpenAI) n8n node. This node uses a highly customized prompt to act as a senior IT specialist, analyzing the raw logs and generating a structured report (Summary, Root Cause, Recommended Steps). This detailed analysis is then delivered to the user via a Telegram n8n node.docker ps to list all running containers and their status, sending the formatted list back to the user.update-all-docker-compose.sh) via the SSH n8n node. The output of this script is then parsed by a Python Code n8n node to generate a clean update summary, which is sent back to the user, confirming which images were updated. This comprehensive n8n workflow ensures full remote control and intelligent diagnostics.To deploy this powerful n8n workflow, follow these setup steps:
8209283663) in all Telegram nodes.Message a model n8n node../update-all-docker-compose.sh) available and executable, matching the parsing requirements of the Code in Python (Beta) n8n node. Webhook (n8n trigger):
Function: Serves as the passive n8n trigger, listening for container status updates from external monitoring services.
Key Configuration: Accepts POST requests.
Telegram Trigger (n8n trigger):
Function: The interactive n8n trigger, initiating the flow based on user commands received via the Telegram bot.
Key Configuration: Listens for message updates.
Switch n8n node:
Function: Routes the execution flow based on the content of the Telegram message (e.g., matching 'logs', 'restart', 'status', or 'update').
Key Configuration: Compares the lowercased message text.
SSH n8n node (get logs):
Function: Executes the command docker logs --tail 100 [service name] on the remote host to retrieve diagnostic information.
Key Configuration: Dynamic command expression using data from the Extract the Service Name Code n8n node.
OpenAI n8n node (Message a model):
Function: This crucial n8n node performs advanced log analysis, using a detailed system prompt to interpret the raw Docker output and provide structured debugging insights.
Key Configuration: Uses gpt-4.1-mini model, feeding log output via ={{ $('get logs').item.json.stdout }}.
Code in Python (Beta) n8n node:
Function: Parses the structured output of the shell update script, translating complex update logs into a clean, consumable message for the Telegram user interface.
Key Configuration: Custom Python script using re and json libraries for string parsing.
Use this n8n workflow to automatically monitor French BOAMP tenders, apply keyword filtering to PDF content, and save relevant opportunities to Google Sheets, ensuring you never miss a vital contract.

Deploy this robust n8n workflow to automatically monitor startup news via RSS, scrape content using BrightData, extract structured seed funding data with GPT-4.1-MINI, and log results directly to Microsoft Excel.

Use this robust n8n workflow to schedule periodic checks of AWS EC2 instance health. Features include automated self-healing (restarts), detailed logging to Google Sheets, and multi-channel alerts (WhatsApp/Email). Start building with n8n templates today.

Automate Google Maps review monitoring using an n8n workflow. Scrape new reviews, use AI to draft replies, save to Google Sheets, and send instant Slack alerts for negative feedback.









































