DEV Community

fabrizio de luca
fabrizio de luca

Posted on

I Built an n8n Workflow That Auto-Triages Every GitHub Issue with AI

If you run a GitHub repo with more than a handful of contributors, you know the pain: issues pile up, PRs go unreviewed, and critical bugs sit next to typo fixes with no way to tell them apart.

I got tired of spending 30+ minutes every morning just reading notifications, so I built DevOps Inbox Zero — an n8n workflow that does the triage for me.

What It Does

Every time a GitHub issue or PR is created, the workflow:

  1. Catches the event via GitHub webhook
  2. Sends it to GPT-4o-mini with a structured prompt
  3. Gets back a JSON classification: priority (critical/high/medium/low), category (bug/feature/security/docs/infra/test), suggested owner, and recommended action
  4. Routes to the right Slack channel based on priority
  5. Creates a ticket in Linear or Jira (optional) with all the context

The whole thing runs in under 3 seconds per event and costs about $0.001 per classification (GPT-4o-mini is insanely cheap for this).

The Architecture

GitHub Event → Filter → AI Classifier → Parse → Priority Router
                                                      ↓
                                         Critical → #devops-critical + Linear
                                         High → #devops-alerts + Linear
                                         Medium/Low → #devops-inbox
Enter fullscreen mode Exit fullscreen mode

The AI Classifier Prompt

This is the core of the workflow. The prompt is engineered to return consistent JSON:

You are a DevOps triage assistant. Classify this GitHub event
and respond in JSON format ONLY:

{
  "priority": "critical|high|medium|low",
  "category": "bug|feature|security|docs|infra|test",
  "summary": "one line summary",
  "suggested_owner": "team or person based on context",
  "action_needed": "review|merge|fix|discuss|close"
}
Enter fullscreen mode Exit fullscreen mode

I use temperature=0.1 for consistency and maxTokens=200 to keep it fast.

The Priority Router

A simple switch node that splits traffic:

  • Critical + High → Goes to alert channels AND creates a ticket in your project management tool
  • Medium + Low → Goes to a general inbox channel (no ticket noise)

This alone saved us from "ticket fatigue" — only genuinely important stuff creates work items.

Why n8n?

I evaluated several options:

Option Pros Cons
GitHub Actions Native, free Limited routing, no Slack/Linear integration out of the box
Zapier Easy to set up Expensive at scale, limited AI nodes
n8n Self-hosted, unlimited, AI nodes built-in Needs hosting
Custom code Full control Maintenance burden

n8n won because:

  • Self-hosted = no per-execution costs (only the OpenAI API call)
  • Visual workflow makes it easy to modify routing rules
  • Built-in nodes for Slack, Linear, Jira, GitHub — no custom API code
  • Code node for the JSON parsing fallback

Real Numbers

After running this for 2 weeks on a repo with ~50 events/day:

  • Time saved: ~35 minutes/day on manual triage
  • AI cost: $0.04/month (yes, four cents)
  • Accuracy: ~92% correct priority classification
  • False critical rate: ~3% (acceptable — better to over-alert than miss)

The Fallback

What if GPT returns garbage? The Parse node has a try/catch:

try {
  const parsed = JSON.parse(raw);
  return [{ json: parsed }];
} catch(e) {
  return [{ json: {
    priority: 'medium',
    category: 'unknown',
    summary: raw.substring(0, 100),
    action_needed: 'review'
  }}];
}
Enter fullscreen mode Exit fullscreen mode

Worst case, it defaults to medium priority and routes to the general inbox. No event gets lost.

Setup in 5 Minutes

  1. Import the JSON workflow into n8n
  2. Add credentials: GitHub webhook, OpenAI API key, Slack bot token
  3. (Optional) Add Linear or Jira credentials
  4. Set your Slack channel names in the env variables
  5. Activate

That's it. No custom code to maintain, no infrastructure to manage beyond your n8n instance.

Get It

I packaged this as a ready-to-import n8n workflow template: DevOps Inbox Zero on Gumroad

It includes the complete JSON workflow file plus documentation. Import, configure 3 credentials, and you're done.


What's your current GitHub triage process? I'd love to hear how other teams handle this. Drop a comment below.

Top comments (0)