Diagnose failed n8n workflows with Claude and Gmail alerts
Ready for 3.0What this workflow does
This workflow has 9 nodes and runs when another workflow fails (error workflow). Along the way it connects Gmail and Slack. It also calls api.anthropic.com over HTTP.
How it runs
Trigger: When another workflow fails (error workflow).
- Set config: who to alert and how often (Edit Fields (Set)): sets 4 fields: notifyTo, cooldownMinutes, maxStackLines…
- Read the failure and check for repeats (Code): runs custom JavaScript code
- Skip if you were already told (If): checks a condition and branches into true / false
- Build the diagnosis request (Code): runs custom JavaScript code
- Diagnose the failure with Claude (HTTP Request): calls api.anthropic.com (POST)
- Write the alert (Code): runs custom JavaScript code
- Email you the diagnosis (Gmail): uses Gmail
- Optional: post critical failures to Slack (Slack): uses Slack
Services it uses
HTTP calls to: api.anthropic.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.
Nodes used (7)
- Error Trigger
n8n-nodes-base.errorTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail - Slack
n8n-nodes-base.slack
From the author
Quick overview This workflow acts as a global n8n error handler: when any other workflow fails, it suppresses repeat alerts, sends the failure details to Anthropic Claude for a plain-English diagnosis and fix steps, and emails the formatted result via Gmail…