Auto-classify GitHub issues and create Linear tasks
Listen for new GitHub issues → AI classification (type/priority/labels) → Create Linear task and post GitHub comment
- Who
- Teams using n8n that need automated GitHub issue triage synced to Linear
- You get
- New issues trigger automatic AI classification, Linear task creation, and GitHub comment feedback
Constraints
Requires an n8n instance; configure GitHub credentials (webhook trigger and comment permissions), OpenAI credentials (gpt-4.1-mini, etc.), and Linear credentials (replace teamId with actual value). GitHub owner/repository fields are empty in the template and must be filled with the target repository.
What they did
Template author itechnotion built an n8n workflow that listens for new GitHub issues via webhook, uses an OpenAI model to auto-classify them (Bug/Feature/Question, priority 1-4, generate labels), formats the output with JavaScript, creates a corresponding task in Linear, and posts a comment back to the GitHub issue with classification results.
How it went
The author reports this workflow eliminates manual triage, ensures consistent classification, speeds up response times, automatically syncs GitHub with Linear, and improves team visibility. (Source: template description; unverified)
Worth knowing
GitHub owner/repository and Linear teamId are placeholders in the template and must be replaced with actual values. AI output goes through JSON parsing and fallback handling, defaulting to Medium priority if invalid. This site has not tested the workflow; actual operation requires verifying node credentials, permissions, and webhook reachability.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- After import, connect your own credentials on auth-required nodes; author secrets are not included.
Configuration to replace
- Source template is n8n public workflow #14357 (~13 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Configure trigger and filter
In n8n, set up the Github Trigger node: select the repository and subscribe to issues and issue_comment events. Add an If node with the condition $json.body.action equals 'opened' to process only newly opened issues. Add an Edit Fields (Set) node to extract and map fields: title = $json.body.issue.title, description = $json.body.issue.body, issue_url = $json.body.issue.url, author = $json.body.issue.user.login.
AI classification and formatting
Add an Information Extractor node, connected to an OpenAI Chat Model sub-node (model options: gpt-4.1-mini / gpt-4.1 / gpt-4). Paste the classification prompt into the Information Extractor's text field. Add a Code in JavaScript node to parse and normalize the AI's JSON output, generating priorityLabel, typeLabel, and labels. Add a Merge node (mode: combineByPosition) to combine original issue data with the formatted AI output.
Execution prompt · Source text。Information Extractor node text parameter field
=You are an AI issue triage assistant. STRICT RULES: - Output ONLY valid JSON - No explanation - No markdown - No extra text Classify the issue: type must be one of: Bug | Feature | Question priority must be a NUMBER: 1 = Urgent 2 = High 3 = Medium 4 = Low Also generate 2–4 short labels. Return format: { "type": "Bug", "priority": 1, "labels": ["crash", "login"] } Issue Title: {{ $json.title }} Issue Description: {{ $json.description }}Execution prompt · Source text。Code in JavaScript node jsCode field
let output = $json.output; // 1. Parse if AI returned string if (typeof output === "string") { try { output = JSON.parse(output); } catch (e) { throw new Error("Invalid JSON from AI"); } } // 2. Normalize values const priorityNum = Number(output.priority); // 3. Fallback safety const safePriority = [1,2,3,4].includes(priorityNum) ? priorityNum : 3; // 4. Priority label mapping const priorityMap = { 1: "Urgent", 2: "High", 3: "Medium", 4: "Low" }; return [{ ...$json, // Clean structured output output, // For Linear (number) priority: safePriority, // For UI / GitHub priorityLabel: priorityMap[safePriority], type: output.type, typeLabel: output.type, // Labels safe fallback labels: Array.isArray(output.labels) ? output.labels : [] }];Create task and post feedback
Add a Linear Create an issue node: title uses the original issue title, teamId must be replaced with your actual Linear team ID, priorityId uses the formatted priority number, description uses the Merge node's description. Add a GitHub Create a comment on an issue node: operation set to createComment, issueNumber references the Github Trigger issue number, body uses a template to post classification results.
Execution prompt · Source text。GitHub Create a comment on an issue node body field
=Thanks for opening this issue! Our AI triage system classified this as: Type: {{ $('Code in JavaScript').item.json.typeLabel }} Priority: {{ $('Code in JavaScript').item.json.priorityLabel }} A Linear task has been created for the team.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are setting up an n8n workflow to automatically process GitHub issues: trigger on new issue → AI classification → Linear task → GitHub comment. Please confirm you have configured credentials for GitHub, OpenAI, and Linear, and know the target repository and Linear teamId.
Before building, prepare: GitHub repo access, OpenAI API Key, Linear teamId.
Source
Classify GitHub issues and create Linear tasks using OpenAI · itechnotion · n8n.io · 2026-03-26
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.