AutomationFlowsAI & RAG › Automatic Issue Routing in Linear with Gpt-4-mini Classification

Automatic Issue Routing in Linear with Gpt-4-mini Classification

ByAvkash Kakdiya @itechnotion on n8n.io

This workflow automatically classifies and routes new or updated Linear issues using AI. When an issue is created or updated, its title and description are analyzed by an OpenAI-powered classifier. The workflow then determines the correct team, routes the issue through the right…

Event trigger★★★★☆ complexityAI-powered17 nodesLinear TriggerAgentLinearOpenAI Chat
AI & RAG Trigger: Event Nodes: 17 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #8845 — we link there as the canonical source.

This workflow follows the Agent → OpenAI Chat recipe pattern — see all workflows that pair these two integrations.

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
{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Linear Bug Auto-Routing",
  "nodes": [
    {
      "id": "8de2b34a-a4ff-4cdb-a028-3a5cf4583e63",
      "name": "\ud83d\udccb Filter New Issues Only",
      "type": "n8n-nodes-base.if",
      "position": [
        -2384,
        736
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-1",
              "operator": {
                "type": "string",
                "operation": "exists"
              },
              "leftValue": "={{ $json.data.title }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ddc917d1-0513-49e0-a522-178210751b71",
      "name": "\ud83d\udd14 Linear Trigger",
      "type": "n8n-nodes-base.linearTrigger",
      "position": [
        -2608,
        736
      ],
      "parameters": {
        "teamId": "YOUR_LINEAR_TEAM_ID",
        "resources": [
          "issue"
        ]
      },
      "credentials": {
        "linearApi": "<your credential>"
      },
      "typeVersion": 1
    },
    {
      "id": "07c6b417-86b4-43a6-b8f5-0db4685b073a",
      "name": "\u2696\ufe0f If (Create or Update)",
      "type": "n8n-nodes-base.if",
      "position": [
        -2160,
        736
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a395310f-475c-4726-b2ef-7db876471a36",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.action }}",
              "rightValue": "create"
            },
            {
              "id": "92ece19c-6765-4ed0-a5dc-4fd1ef190cb6",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.action }}",
              "rightValue": "update"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "aab37c69-54c9-4a53-ae6a-780091c1915f",
      "name": "\ud83e\udd16 AI Agent (Bug Classifier)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1936,
        736
      ],
      "parameters": {
        "text": "=You are a bug classification expert. Based on the bug title and description, classify it into exactly one of these teams: Engineering, Product, Design, QA, DevOps, Support.\n\nRules:\n- If it belongs to Engineering, respond with: ENGINEERING_TEAM_ID\n- If it belongs to Product, respond with: PRODUCT_TEAM_ID\n- If it belongs to Design, respond with: DESIGN_TEAM_ID\n- If it belongs to Nothing(Default), respond with: DEFAULT_TEAM_ID\n\n\nRespond with ONLY the correct team ID as specified above. Do not include explanations, text, or formatting.\n\nTitle: {{ $json.data.title }}\nDescription: {{ $json.data.description }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "af0aef84-bb2a-4a6e-a35a-ce1002fb7907",
      "name": "\ud83d\udd00 Engineering Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1584,
        448
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cedcaf8e-894e-4598-9d82-8e6ad125449c",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output }}",
                    "rightValue": "ENGINEERING_TEAM_ID"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "8fd08de3-dc30-495d-9ac4-1939d60d5bee",
      "name": "\ud83d\udd00 Product Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1584,
        640
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1d753992-3f8f-4899-a6db-1394ad513af8",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output }}",
                    "rightValue": "PRODUCT_TEAM_ID"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "4ebcd42e-7a0b-4a6a-acf0-decf9b60c7ca",
      "name": "\ud83d\udd00 Design Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1584,
        832
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "85fcf1da-00b7-4392-9421-23dd52c18258",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output }}",
                    "rightValue": "DESIGN_TEAM_ID"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "11e315a7-50e2-4789-ad38-4c9a33569ede",
      "name": "\ud83d\udd00 Default Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1584,
        1024
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "85fcf1da-00b7-4392-9421-23dd52c18258",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output }}",
                    "rightValue": "DEFAULT_TEAM_ID"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "37ef1f41-1cb2-40d0-99d2-f10603253e8f",
      "name": "\ud83d\udee0\ufe0f Assign to Engineering",
      "type": "n8n-nodes-base.linear",
      "position": [
        -1360,
        448
      ],
      "parameters": {
        "issueId": "={{ $('\u2696\ufe0f If (Create or Update)').item.json.data.id }}",
        "operation": "update",
        "updateFields": {
          "teamId": "={{ $json.output }}"
        }
      },
      "credentials": {
        "linearApi": "<your credential>"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1ff305f6-6ad4-496e-8380-22e26f637c55",
      "name": "\ud83d\udce6 Assign to Product",
      "type": "n8n-nodes-base.linear",
      "position": [
        -1360,
        640
      ],
      "parameters": {
        "issueId": "={{ $('\u2696\ufe0f If (Create or Update)').item.json.data.id }}",
        "operation": "update",
        "updateFields": {
          "teamId": "={{ $json.output }}"
        }
      },
      "credentials": {
        "linearApi": "<your credential>"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5fb7fd8b-521e-4bf2-8e25-319e4a4bd961",
      "name": "\ud83c\udfa8 Assign to Design",
      "type": "n8n-nodes-base.linear",
      "position": [
        -1360,
        832
      ],
      "parameters": {
        "issueId": "={{ $('\u2696\ufe0f If (Create or Update)').item.json.data.id }}",
        "operation": "update",
        "updateFields": {
          "teamId": "={{ $json.output }}"
        }
      },
      "credentials": {
        "linearApi": "<your credential>"
      },
      "typeVersion": 1.1
    },
    {
      "id": "998b5ad7-72b0-49d0-9e87-57bca44b5976",
      "name": "\ud83d\udcc2 Assign to Default",
      "type": "n8n-nodes-base.linear",
      "position": [
        -1360,
        1024
      ],
      "parameters": {
        "issueId": "={{ $('\u2696\ufe0f If (Create or Update)').item.json.data.id }}",
        "operation": "update",
        "updateFields": {
          "teamId": "={{ $json.output }}"
        }
      },
      "credentials": {
        "linearApi": "<your credential>"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c8beeaf3-ca48-4d22-8889-5b0bac314700",
      "name": "\ud83e\udde0 OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1872,
        960
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": "<your credential>"
      },
      "typeVersion": 1.2
    },
    {
      "id": "e5ea3681-7a84-4582-b473-147ce69fb941",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2656,
        144
      ],
      "parameters": {
        "color": 5,
        "width": 640,
        "height": 1040,
        "content": "## \ud83d\udd14 Trigger & Filtering\n\n*\ud83d\udd14 Linear Trigger \u2014 This node acts as the entry point of the workflow. It continuously monitors Linear for any new activity and immediately triggers the automation whenever an issue is created or updated. By doing so, it ensures that the workflow reacts in real time without requiring any manual intervention.\n\n\ud83d\udccb Filter New Issues Only \u2014 Once triggered, the workflow passes through a validation step. This filter checks whether the issue has a valid title before allowing it to move further down the pipeline. This prevents incomplete or irrelevant records (such as empty or placeholder issues) from being unnecessarily processed, keeping the workflow clean and efficient.\n\n\u2696\ufe0f If (Create or Update) \u2014 After validation, the workflow runs a conditional check to determine the type of action that occurred in Linear. Specifically, it verifies whether the incoming item is the result of a create or an update event. Only if the condition is met does the issue proceed to the next stage, ensuring the workflow remains focused on meaningful changes rather than every possible event.*"
      },
      "typeVersion": 1
    },
    {
      "id": "ad3eda57-3289-46f9-bb1a-7cacb0632206",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        144
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 1040,
        "content": "## \ud83e\udd16 AI Classification\n\n*\ud83e\udde0 OpenAI Chat Model \u2014 This node serves as the backbone of the intelligent classification process. It leverages the power of an advanced large language model (LLM), specifically GPT-4-mini, to analyze text with accuracy and efficiency. By integrating directly into the workflow, it enables natural language understanding, which is essential for interpreting bug reports in a human-like manner. This ensures that every issue is examined contextually rather than just through static keyword checks.\n\n\ud83e\udd16 AI Agent (Bug Classifier) \u2014 Built on top of the OpenAI Chat Model, this specialized agent is designed to automatically interpret the bug title and description provided in Linear. Its role is to classify each issue into exactly one of the predefined categories: Engineering, Product, Design, or Default. By doing so, it removes the need for manual triaging, speeds up the bug management process, and ensures that issues are instantly directed to the right team with minimal human oversight.*"
      },
      "typeVersion": 1
    },
    {
      "id": "45ab34c6-9464-4d11-be27-297efa530029",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        144
      ],
      "parameters": {
        "height": 1040,
        "content": "## \ud83d\uddc2\ufe0f Assignment Actions\n\n*Assign to Engineering, Assign to Product, Assign to Design, and Assign to Default update the Linear issue with the correct team ID.\n\nThese ensure the issue gets routed into the right backlog automatically.*"
      },
      "typeVersion": 1
    },
    {
      "id": "9f3b5383-c215-4e33-ac47-93698cf186a4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        144
      ],
      "parameters": {
        "color": 3,
        "height": 1040,
        "content": "## \ud83d\udd00 Routing Logic\n\n*Engineering Router, Product Router, Design Router, and Default Router each check the classifier's output against the correct team ID.\n\nThis guarantees that only one path is chosen, based on the assigned team.*"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "\ud83d\udd00 Design Router": {
      "main": [
        [
          {
            "node": "\ud83c\udfa8 Assign to Design",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd00 Default Router": {
      "main": [
        [
          {
            "node": "\ud83d\udcc2 Assign to Default",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd00 Product Router": {
      "main": [
        [
          {
            "node": "\ud83d\udce6 Assign to Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd14 Linear Trigger": {
      "main": [
        [
          {
            "node": "\ud83d\udccb Filter New Issues Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\udde0 OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "\ud83e\udd16 AI Agent (Bug Classifier)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd00 Engineering Router": {
      "main": [
        [
          {
            "node": "\ud83d\udee0\ufe0f Assign to Engineering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udccb Filter New Issues Only": {
      "main": [
        [
          {
            "node": "\u2696\ufe0f If (Create or Update)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u2696\ufe0f If (Create or Update)": {
      "main": [
        [
          {
            "node": "\ud83e\udd16 AI Agent (Bug Classifier)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\udd16 AI Agent (Bug Classifier)": {
      "main": [
        [
          {
            "node": "\ud83d\udd00 Engineering Router",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udd00 Product Router",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udd00 Design Router",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udd00 Default Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

This workflow automatically classifies and routes new or updated Linear issues using AI. When an issue is created or updated, its title and description are analyzed by an OpenAI-powered classifier. The workflow then determines the correct team, routes the issue through the right…

Source: https://n8n.io/workflows/8845/ — 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

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with

OpenAI Chat, Gmail Trigger, Agent +5
AI & RAG

This workflow integrates Linear, Scrapeless, and Claude AI to create an AI research assistant that can respond to natural language commands and automatically perform market research, trend analysis, d

Linear Trigger, N8N Nodes Scrapeless, Agent +2
AI & RAG

K&S-Media Downloadliste SQL. Uses httpRequest, agent, googleSheets, lmChatOpenAi. Event-driven trigger; 97 nodes.

HTTP Request, Agent, Google Sheets +3
AI & RAG

🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.

OpenAI, HTTP Request, Form Trigger +7
AI & RAG

BoomerBobBot.TP. Uses agent, telegramTrigger, telegram, memoryBufferWindow. Event-driven trigger; 95 nodes.

Agent, Telegram Trigger, Telegram +10