GitHub Issue Auto-Assignment Based on Commands - n8n Workflow

Automate GitHub issue assignment triage using comment commands like 'assign me'. This n8n workflow utilizes conditional logic and a GitHub n8n trigger to manage assignments efficiently.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Development Teams: Seeking to streamline their issue triage process.
Open Source Maintainers: Looking to automate assignment for contributors who volunteer.
n8n Automation Specialists: Interested in utilizing complex conditional routing within an n8n workflow.
DevOps Professionals: Needing reliable, command-based interaction with GitHub.

Overview

Managing assignments in high-volume GitHub repositories can be time-consuming. This robust n8n workflow solves this by allowing users to self-assign issues simply by typing a command, such as 'assign me', either in the initial issue body or in a subsequent comment. The underlying n8n logic ensures that an issue is only assigned if it is currently unassigned, preventing conflicts. If a user tries to claim an already-assigned issue, the automation responds with a helpful comment, ensuring transparency. This specific n8n templates implementation showcases powerful flow control and simplifies the coordination of development tasks.

How it Works

The entire process starts with the 'Github Trigger1' n8n trigger, configured to listen for new issues (issues event) or new comments (issue_comment event).


  1. Trigger and Routing: When an event occurs, the data enters the n8n workflow. The 'Switch' n8n node analyzes the event action (e.g., 'opened' for an issue or 'created' for a comment).

  2. New Issue Assignment: If the action is 'opened', the flow moves to 'IF no assignee?'. This conditional n8n node checks if the issue is unassigned AND if the issue body contains 'assign me'. If both are true, the 'Assign Issue Creator' n8n node assigns the issue to the person who opened it and applies an 'assigned' label.

  3. Comment Assignment Attempt: If the action is 'created' (a new comment), the flow moves to 'IF wants to work?'. This n8n node checks if the comment body contains 'assign me'.

  4. Conflict Check: If the comment contains the assignment phrase, the flow proceeds to 'IF not assigned?'. This conditional n8n node checks the current assignment status.

  5. Assignment or Notification: If the issue is unassigned, the 'Assign Commenter' n8n node assigns the issue to the commenter. If the issue is already assigned, the 'Add Comment' n8n node automatically posts a reply informing the commenter that the issue is already taken, mentioning the current assignee. All other non-matching events or actions result in a 'No Operation, do nothing' n8n node, gracefully terminating that specific execution path.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance via the 'Workflows' menu, selecting 'New' and 'Import from JSON'.

  2. GitHub Credentials: You will need valid GitHub OAuth2 credentials set up in n8n. Ensure these credentials are linked to the following n8n node components: 'Github Trigger1', 'Assign Issue Creator', 'Add Comment', and 'Assign Commenter'.

  3. Configure Trigger: In the 'Github Trigger1' n8n trigger node, replace [username] and [reponame] with the actual owner and repository name you wish to monitor.

  4. Activation: Once credentials and repository details are configured, activate the n8n workflow by setting the toggle to 'Active'.

  5. Webhook Setup: If using a self-hosted n8n instance, ensure the GitHub webhook URL is correctly configured in your repository settings to point to your n8n trigger endpoint.

Node Details

This n8n template relies on several key n8n node components for its logic:

Github Trigger1 (n8n trigger): The entry point. Listens for issue_comment and issues events, ensuring the n8n workflow is activated for both new issues and subsequent comments.
Switch (n8n node): Routes the execution based on the event action ('opened' vs. 'created'), defining the core paths of the n8n workflow.
IF no assignee? (n8n node): A conditional logic n8n node that checks two key parameters for new issues: if the issue has zero assignees (assignees.length equals 0) and if the issue body matches the regex command /assign me/gm.
Assign Issue Creator (GitHub n8n node): Used to assign an issue to the user.login who created it and applies the 'assigned' label.
IF wants to work? (n8n node): Checks if a comment contains the regex command /assign me/gm before proceeding.
IF not assigned? (n8n node): Performs a final check on comment-based assignment attempts to ensure the issue is not already assigned.
Assign Commenter (GitHub n8n node): Assigns the issue to the commenter who requested it, successfully utilizing this n8n workflow function.
Add Comment (GitHub n8n node): Executes when an assignment conflict is detected, posting a helpful notification back to the GitHub issue.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Roshan Ramani
Roshan Ramani

Featured*