Set up an alert-diagnosis workflow for Kubernetes incidents
An n8n flow takes Alertmanager alerts, checks several MCP-connected systems, and writes a read-only diagnostic reply in Mattermost.
- What they did
- A webhook from Alertmanager kicks off an n8n workflow. It groups duplicate alerts across a 48-hour window, pulls the PromQL query that fired from the Prometheus Rules API, then hands the case to an AI agent. That agent looks through Kubernetes, Grafana, DigitalOcean, GitHub, and a Qdrant index of internal docs, all in read-only mode, and the workflow finds the original Mattermost alert post to answer in the thread.
- How it went
- The output is a diagnostic report that includes a short summary, a timeline of events, up to two likely root causes, and suggested next steps. The source does not report any measured improvement. The author is still considering adding more signals, including database metrics and pipeline status.
- Tips
- Keep retries to a single attempt for each failed tool call so the agent does not loop. Remove noisy labels such as job and instance before sending the alert into the prompt, and set up your own MCP endpoints and credentials.
Try it yourself with n8n
Create an n8n workflow that starts from an Alertmanager webhook. First, deduplicate matching alerts over a 48-hour window and fetch the firing PromQL from the Prometheus Rules API, then pass the case to an AI agent with read-only access to my MCP tools for [Kubernetes], [Grafana], [DigitalOcean], [GitHub], and a Qdrant store of internal docs. The agent should investigate the alert, gather evidence, and draft a report with a brief summary, an event timeline, and up to two ranked root-cause hypotheses plus troubleshooting steps. Before any message is posted, stop and show me the draft for approval; only after I approve should the workflow reply in the existing [Mattermost thread]. Do not modify the cluster, and limit each failed tool call to one retry.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
2 more reports of this
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Auto-review GitHub pull requests with n8n
They used an n8n workflow to inspect new GitHub pull requests, generate a review with an LLM, and post feedback back to the PR.
Let n8n be the deployment target for your agent
They used Claude to draft, edit, and ship n8n workflows through the API instead of building each node manually.
Let your agent patch its own repo
A developer reported that their custom agent made its first code edit in its own repository.
Use Claude Code to open and prepare an AWS account
A developer used Claude Code to handle AWS sign-up, setup checks, and a small test deployment.
Draft PR reviews, then send them yourself
They used Claude Code to prepare GitHub review drafts for queued pull requests, while keeping final edits and submission under their control.
Use Replit Agent to ship a game helper and browser game
They built a player-help bot and later a PHP browser game with Replit Agent, but had to watch closely because it kept changing more than asked.