{"product_id":"monitor-n8n-incidents-slack-gmail-alerts-openai-spend-sheets","title":"Monitor n8n Incidents: Slack + Gmail Alerts, OpenAI Spend, Sheets","description":"\u003ch3\u003eMonitor n8n Incidents Automatically—Slack + Gmail Alerts, OpenAI Spend \u0026amp; Health Digest\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow continuously monitors your n8n instance for failing or runaway automations, sends detailed incident alerts to \u003cstrong\u003eSlack\u003c\/strong\u003e and \u003cstrong\u003eGmail\u003c\/strong\u003e, estimates \u003cstrong\u003eOpenAI token spend\u003c\/strong\u003e, and publishes a weekly operational health digest with anomaly detection to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns on a schedule:\u003c\/strong\u003e hourly for an incident “guard” window and every Monday at \u003cstrong\u003e9 AM\u003c\/strong\u003e for a 7-day “digest” window.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eQueries your n8n REST API:\u003c\/strong\u003e lists active workflows (excluding this monitor) and pulls recent execution history for each workflow.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalculates health metrics:\u003c\/strong\u003e per-workflow runs, failures, error rate, and \u003cstrong\u003ep95 duration\u003c\/strong\u003e, plus an \u003cstrong\u003eestimated LLM cost\u003c\/strong\u003e by scanning execution data for token usage.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGuard mode (hourly):\u003c\/strong\u003e checks \u003cstrong\u003eGoogle Sheets (Guard_Log)\u003c\/strong\u003e to suppress repeat warnings using a cooldown. Classifies workflows as \u003cstrong\u003ewarning\u003c\/strong\u003e or \u003cstrong\u003ecritical\u003c\/strong\u003e, retrieves the latest failed execution details from the n8n API, and extracts the failing node and error message.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAuto-mitigates critical workflows:\u003c\/strong\u003e automatically deactivates critical workflows via the n8n API unless they’re tagged as protected (e.g., “no-auto-disable” \/ “critical”). Then logs the incident to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e and posts a detailed alert to \u003cstrong\u003eSlack\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDigest mode (weekly):\u003c\/strong\u003e reads \u003cstrong\u003eGoogle Sheets (Metrics_History)\u003c\/strong\u003e, detects week-over-week anomalies, clusters similar error messages from sampled failures, and uses \u003cstrong\u003eOpenAI (gpt-4o-mini)\u003c\/strong\u003e to generate an ops summary. Emails an HTML weekly digest via \u003cstrong\u003eGmail\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003ePrevent runaway automations by automatically disabling critical n8n workflows after repeated failures.\u003c\/li\u003e\n  \u003cli\u003eGive your ops team instant incident context in Slack (failed node + error message) and a weekly trend report by email.\u003c\/li\u003e\n  \u003cli\u003eTrack OpenAI token spend alongside reliability metrics to spot cost drivers tied to failing workflows.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations \/ nodes:\u003c\/strong\u003e \u003cem\u003eif\u003c\/em\u003e, \u003cem\u003eset\u003c\/em\u003e, \u003cem\u003ecode\u003c\/em\u003e, \u003cem\u003egmail\u003c\/em\u003e, \u003cem\u003eslack\u003c\/em\u003e, \u003cem\u003eswitch\u003c\/em\u003e\n\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAPIs \u0026amp; storage:\u003c\/strong\u003e n8n REST API, \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e (Guard_Log, Metrics_History), \u003cstrong\u003eOpenAI\u003c\/strong\u003e (gpt-4o-mini)\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46206022713523,"sku":"N8N-20790","price":36.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/HiJNihHkFVHRvkZ-eN1vb_J9jEHP06.png?v=1791795906","url":"https:\/\/buyflowscripts.com\/products\/monitor-n8n-incidents-slack-gmail-alerts-openai-spend-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}