# Monitor n8n workflow health and OpenAI cost with Slack, Gmail and Sheets

> Quick overview This workflow monitors an n8n instance hourly and weekly by calling the n8n API to calculate execution health metrics and estimated LLM spend, then posts incident alerts to Slack, logs incidents and history to Google Sheets, and sends an OpenAI-written weekly digest via Gmail. How it works 1. Runs every hour for a 1-hour “guard” window and every Monday at 9 AM for a 7-day “digest” window. 2. Calls the n8n API to list all active workflows (excluding this monitor) and fetches recent executions per workflow. 3. Computes per-workflow and instance totals such as run volume, failures, error rate, p95 duration, and estimated OpenAI token cost (when execution data includes usage). 4. In guard mode, checks Google Sheets (GuardLog) to suppress repeat warnings during the cooldown, classifies incidents as warning/critical, and pulls the latest failed execution to extract the failing node and error message. 5. For critical incidents, deactivates the workflow via the n8n API unless it

- **Domain**: `n8n-workflow-20789.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/20789
- Page (HTML): https://agenstry.com/agents/n8n-workflow-20789.n8n.io
- Documentation: https://n8n.io/workflows/20789
