Send real-time Kubernetes(EKS/GKE/AKS) CPU spike alerts from Prometheus to Slack
Ready for 3.0What this workflow does
This workflow has 7 nodes and runs on a schedule (every minute). It uses only n8n's built-in nodes. It also calls prometheus-kube-prometheus-prometheus.monitoring:9090 and slack.com over HTTP.
How it runs
Trigger: On a schedule (every minute).
- Query Prometheus for CPU Spikes (HTTP Request): calls prometheus-kube-prometheus-prometheus.monitoring:9090
- Format Prometheus JSON (Code): runs custom JavaScript code
- Check Number of Pods in Group (If): checks a condition and branches into true / false
- Format Batched Slack Message (Code): runs custom JavaScript code
- Format Single Pod Slack Message (Code): runs custom JavaScript code
- 📤 Send Alerts to Slack (HTTP Request): calls slack.com (POST)
HTTP calls to: prometheus-kube-prometheus-prometheus.monitoring:9090, slack.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Always Output Data on multi-output nodes (If/Switch) now adds an empty item only when every output is empty (Check Number of Pods in Group).
Nodes used (4)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - If
n8n-nodes-base.if
From the author
🧾 Summary This workflow monitors Kubernetes pod CPU usage using Prometheus, and sends real-time Slack alerts when CPU consumption crosses a threshold (e.g., 0.8 cores). It groups pods by application name to reduce noise and improve clarity, making it ideal…