AI-Powered API Error Classification and Team Routing - n8n Workflow

Use this robust n8n workflow to automatically classify GitHub API errors using GPT-4o, determining root cause, severity, and assigned team, then logging results in Airtable, Notion, and Slack. Accelerate DevOps response times with this advanced n8n automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

DevOps and Engineering Teams: Who need immediate, pre-analyzed alerts for critical API errors. SaaS Product Managers: Looking to build a structured, AI-populated error knowledge base in Notion or Airtable. Automation Specialists: Seeking advanced examples of LangChain agent integration within an n8n node for structured data extraction. Users of n8n templates: Who require reliable, scalable automation for incident response and documentation.

Overview

Managing a high volume of API errors reported via GitHub issues can quickly overwhelm engineering and support teams. This powerful n8n workflow solves this by injecting advanced AI analysis into your incident response pipeline. The solution leverages the capabilities of an n8n node connected to GPT-4o to analyze the raw issue data (title, body, context), classify the error by category (Authentication, Rate Limit, Server Error), assess severity, identify the root cause, and assign the appropriate internal team (Backend, DevOps, API, Support).

This end-to-end n8n automation ensures that every new API error is instantly documented in Airtable and Notion, and simultaneously alerts the correct team via Slack, drastically reducing triage time and fostering a proactive DevOps environment. This specific n8n workflow stands out as a critical tool for maintaining API stability and improving internal documentation efficiency.

How it Works

The entire process is initiated by a specific n8n trigger, setting the stage for classification and distribution:


  1. GitHub n8n Trigger: The workflow starts with the GitHub Issue Created/Updated n8n trigger node. This n8n trigger is configured to listen for new or updated issues in a specified repository, typically filtered for issues tagged as 'bug' or 'error'.

  2. Data Preparation: The Prepare GitHub Issue Data set node standardizes and extracts key information from the GitHub payload, such as the issue title, body, URL, and repository name, preparing a clean object for the AI.

  3. AI Classification: The core logic resides in the AI: Classify API Error (GPT-4o) n8n node (a Langchain agent). It sends the prepared issue text to GPT-4o. Crucially, the n8n node utilizes the Structured JSON Schema output parser, ensuring the AI returns a predictable object containing fields like errorCode, severity, and assignedTeam.

  4. Parsing Results: The Parse AI Classification Output code node integrates the original GitHub data with the structured AI output. It formats team-specific Slack messages and prepares the data payload for ingestion into Airtable and Notion databases, ensuring data consistency across all platforms.

  5. Validation Check: The Check: Valid AI Response or Data Missing if node ensures the AI classification was successful and the necessary fields are present before proceeding.

  6. Intelligent Routing: The Route by Assigned Team switch n8n node directs the data down one of four branches (DevOps, Backend, Support, API Team) based on the AI-determined assignment, ensuring the right team sees the issue immediately.

  7. Documentation & Alerting: Each routed branch executes a parallel set of actions: logging the structured error data into Airtable and Notion for permanent cataloging, followed by sending a team-specific summary alert via a dedicated Slack n8n node.

  8. Error Handling: A separate Error Handler Trigger n8n workflow captures any execution failures and posts an alert to a dedicated Slack channel, maintaining the reliability of the main n8n workflow.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' section by clicking 'New' > 'Import from JSON'.

  2. GitHub Credentials: Configure the GitHub Issue Created/Updated n8n trigger node. You will need OAuth2 credentials connected to your GitHub account and specify the repository and events to watch.

  3. OpenAI Setup: Set up your OpenAI credentials for the LLM Model: GPT-4o n8n node. Ensure you have access to the GPT-4o model, as the classification task requires high accuracy.

  4. Airtable and Notion: Configure credentials for Airtable and Notion. For Airtable, you must specify the Base ID and Table ID, ensuring the fields in the n8n node configuration match your table schema (e.g., 'Error Code', 'Severity', 'Assigned Team'). Similarly, link the appropriate Notion Database ID in the Notion n8n nodes.

  5. Slack Integration: Connect your Slack credentials. For each of the four Slack Notify n8n nodes, replace the placeholder channel IDs with the actual channels for the DevOps, Backend, Support, and API teams.

  6. Final Activation: Once all credentials and configurations are set across every n8n node, activate the n8n workflow to start monitoring GitHub issues automatically.

Node Details

This n8n workflow utilizes several key nodes for its complex operations:

GitHub Trigger n8n Trigger:
Function: Starts the automation whenever a GitHub issue is created or updated in the specified repository.
Key Configuration: Listens specifically for the issues event type and requires OAuth2 authentication.
AI: Classify API Error (GPT-4o) n8n Node (Langchain Agent):
Function: Sends the GitHub issue text to GPT-4o for deep analysis based on an extensive system prompt (which mandates structured JSON output).
Key Configuration: Uses the LLM Model: GPT-4o and the Output Parser: Structured JSON Schema to guarantee a clean output with fields like assignedTeam and rootCause.
Parse AI Classification Output (Code n8n Node):
Function: Transforms the AI's structured JSON output into specific payloads required by the downstream services (Airtable fields, Notion properties, and Slack markdown messages).
Key Configuration: Retrieves data from both the trigger (Prepare GitHub Issue Data) and the AI output node.
Route by Assigned Team (Switch n8n Node):
Function: Dynamically routes the classified error data to the correct team-specific branches for logging and notification.
Key Configuration: Routes based on the $json.assignedTeam value (DevOps Team, Backend Team, Support Team, API Team).
Airtable: Create Record n8n Node:
Function: Logs the analyzed error, its severity, and root cause into the centralized error catalog in Airtable.
Key Configuration: Maps numerous AI-derived fields, including 'Error Category' and 'Suggested Action'.
Slack Notify n8n Node (Multiple Instances):
Function: Sends immediate, tailored alerts to the relevant team's Slack channel.
Key Configuration: Uses data from the Airtable node to construct a rich message detailing the error, category, and suggested fix.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

Featured*