Skip to main content

AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro

Workflow preview

Workflow preview
100%
AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Stop digging through execution logs to find out why a workflow failed. This template provides a "set it and forget it" monitoring system that uses AI to automatically debug your n8n workflows. Inst...

Best for

  • DevOps automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.errortrigger, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.markdown, n8n-nodes-base.gmail, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.lmchatopenrouter

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ramsey Njire.

Original n8n.io source

1.1 Workflow description

Title
AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro
Workflow name
AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro

Overview

Stop digging through execution logs to find out why a workflow failed. This template provides a "set-it-and-forget-it" monitoring system that uses AI to automatically debug your n8n workflows.

Instead of just getting a simple error message, you'll receive a detailed email notification with a root cause analysis and a step-by-step suggested fix from a Gemini-powered AI agent. This saves you valuable time, helps you resolve issues faster, and ensures your critical automations are always running smoothly.


Prerequisites

Before you begin the setup, please make sure you have the following accounts and information ready:

  • An n8n Instance: This workflow must be hosted on an active n8n instance.
  • n8n API Key: You'll need to generate an API key from your n8n instance (Settings > API).
  • OpenRouter Account: An account with OpenRouter.ai to access various AI models like Gemini.
  • Google (Gmail) Account: To send and receive the email notifications.
  • n8n Environment Variable: Your n8n instance must have the N8N_EDITOR_BASE_URL environment variable configured. This is essential for generating correct links to your workflow executions.

Use Cases

This template is perfect for anyone who wants to proactively monitor their automations. Here are a few examples:

  • Monitoring Critical Webhooks: Get instant, intelligent alerts if a workflow handling data from a payment gateway (like Stripe) or a form submission fails due to unexpected data, minimizing service disruption.
  • Managing Complex Automations: For long, multi-step workflows, the AI can immediately pinpoint the exact failing node and suggest fixes for complex data mapping errors or API issues that are otherwise difficult to trace.
  • Developers & Agencies: If you manage multiple n8n workflows for clients or different projects, this provides a centralized monitoring system that helps you stay on top of all automation issues without having to manually check each one.

How it works

This workflow acts as an automated debugging assistant for your n8n instance 🤖. When any of your other workflows fail during an automatic (production) execution, this template will:

  1. Capture the error and use the n8n API to fetch the complete structure of the failed workflow for full context.
  2. Send the error details and workflow structure to a powerful AI agent (via OpenRouter) for a detailed root cause analysis.
  3. Format the AI's diagnosis and suggested fix into a clean HTML email and send it to you via Gmail, including a direct link to the failed execution.

Important Note: As per the n8n documentation, the Error Trigger node only runs for errors that happen in production executions (e.g., from a webhook call or a schedule). It will not run when you test a workflow by clicking "Execute workflow" manually.

Set up steps

(Estimated setup time: 10 minutes)

There are two main parts to the setup: configuring this workflow, and then connecting it to the workflows you want to monitor.

Part A: Configure the AI Debugger Workflow

  1. n8n API Credentials: Create an API key in your n8n instance under Settings > API and add it as a "Header Auth" credential for the Get Workflow JSON node.
  2. OpenRouter Credentials: Add your OpenRouter API key to the OpenRouter Chat Model node.
  3. Gmail Credentials: Authenticate your Gmail account in the Send Debugging Email node.
  4. Recipient Email: Update the "To" field in the final Send Debugging Email node with your own email address.
  5. Environment Variable: Ensure your N8N_EDITOR_BASE_URL environment variable is correctly set for your n8n instance. This is required for building the API and execution links.

Part B: Connect to Your Other Workflows

For every workflow you want this debugger to monitor, you must link it in that workflow's settings.

  1. Go to the workflow you want to monitor (your "target" workflow).
  2. Click the three dots (...) in the top right corner and select Settings. 3. In the Error Workflow dropdown, select this "AI-Powered Workflow Debugger & Notifier" workflow.
  3. Click Save. Now, whenever that target workflow fails during a production run, this debugger workflow will automatically be triggered to analyze the error and notify you.
  4. Note that the error workflow only gets triggered on automatic runs, not manual ones: This is a feature of how the error trigger works in n8n. To ensure this, make sure the target workflow is active. It won't trigger the error workflow if it's turned off.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Error Trigger

Type / Role
n8n-nodes-base.errorTrigger - errorTrigger
Config choices
Version 1

Block 2 - Get Workflow JSON

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Debugger Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - Convert Markdown To HTML

Type / Role
n8n-nodes-base.markdown - markdown
Config choices
Version 1

Block 5 - Send Debugging Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Gemini 2.5 Pro

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 11 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro
Complexity intermediate
Nodes 12
Categories DevOps, AI Chatbot
Author Ramsey Njire
Published 08 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9375/9375.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-powered workflow error analysis & fix suggestions with Gemini 2.5 Pro do?

Stop digging through execution logs to find out why a workflow failed. This template provides a "set it and forget it" monitoring system that uses AI to automatically debug your n8n workflows. Inst...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, AI Chatbot use case.