Skip to main content

Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts

Workflow preview

Workflow preview
100%
Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts preview
Open on n8n.io

1. Workflow Overview

Who is this for This workflow is designed for n8n users who manage multiple production workflows and want to: Receive intelligent, actionable error alerts instead of raw stack traces Understand roo...

Best for

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

Tools used

n8n-nodes-base.errortrigger, n8n-nodes-base.code, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.googlesheets, n8n-nodes-base.slack

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts
Workflow name
Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts

Who is this for

This workflow is designed for n8n users who manage multiple production workflows and want to:

  • Receive intelligent, actionable error alerts instead of raw stack traces
  • Understand root causes without manually debugging every failure
  • Prevent alert fatigue from repeated similar errors
  • Maintain a searchable log of all workflow errors

It's ideal for animal advocacy organizations, campaign coordinators, and activists running mission-critical automation workflows for outreach, volunteer coordination, or campaign monitoring.

What it does

When any workflow in your n8n instance fails, this agent automatically:

  1. Captures the error details including workflow name, failed node, error message, and stack trace
  2. Uses AI (via OpenRouter/Claude) to analyze the error and suggest root causes and fixes
  3. Generates a unique error signature for deduplication
  4. Logs the error with AI analysis to Google Sheets for historical tracking
  5. Checks for recent duplicate errors to prevent alert fatigue
  6. Sends enriched notifications through your choice of Slack, Discord, Email, or Webhook

The AI analysis includes root cause identification, error chain tracing, specific fix recommendations, and a confidence score indicating how certain the analysis is.

How to set up

  1. Import the workflow into your n8n instance
  2. Configure credentials for:
  • OpenRouter API for AI analysis
  • Google Sheets for error logging
  • Notification channels you want to use (Slack, Discord, Gmail, or Webhook URL)
  1. Create a Google Sheet with columns matching the log fields
  2. Update the receiver email addresses in the "Normalize Error Payload" node
  3. Enable the workflow
  4. Set this workflow as the error handler for other workflows you want to monitor

Requirements

  • OpenRouter API key (for AI-powered error analysis)
  • Google Sheets OAuth2 credentials
  • At least one notification channel configured (Slack, Discord, Gmail, or custom webhook)
  • n8n instance with Error Trigger capability

How to customize

  • Change the AI model: Edit the OpenRouter Chat Model node to use a different LLM
  • Adjust alert fatigue settings: Modify the lookback count and time window in the "Check Alert Fatigue" code node
  • Switch logging backend: Replace the Google Sheets node with PostgreSQL, Notion, or any other storage
  • Add notification channels: The workflow sends to multiple channels in parallel - add or remove as needed
  • Customize email recipients: Update the receiver emails array in the normalize payload node

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 - Generate Error Signature

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Check Alert Fatigue

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Prepare Log Record

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

Block 5 - Extract AI Confidence

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Normalize Error Payload1

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

Block 7 - AI Error Analysis1

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.8

Block 8 - Send Email1

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

Block 9 - OpenRouter Chat Model1

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

Block 10 - Log to Google Sheets1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Send Slack Message1

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 12 - Send Discord Message1

Type / Role
n8n-nodes-base.discord - discord
Config choices
Version 2

Block 13 - Webhook Notification1

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

Block 14 - Prepare AI Context1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Sticky Note

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

Block 16 - Sticky Note5

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

3. Summary Table

Workflow Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts
Complexity advanced
Nodes 16
Categories DevOps, AI Summarization
Author Open Paws
Published 05 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12502/12502.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 Analyze failed workflows with Claude via OpenRouter and log to Sheets with Slack, Email, Discord alerts do?

Who is this for This workflow is designed for n8n users who manage multiple production workflows and want to: Receive intelligent, actionable error alerts instead of raw stack traces Understand roo...

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.