{"product_id":"n8n-incident-triage-cost-alerts-with-slack-gmail-openai","title":"n8n Incident Triage \u0026 Cost Alerts with Slack, Gmail \u0026 OpenAI","description":"\u003ch3\u003eDetect n8n incidents fast—triage errors, estimate OpenAI cost, and alert your team via Slack \u0026amp; Gmail\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow monitors your n8n instance hourly and weekly, calculates execution health and estimated OpenAI spend, automatically triages incidents, posts critical alerts to \u003cstrong\u003eSlack\u003c\/strong\u003e, logs history in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, and sends an \u003cstrong\u003eOpenAI-written weekly digest\u003c\/strong\u003e via \u003cstrong\u003eGmail\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHourly “guard” monitoring:\u003c\/strong\u003e Runs every hour for a 1-hour guard window to check execution health.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWeekly “digest” reporting:\u003c\/strong\u003e Runs every Monday at 9 AM for a 7-day digest window.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetches workflow activity via the n8n API:\u003c\/strong\u003e Lists active workflows (excluding this monitor) and retrieves recent executions per workflow.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eComputes health metrics:\u003c\/strong\u003e Calculates per-workflow and instance totals such as run volume, failures, error rate, and p95 duration.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEstimates OpenAI token cost (when available):\u003c\/strong\u003e Uses execution data that includes usage to estimate LLM spend.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGuard-mode incident triage:\u003c\/strong\u003e Reads \u003cem\u003eGuard_Log\u003c\/em\u003e in Google Sheets to suppress repeats during cooldown, classifies incidents as warning\/critical, extracts the failing node and error message from the latest failed execution, and for critical incidents deactivates the workflow via the n8n API unless it’s protected (e.g., tagged with \u003ccode\u003eno-auto-disable\u003c\/code\u003e or \u003ccode\u003ecritical\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDigest-mode trend \u0026amp; clustering:\u003c\/strong\u003e Reads \u003cem\u003eMetrics_History\u003c\/em\u003e, compares recent patterns, samples failed executions to cluster similar error messages, and uses OpenAI to generate a structured weekly health summary.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCommunication:\u003c\/strong\u003e Sends an HTML email digest via Gmail and posts a Slack TL;DR.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003ePrevent runaway costs by detecting error spikes and estimating OpenAI spend per workflow.\u003c\/li\u003e\n  \u003cli\u003eReduce MTTR by auto-deactivating truly critical n8n workflows (with protections for important ones).\u003c\/li\u003e\n  \u003cli\u003eKeep stakeholders updated with weekly, AI-generated n8n health and error trend summaries.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e n8n API, Slack, Gmail, Google Sheets, OpenAI\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used:\u003c\/strong\u003e \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003egmail\u003c\/code\u003e, \u003ccode\u003eslack\u003c\/code\u003e, \u003ccode\u003eswitch\u003c\/code\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46206026678451,"sku":"N8N-20789","price":60.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/C1KvyaZ5Gky9HSmmX0EEj_Ul6kDKT1.png?v=1791795930","url":"https:\/\/buyflowscripts.com\/products\/n8n-incident-triage-cost-alerts-with-slack-gmail-openai","provider":"N8N Commerce","version":"1.0","type":"link"}