Automate Bug Classification in Linear with n8n and OpenAI

Struggling with triaging bug tickets efficiently in Linear? This n8n workflow uses OpenAI to automatically classify bugs to the right team, saving hours and reducing errors.
linearTrigger
linear
openAi
+6
Workflow Identifier: 1708
NODES in Use: Linear Trigger, Filter, Sticky Note, Linear, HTTP Request, Set, If, Slack, OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow watches new or changed bug tickets in Linear.
It checks if tickets have enough info, tags, and are in triage state.
Then, it asks OpenAI GPT-4 to pick the right team for the bug.
It finds the team ID in Linear by asking Linear’s API.
Finally, it updates the ticket in Linear with the chosen team.
If OpenAI cannot decide, it sends a Slack alert for manual check.
This saves time on sorting bugs and makes fixes faster.


Who Should Use This Workflow

If managing many bug tickets is hard and slow, this helps.
It is great for teams using Linear who want to save bug triage time.

People new to automation can start here, and those with big ticket volume benefit most.


Tools and Services Used

  • Linear API: Tracks bug tickets and their teams.
  • OpenAI GPT-4 (32K): Classifies tickets by team based on descriptions.
  • n8n Workflow Automation: Connects nodes to run the process.
  • Slack API: Sends alerts if classification fails.

Beginner step-by-step: How to Use This Workflow in n8n

Import the Workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. Open your n8n editor.
  3. Click Import from File and select the downloaded file.

Configure Credentials and IDs

  1. Add your Linear OAuth2 credentials in n8n.
  2. Add your OpenAI API Key for GPT-4 in the OpenAI node.
  3. Add your Slack bot token if you want Slack alerts enabled.
  4. Update the Linear Team ID in the Linear Trigger node.
  5. Update the Triage State ID and Bug Label ID in the Filter node conditions.
  6. Update the Slack channel name in the Set me up node if needed.

Test and Activate

  1. Test the workflow by updating or creating a bug ticket that matches the filter criteria in Linear.
  2. Check the workflow runs and that the team gets assigned automatically.
  3. If the workflow works, activate it in n8n to run continuously.

If running the workflow on your own server, use self-host n8n resources to set it up.


Workflow Inputs, Processing, and Outputs

Inputs

  • New or updated bug tickets from Linear team.
  • Ticket title, description, state, and labels.

Processing Steps

  • Filter tickets to only those needing classification by checking description completeness, triage state, and “type/bug” label.
  • Send ticket info to OpenAI GPT-4 with a prompt listing all teams and their responsibilities.
  • Fetch the list of teams and their IDs from Linear GraphQL API.
  • Match the AI-decided team name with Linear team ID.
  • Update the ticket with the correct team using Linear’s API.
  • If AI returns “Other”, send a Slack message to notify manual triage is needed.

Outputs

  • Bug tickets in Linear are automatically assigned to correct teams.
  • Slack notifications for bugs needing manual attention.

Edge Cases and Failure Handling

If OpenAI cannot pick a fitting team, it returns “Other”.
Then the workflow alerts a Slack channel instead of wrongly assigning bugs.

If APIs or credentials fail, the workflow might stop or throw errors.
Make sure to renew API keys and OAuth2 tokens regularly.


Customization Ideas

  • Add more team descriptions in the Set me up node for better classification.
  • Change the Slack alert channel by updating the channel name in the same node.
  • Adjust filter conditions to cover different states or labels depending on your needs.
  • Swap OpenAI model in the OpenAI node to adjust cost or performance.
  • Refine the prompt message to give clearer instructions to AI on classification logic.

Troubleshooting Tips

  • If the Linear Trigger does not activate, check if the correct team ID and OAuth2 are set.
  • If OpenAI returns team names not found, verify exact match spelling in team list and prompt text.
  • If Slack alerts fail, make sure the bot token has correct permissions and channel is valid.
  • If the HTTP Request to Linear fails, check if OAuth2 credentials are expired and re-authenticate.

Pre-Production Checklist

  • Verify OAuth2 credentials for Linear and OpenAI work correctly.
  • Test updating a bug ticket to trigger the workflow.
  • Check if OpenAI classifies tickets as expected with sample data.
  • Confirm Linear GraphQL query returns all teams.
  • Ensure Slack messages send to correct channel.
  • Backup the workflow before switching it on for live use.

Deployment Guide

Activate the workflow inside n8n editor by toggling it on.
Watch executions and fix any problems in runtime logs.

Keep team names and responsibilities updated as company changes happen.
Adjust AI prompt or filtering logic if needed for better matches.


Example Prompt for OpenAI Node

This prompt helps AI classify bugs.
Use it in the OpenAI node message field.


I need you to classify a bug ticket and tell me which team should work on it
All possible teams will be described in the following format: [Teamname][Areas of responsibility]
=The possible teams are the following:
 {{ $('Set me up').first().json.teams }}
=This is the bug that we're trying to classify:
Title: {{ $('Linear Trigger').first().json.data.title }}
Description: {{ $('Linear Trigger').first().json.data.description }}
Which team should work on this bug?
Do not respond with anything else than the name of the team from the list you were given

Always keep this exact for best AI results.


Example JavaScript Expression to Map Team

Use this expression in the Set team ID node to find correct team ID by AI chosen name.

= {
  $('Get all linear teams').first().json.data.teams.nodes.find(team => team.name === $json.message.content).id
}

Summary

✓ The workflow auto-assigns bug tickets to correct teams.
✓ It helps reduce manual triage time and errors.
→ Bugs reach the right team faster.
→ Slack alerts make sure no bugs stay unassigned.


Frequently Asked Questions

Download the workflow file. Import it into n8n using Import from File. Add Linear, OpenAI, and Slack credentials. Update team and state IDs. Test by updating a bug in Linear. Then activate the workflow.
The workflow uses Linear API to get bug tickets, OpenAI GPT-4 for team classification, and Slack API to send alerts when manual triage is needed.
The workflow detects the “Other” response from OpenAI and sends a notification message to a Slack channel for manual team assignment.
Yes. The team list and their descriptions can be edited in the Set me up node to reflect current teams and responsibilities in Linear.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free