๐ŸŽซ Classify workflow errors with Claude and deduplicate Jira and Slack alerts

โšก 29 views ยท ๐ŸŽซ Ticket Management & Triage

Description

Quick overview

This global error-handling workflow classifies n8n execution failures with Anthropic Claude, deduplicates incidents in Jira using a hash label, and posts a detailed alert to Slack with links to the affected execution and Jira issue.

How it works

  1. Triggers whenever any n8n workflow execution or trigger fails (when set as the instance Error Workflow).
  2. Normalizes the error event into a consistent payload that includes workflow details, error message, truncated stack trace, and an execution log URL.
  3. Sends the normalized payload to Anthropic Claude to return a structured JSON classification (category, severity, root cause, recommended action, and transient flag).
  4. Parses the classification, falls back to an UNKNOWN classification if the LLM response is invalid, and generates a deduplication hash used to group similar errors.
  5. Searches Jira for an open issue in the configured project that already has the matching deduplication label.
  6. If an open issue exists, appends a recurrence comment with the latest execution details; otherwise, creates a new Jira Bug with labels, priority, and a full incident description.
  7. Builds a Slack Block Kit message summarizing the incident and sends it to the configured Slack channel with buttons to the n8n execution log and the Jira ticket.

Setup

  1. In n8n, set this workflow as the global Error Workflow (Settings โ†’ Error workflows) so it receives execution and trigger failures.
  2. Add an Anthropic credential for the Claude chat model used by the workflow.
  3. Add a Jira credential with permission to search issues, create bugs, and add issue comments in your target Jira project.
  4. Add a Slack Bot token credential with the chat:write scope.
  5. Set the environment variables N8N_BASE_URL, JIRA_PROJECT_KEY, JIRA_BASE_URL, and SLACK_CHANNEL_ID to match your instance and destinations.

Requirements

Customization

๐Ÿ”— Nodes Used

Slack, Jira Software, Basic LLM Chain, Anthropic Chat Model

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup