Library / Monitoring, Ops & Incidents
Monitoring, Ops & Incidents
Monitor n8n workflow errors and LLM spend with Slack, Gmail, OpenAI and Sheets
Runs hourly to read n8n execution history, calculate error rates and estimated LLM spend, disable runaway workflows, and post incidents with the failing node to Slack.
What it does
## 🩺 n8n Instance Health & Cost Monitor For anyone running a self-hosted or cloud n8n instance with dozens of active workflows, where a broken credential or a looping AI agent can fail hundreds of times or burn through an OpenAI budget overnight before anyone looks. ### How it works Every hour, the workflow reads recent executions for every active workflow through the n8n API, then works out error rates, run volume and estimated LLM spend. Runaway workflows are switched off automatically (tag one no-auto-disable to protect it), and every incident is posted to Slack with the failing node and error message. Repeat warnings are held back by a cooldown. Every Monday it looks at the whole week instead. It compares it with the week before, groups similar errors into clusters, and has GPT-4o-mini write a short health report. That report is emailed with a Slack TL;DR, and the week's numbers are saved so the trend builds up over time. ### Setup steps 1. Create an n8n API key (Settings → n8n API) and add it as Header Auth with the X-N8N-API-KEY header. 2. Create a Google Sheet with Guard_Log and Metrics_History tabs. 3. Connect Google Sheets, Slack, Gmail and OpenAI. 4. In Set Monitor Config, set your instance URL, thresholds, token budget and digest email. 5. Run the hourly guard once manually, then activate.
The steps
- Every Hour (Guard)
- Every Monday 9 AM (Digest)
- Set Guard Mode (1h Window)
- Set Digest Mode (7-Day Window)
- Set Monitor Config
- Fetch Active Workflows
- Build Workflow Index
- Fetch Executions per Workflow
- Compute Health & Cost Metrics
- Route by Mode
- Read Guard Log Sheet
- Read Metrics History Sheet
- Classify & Dedupe Incidents
- Build Failure Sample List
28 steps in total.
Similar automations
Email AutomationTrack LLM spend per workflow and send budget alerts via the n8n API16 stepsCode, Git & Developer ToolsTrack LLM token spend per workflow with n8n API, data tables, and Slack alerts11 stepsMonitoring, Ops & IncidentsDetect ad spend anomalies and pacing issues across Google Ads, Meta and GA423 stepsMonitoring, Ops & IncidentsMonitor n8n workflow errors and OpenAI spend with Slack, Gmail and Sheets51 steps