What This Workflow Does
This workflow finds errors in other n8n workflows automatically and sends you an email explaining them.
It helps catch problems fast without digging through logs.
The email shows what went wrong and suggests how to fix it.
This saves time and helps you fix issues quickly.
The workflow runs when any error happens.
It gets detailed info about the failed run.
Then it uses GPT-4 AI to understand the error better.
Finally, it sends a clear, easy-to-read email to your team.
Who Should Use This Workflow
This is for people who run many workflows in n8n and want quick alerts when something breaks.
If you want less time searching logs and faster fixes, this workflow fits you.
You don’t have to be a coding expert to use it.
Basic n8n knowledge is enough.
Tools & Services Used
- n8n: Manages workflows and triggers errors.
- OpenAI GPT-4: Analyzes error details and writes explanations.
- Gmail: Sends email alerts.
- n8n API: Retrieves full execution details after errors.
Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Download and Import Workflow
- Click the Download button on this page to get the workflow file.
- Open your n8n editor.
- Choose Import from File and select the downloaded workflow JSON file.
Step 2: Add Credentials and Settings
- Fill in your OpenAI API key in the OpenAI GPT-4 node credentials.
- Set up Gmail OAuth2 credentials in the Gmail node.
- In the SET EMAIL node, update TO, CC, and BCC fields with your team’s email addresses.
- Confirm the n8n API credentials are correct in the n8n API node.
Step 3: Check IDs and Links
- Make sure the execution ID expression inside the n8n API node matches the error trigger output:
{{ $('Error Trigger').item.json.execution.id }} - Adjust any workflow or execution link URLs inside the Code nodes if your environment uses custom URLs or ports.
Step 4: Test and Activate
- Trigger a test error in a workflow to see if the alert email arrives.
- If the test works, click Activate in n8n editor to run this workflow for real errors.
The workflow is now ready to automatically catch errors, get AI help analyzing them, and notify your team.
For self-hosting n8n, see self-host n8n for tips on running n8n on your server.
Inputs, Processing Steps, and Outputs
Inputs
- Error notices from any workflow via Error Trigger node.
- Execution ID data from error event JSON.
Processing Steps
- Use n8n API node to fetch full details about the failed execution.
- Filter out manual test errors with If node so only real errors alert.
- Extract error info and relevant node errors with JavaScript in a Code node.
- Send error data to OpenAI GPT-4 via Langchain Chat Model node for analysis.
- Parse AI response for diagnosis, cause, and fix advice.
- Map results into unified objects in a Set node.
- Generate a readable HTML email with error explanations and workflow links using another Code node.
- Send final email alert to recipients with Gmail node.
Outputs
- Clear email reports sent to the team on workflow failures.
- Diagnostic info to help quickly fix problems.
Edge Cases and Failures to Watch For
- Error triggers do not activate if the Error Trigger node is not enabled on the running workflows.
- Execution details won’t fetch if API credentials are missing or invalid.
- Manual workflow runs cause extra emails unless filtered out, which this workflow does.
- OpenAI calls fail with wrong API keys or if the GPT-4 model is unavailable or quota exceeded.
- Emails won’t send if Gmail OAuth2 is expired or lacks permissions.
Always double-check credential setup and test alerts after changes.
Customization Ideas
- Add a Slack node after diagnosis to post errors in a Slack channel for team chat alerts.
- Use extra If nodes to alert only on important workflows by filtering workflow names.
- Save error summaries to Google Sheets for tracking or analytics dashboards.
- Use different AI models depending on error type to manage cost or detail level.
Summary
→ Workflow listens to errors automatically and gets full error info.
→ Uses GPT-4 AI to explain error causes and fixes.
→ Sends detailed emails fast to alert teams.
→ Saves time digging error logs and speeds fixing.
→ Easy to set up with API keys and email addresses.
✓ Cuts troubleshooting time by hours weekly.
✓ Works with multiple workflows and many errors.
✓ Helps teams respond quickly to issues.
