AutomationFlowsAI & RAG › Automate GitHub Issue Creation from Webhooks

Automate GitHub Issue Creation from Webhooks

Original n8n title: Task Router - Tiered Agent System

Task Router - Tiered Agent System. Uses github. Webhook trigger; 4 nodes.

Webhook trigger★★★★☆ complexity4 nodesGitHub
AI & RAG Trigger: Webhook Nodes: 4 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #task-router-tiered-agents — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Task Router - Tiered Agent System",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "task-router",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Task Router Classification Logic\n// Classifies incoming tasks into T1/T2/T3 tiers\n\nconst task = $input.first().json;\n\n// Initialize complexity score\nlet score = 0;\n\n// Signal 1: File count\nconst fileCount = task.files?.length || 1;\nif (fileCount <= 2) {\n  score += 1;\n} else if (fileCount <= 5) {\n  score += 2;\n} else {\n  score += 3;\n}\n\n// Signal 2: Risk indicators in description\nconst description = (task.description || '').toLowerCase();\nif (description.includes('security')) score += 1;\nif (description.includes('architecture')) score += 1;\nif (description.includes('refactor')) score += 1;\nif (description.includes('migration')) score += 2;\nif (description.includes('database')) score += 1;\nif (description.includes('api')) score += 1;\n\n// Signal 3: Test coverage status\nif (task.has_tests === false) score += 1;\n\n// Signal 4: Priority indicator\nif (task.priority === 'critical') score += 1;\nif (task.priority === 'high') score += 1;\n\n// Determine tier based on score\nlet tier, label, tool, color;\nif (score <= 2) {\n  tier = 'T1';\n  label = 'routine';\n  tool = 'Copilot';\n  color = 'green';\n} else if (score <= 4) {\n  tier = 'T2';\n  label = 'analytical';\n  tool = 'Cursor/ChatGPT';\n  color = 'yellow';\n} else {\n  tier = 'T3';\n  label = 'complex';\n  tool = 'Claude Code';\n  color = 'red';\n}\n\nreturn {\n  json: {\n    ...task,\n    classification: {\n      tier,\n      label,\n      tool,\n      score,\n      color\n    },\n    github_label: tier.toLowerCase(),\n    classified_at: new Date().toISOString()\n  }\n};"
      },
      "id": "classify-task",
      "name": "Classify Task",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        470,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "issue",
        "operation": "create",
        "owner": "={{ $json.repository?.owner || 'YOUR_USERNAME' }}",
        "repository": "={{ $json.repository?.name || 'YOUR_REPO' }}",
        "title": "=[{{ $json.classification.tier }}] {{ $json.title }}",
        "body": "## Task\n\n{{ $json.description }}\n\n## Classification\n\n- **Tier**: {{ $json.classification.tier }} ({{ $json.classification.label }})\n- **Recommended Tool**: {{ $json.classification.tool }}\n- **Complexity Score**: {{ $json.classification.score }}\n\n## Files\n\n{{ $json.files ? $json.files.map(f => '- ' + f).join('\\n') : 'Not specified' }}\n\n---\n*Classified by n8n task router at {{ $json.classified_at }}*",
        "labels": [
          "={{ $json.github_label }}"
        ]
      },
      "id": "create-github-issue",
      "name": "Create GitHub Issue",
      "type": "n8n-nodes-base.github",
      "typeVersion": 1,
      "position": [
        690,
        300
      ],
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ success: true, tier: $json.classification.tier, tool: $json.classification.tool, issue_number: $json.number, issue_url: $json.html_url }) }}"
      },
      "id": "respond-webhook",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        910,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Classify Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Task": {
      "main": [
        [
          {
            "node": "Create GitHub Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create GitHub Issue": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateId": "task-router-tiered-agents"
  },
  "tags": [
    {
      "name": "tiered-agents"
    },
    {
      "name": "automation"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Task Router - Tiered Agent System. Uses github. Webhook trigger; 4 nodes.

Source: https://github.com/courtneyr-dev/wp-dev-prompts/blob/3513351d4837bca7008f7a37d2a2a5c0f3c18401/templates/n8n/task-router.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

SEO Articles to Github Publish Workflow. Uses outputParserAutofixing, outputParserStructured, github, lmChatGoogleGemini. Webhook trigger; 44 nodes.

Output Parser Autofixing, Output Parser Structured, GitHub +3
AI & RAG

AI-Driven Handbook Generator with Multi-Agent Orchestration (Pyragogy AI Village). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +3
AI & RAG

AI-Driven Handbook Generator with Multi-Agent Orchestration (Pyragogy AI Village). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +3
AI & RAG

AI-Driven Handbook Generator with Multi-Agent Orchestration (Pyragogy AI Village). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +3
AI & RAG

Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +4