Automatically debug failed n8n workflows using Gemini 2.5 Pro. This powerful n8n template provides AI-driven root cause analysis, suggested fixes, and immediate email notification.
Download this n8n workflow template and start using it instantly.
n8n instance administrators responsible for monitoring automation reliability.
Developers needing instant, actionable debugging assistance for complex n8n workflow failures.
Users looking for advanced n8n templates for self-healing and proactive error management.
Anyone running critical business automations who needs to minimize downtime when an n8n node fails.
Stop spending time manually digging through logs to understand why your automations break. This advanced n8n workflow sets up a 'debug watchdog' using an AI agent (like Gemini 2.5 Pro) to provide instant, detailed troubleshooting.
When any other n8n workflow fails, this solution automatically triggers. It captures the full context—including the specific error message and the entire JSON structure of the failed n8n workflow—and passes it to the AI. The AI acts as an expert n8n developer, performing a Root Cause Analysis and generating clear, step-by-step fix suggestions, which are then delivered immediately to your inbox. This shifts error management from reactive investigation to proactive resolution, significantly boosting the stability of your n8n environment.
This automation is triggered by the specialized n8n trigger designed for instance-wide error detection, ensuring high availability for your n8n templates.
To deploy and utilize this powerful n8n workflow, follow these setup steps:
Settings > API in your n8n editor and create a new API key.X-N8N-API-KEYN8NEDITORBASE_URL variable to build dynamic links to the failed execution. This must be set in your n8n environment variables (e.g., Docker, Cloud).https://my-n8n.example.comSend To field with your desired recipient email address (EMAIL-GOES-HERE).This n8n workflow relies on a specific sequence of specialized n8n node types:
Error Trigger (n8n trigger):
Function: This is the entry n8n trigger point, activating instantly upon the failure of any other workflow execution in the n8n instance.
Key Configuration: None required; it automatically monitors the environment.
Get Workflow JSON (HTTP Request n8n node):
Function: Fetches the complete structural definition (JSON) of the failed n8n workflow from the n8n API, providing the AI with necessary context.
Key Configuration: Uses an expression to define the URL based on the environment variable and the failed workflow ID: =\{$\{$env.N8NEDITORBASEURL\}/api/v1/workflows/\{$json.workflow.id\}_\}, requiring X-N8N-API-KEY Header Authentication.
Gemini 2.5 Pro (Langchain OpenRouter Chat Model n8n node):
Function: Specifies the powerful AI model used for analysis.
Key Configuration: Model set to google/gemini-2.5-pro using OpenRouter credentials.
Debugger Agent (Langchain Agent n8n node):
Function: The central processing n8n node. It packages the execution context, error details, and the full workflow JSON into a single, detailed prompt for the AI.
Key Configuration: System message forces the AI persona: "You are an expert n8n automation developer and debugger."
Convert Markdown To HTML (Markdown n8n node):
Function: Transforms the AI's Markdown-formatted analysis into clean HTML, ensuring the output is visually appealing within the final email notification.
Key Configuration: Takes the output from the Debugger Agent as input.
Send Debugging Email (Gmail n8n node):
Function: The final action, sending the comprehensive failure report, execution link, and the HTML-rendered AI analysis to the administrator.
Key Configuration: Utilizes expressions to build a dynamic subject line and body containing error variables from the initial Error Trigger n8n node.
Automate documentation and promotion for your n8n workflow JSON files using Gemini AI, Notion, and LinkedIn. Accelerate the release of new n8n templates.

Automate your entire blogging process using this complex n8n workflow. It handles deep research, AI content generation, image creation, and direct WordPress publishing.

Build an advanced AI support bot using this n8n workflow. Integrate WhatsApp, Pinecone for RAG knowledge, and Google Sheets for automated ticket creation and management.

Deploy this n8n workflow to automatically generate structured X (Twitter) content using AI, schedule posts via Blotato, and manage the publishing queue in Google Sheets.

Boost your YouTube SEO instantly using this advanced n8n workflow. It leverages GPT-4o and Google Gemini to automatically generate titles, descriptions, tags, and find related content.









































