When any n8n workflow fails, this setup writes a clear incident email and sends it through Gmail. It gives teams fast answers about what broke and how to fix it without digging through long logs.
The flow starts with an Error Trigger that fires on failure. It fetches the full failed execution from the n8n API using the execution id. An If step can ignore manual test runs to cut noise. A Code step extracts the error message, node name, stack, and context. An OpenAI Chat Model reviews these details and returns three fields in a fixed format diagnosis, cause, and resolution. The values are stored, then another Code step builds an easy to read subject and HTML body. The Gmail node sends the email to the addresses you set, with optional CC and BCC. Sticky notes in the canvas point to where to set emails and how to handle manual runs.
You will need OpenAI, Gmail, and n8n credentials. After setup, teams can cut triage time, reduce alert noise, and move faster on fixes. This is useful for IT and ops groups that maintain many automations, agencies that manage client workflows, and solo builders who want helpful alerts at any hour.