Skip to main content

Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts

Workflow preview

Workflow preview
100%
Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts preview
Open on n8n.io

1. Workflow Overview

Monitor n8n Workflow Errors with AI Diagnosis & Instant Telegram Alerts This n8n template automatically catches errors from any workflow on your instance...

Best for

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

Tools used

n8n-nodes-base.errortrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.telegram, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Nguyễn Thiệu Toàn (Jay Nguyen).

Original n8n.io source

1.1 Workflow description

Title
Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts
Workflow name
Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts

Monitor n8n Workflow Errors with AI Diagnosis & Instant Telegram Alerts

This n8n template automatically catches errors from any workflow on your instance, analyzes them with Google Gemini AI, and delivers a structured diagnostic report directly to your Telegram — including error classification, root cause analysis, and specific fix steps.

If you manage multiple n8n workflows in production and want to stop manually debugging failures, this workflow is your always-on error watch.

How it works

  • Error Trigger: Fires automatically whenever any workflow on the instance encounters a failure, capturing the full error context including the failed node name, error message, and stack trace.
  • Set Context: Extracts all error data and holds your 3 configuration values. This is the only node you ever need to edit — making the workflow easy to adapt and redeploy.
  • Get Workflow Content: Fetches the full workflow JSON definition via the n8n REST API, giving the AI meaningful context about what the failed workflow was actually trying to do.
  • AI Agent (Gemini): Classifies the error type (Authentication, Rate Limit, Credential, Connection, etc.), identifies the root cause, and generates a Telegram HTML-formatted report with 2–3 actionable fix steps.
  • Send Telegram Notification: Delivers the formatted report to your configured chat with proper HTML rendering — bold labels, code blocks for error messages, and a direct link to the failed execution.

How to use

  1. Connect credentials: Add your Google Gemini (googlePalmApi) credential to the Google Gemini Chat Model node, and your Telegram Bot credential to the Send Telegram Notification node.
  2. Configure Set Context: Open the Set Context node and update n8n_instance_url (your public n8n URL), n8n_api_key (from n8n → Settings → API), and telegram_chat_id.
  3. Activate this workflow.
  4. Link to other workflows: In each workflow you want to monitor, go to Settings → Error Workflow and select this workflow.

Requirements

  • n8n Version: Built and tested on n8n 2.9.4+. (It is highly recommended to update to the latest n8n version.)
  • Google Gemini API key (googlePalmApi credential type).
  • Telegram Bot token and a chat ID to receive notifications.
  • n8n API key with read access to workflows (Settings → API → Create API Key).
  • Your n8n instance must be accessible via a public URL for the API call.

Customizing this workflow

  • Different AI model: Swap the Google Gemini Chat Model sub-node for OpenAI, Anthropic, or any other LLM — no other changes needed.
  • Different notification channel: Replace the Telegram node with Slack, Discord, or Zoho Mail to fit your team's tooling.
  • Report language: Change the language instruction at the end of the AI Agent's system prompt from Vietnamese to English or any other language.
  • Filter specific workflows: Add an If node after Error Trigger to only process errors from high-priority workflows based on workflow.name.

About the Author

Created by: Nguyễn Thiệu Toàn (Jay Nguyen) Email: [email protected] Website: nguyenthieutoan.com Company: GenStaff (genstaff.net) Socials (Facebook / X / LinkedIn): @nguyenthieutoan More templates: n8n.io/creators/nguyenthieutoan

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 - Set Context

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Get Workflow Content

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

Block 4 - AI Agent

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

Block 5 - Google Gemini Chat Model

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

Block 6 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 7 - Send Telegram Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 8 - Main Overview

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

Block 9 - Warning Set Context

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

Block 10 - Author Message

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

3. Summary Table

Workflow Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts
Complexity intermediate
Nodes 10
Categories DevOps, AI Summarization
Author Nguyễn Thiệu Toàn (Jay Nguyen)
Published 03 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13846/13846.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 Monitor workflow errors via n8n API with Gemini analysis and Telegram alerts do?

Monitor n8n Workflow Errors with AI Diagnosis & Instant Telegram Alerts This n8n template automatically catches errors from any workflow on your instance...

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 Summarization use case.