FindPrompts
n8nDevOps & InternalIntermediate5 steps

GitHub Issue Triage Bot

When a new GitHub issue is opened, GPT classifies it (bug, feature, question), assigns a priority, applies labels via the GitHub API, and pings the right Slack channel. Keeps your backlog organized automatically.

GitHubOpenAISlack

How it works

  1. 1Trigger: GitHub webhook on new issue opened
  2. 2Classify the issue type and priority with GPT
  3. 3Apply labels to the issue via the GitHub API
  4. 4Route the issue to the relevant Slack channel
  5. 5Respond to the webhook

Setup

  • Set owner/repository and connect a GitHub credential with repo scope.
  • Connect OpenAI and Slack credentials.
  • Make sure the labels returned by GPT exist in the repo.
  • Filter the trigger to action=opened to avoid re-runs.

Workflow JSON

{
  "name": "GitHub Issue Triage Bot",
  "nodes": [
    {
      "id": "gi01aa",
      "name": "Issue Opened",
      "type": "n8n-nodes-base.githubTrigger",
      "typeVersion": 1,
      "position": [
        200,
        300
      ],
      "parameters": {
        "owner": "your-org",
        "repository": "your-repo",
        "events": [
          "issues"
        ]
      }
    },
    {
      "id": "gi02bb",
      "name": "Classify Issue",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.4,
      "position": [
        420,
        300
      ],
      "parameters": {
        "modelId": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Classify a GitHub issue. Return JSON: { type: 'bug'|'feature'|'question', priority: 'low'|'medium'|'high' }."
            },
            {
              "role": "user",
              "content": "Title: {{ $json.body.issue.title }}\nBody: {{ $json.body.issue.body }}"
            }
          ]
        },
        "jsonOutput": true
      }
    },
    {
      "id": "gi03cc",
      "name": "Apply Labels",
      "type": "n8n-nodes-base.github",
      "typeVersion": 1,
      "position": [
        640,
        300
      ],
      "parameters": {
        "resource": "issue",
        "operation": "edit",
        "owner": "your-org",
        "repository": "your-repo",
        "issueNumber": "={{ $('Issue Opened').item.json.body.issue.number }}",
        "editFields": {
          "labels": "={{ [$json.message.content.type, $json.message.content.priority] }}"
        }
      }
    },
    {
      "id": "gi04dd",
      "name": "Notify Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        860,
        300
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channelId": "#dev-triage",
        "text": "New {{ $json.message.content.priority }} {{ $json.message.content.type }}: {{ $('Issue Opened').item.json.body.issue.title }}"
      }
    },
    {
      "id": "gi05ee",
      "name": "Done",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1080,
        300
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "Issue Opened": {
      "main": [
        [
          {
            "node": "Classify Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Issue": {
      "main": [
        [
          {
            "node": "Apply Labels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Labels": {
      "main": [
        [
          {
            "node": "Notify Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Slack": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "meta": {}
}

Command Palette

Search for a command to run...