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
Automate bug classification with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

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


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

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.


Automate bug classification with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.