AutomationFlowsDevOps › Automate Github Issue Assignments via Comment Commands

Automate Github Issue Assignments via Comment Commands

ByRoshan Ramani @rawsun007 on n8n.io

Streamline your open source project with intelligent issue assignment automation.

Event trigger★★★★☆ complexity11 nodesGitHubGithub Trigger
DevOps Trigger: Event Nodes: 11 Complexity: ★★★★☆ Added:

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

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
{
  "id": "lPYVaz2xbN5zFDIL",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "temp",
  "tags": [
    {
      "id": "DaQLpYItTEM2y8Gt",
      "name": "Product",
      "createdAt": "2025-06-17T10:48:17.486Z",
      "updatedAt": "2025-06-17T10:48:17.486Z"
    },
    {
      "id": "6X5c5WbCRWtxJbl2",
      "name": "AI",
      "createdAt": "2025-06-17T10:48:17.367Z",
      "updatedAt": "2025-06-17T10:48:17.367Z"
    },
    {
      "id": "ycHNTMiM8vy98zu1",
      "name": "Building blocks",
      "createdAt": "2025-06-17T10:48:17.563Z",
      "updatedAt": "2025-06-17T10:48:17.563Z"
    },
    {
      "id": "UJ6au0mv063gOupq",
      "name": "Finance",
      "createdAt": "2025-06-17T10:48:17.583Z",
      "updatedAt": "2025-06-17T10:48:17.583Z"
    },
    {
      "id": "CaWiGPzJpyfUHdxp",
      "name": "IT Ops",
      "createdAt": "2025-06-17T10:48:17.388Z",
      "updatedAt": "2025-06-17T10:48:17.388Z"
    },
    {
      "id": "6Uolue5XigSZ2IYx",
      "name": "OpenAI",
      "createdAt": "2025-06-17T10:48:17.508Z",
      "updatedAt": "2025-06-17T10:48:17.508Z"
    },
    {
      "id": "nA8GpDM4XoG5aJ0A",
      "name": "Marketing",
      "createdAt": "2025-06-17T10:48:17.532Z",
      "updatedAt": "2025-06-17T10:48:17.532Z"
    },
    {
      "id": "J4gTJX9lSPm3wByF",
      "name": "Support",
      "createdAt": "2025-06-17T10:48:17.464Z",
      "updatedAt": "2025-06-17T10:48:17.464Z"
    },
    {
      "id": "i294x7TPtUQgJkmv",
      "name": "HR",
      "createdAt": "2025-06-17T10:48:17.426Z",
      "updatedAt": "2025-06-17T10:48:17.426Z"
    }
  ],
  "nodes": [
    {
      "id": "b1e09744-5b20-4336-8760-bdd7422e9b77",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1100,
        -121
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "opened"
            },
            {
              "output": 1,
              "value2": "created"
            }
          ]
        },
        "value1": "={{$json[\"body\"][\"action\"]}}",
        "dataType": "string"
      },
      "typeVersion": 1
    },
    {
      "id": "d8358b88-60ce-49c8-b156-6e8d29004ac1",
      "name": "IF no assignee?",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        -300
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json[\"body\"][\"issue\"][\"assignees\"].length}}",
              "operation": "equal"
            }
          ],
          "string": [
            {
              "value1": "={{$json[\"body\"][\"issue\"][\"body\"]}}",
              "value2": "/[a,A]ssign[\\w*\\s*]*me/gm",
              "operation": "regex"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2cbdec7e-8724-4016-b7b1-eac573946e7f",
      "name": "IF wants to work?",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        100
      ],
      "parameters": {
        "conditions": {
          "number": [],
          "string": [
            {
              "value1": "={{$json[\"body\"][\"comment\"][\"body\"]}}",
              "value2": "/[a,A]ssign[\\w*\\s*]*me/gm",
              "operation": "regex"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "64d80a69-acfd-4e3c-96f2-01706bf2ed48",
      "name": "IF not assigned?",
      "type": "n8n-nodes-base.if",
      "position": [
        -660,
        0
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json[\"body\"][\"issue\"][\"assignees\"].length}}",
              "operation": "equal"
            }
          ],
          "string": []
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6029b9bd-1616-40c7-ae4b-9d96740151a9",
      "name": "Assign Issue Creator",
      "type": "n8n-nodes-base.github",
      "position": [
        -660,
        -400
      ],
      "parameters": {
        "owner": "={{$node[\"Switch\"].json[\"body\"][\"repository\"][\"owner\"][\"login\"]}}",
        "operation": "edit",
        "editFields": {
          "labels": [
            {
              "label": "assigned"
            }
          ],
          "assignees": [
            {
              "assignee": "={{$json.body.issue[\"user\"][\"login\"]}}"
            }
          ]
        },
        "repository": "={{$node[\"Switch\"].json[\"body\"][\"repository\"][\"name\"]}}",
        "issueNumber": "={{ $json[\"body\"][\"issue\"][\"number\"] }}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e3460bc4-fe63-47db-8bbb-c288e2f3f842",
      "name": "Add Comment",
      "type": "n8n-nodes-base.github",
      "position": [
        -440,
        100
      ],
      "parameters": {
        "body": "=Hey @{{$json[\"body\"][\"comment\"][\"user\"][\"login\"]}},\n\nThis issue is already assigned to {{$json[\"body\"][\"issue\"][\"assignee\"][\"login\"]}} \ud83d\ude42",
        "owner": "={{$json[\"body\"][\"repository\"][\"owner\"][\"login\"]}}",
        "operation": "createComment",
        "repository": "={{$json[\"body\"][\"repository\"][\"name\"]}}",
        "issueNumber": "={{$json[\"body\"][\"issue\"][\"number\"]}}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d65b9db7-8708-4ba3-b95e-c8d2a5b0c6cb",
      "name": "Assign Commenter",
      "type": "n8n-nodes-base.github",
      "position": [
        -440,
        -100
      ],
      "parameters": {
        "owner": "={{$json[\"body\"][\"repository\"][\"owner\"][\"login\"]}}",
        "operation": "edit",
        "editFields": {
          "labels": [
            {
              "label": "assigned"
            }
          ],
          "assignees": [
            {
              "assignee": "={{$json[\"body\"][\"comment\"][\"user\"][\"login\"]}}"
            }
          ]
        },
        "repository": "={{$json[\"body\"][\"repository\"][\"name\"]}}",
        "issueNumber": "={{$json[\"body\"][\"issue\"][\"number\"]}}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "924d54fc-2744-418a-95f2-d71eb3383f1d",
      "name": "Github Trigger1",
      "type": "n8n-nodes-base.githubTrigger",
      "position": [
        -1320,
        -100
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "[username]"
        },
        "events": [
          "issue_comment",
          "issues"
        ],
        "options": {},
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "[reponame]"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "96e8e530-34aa-4e55-a3b6-36fa0f94e7f4",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -660,
        -200
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9954a4af-9c03-4761-930d-ee8408b77b8f",
      "name": "No Operation, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -660,
        200
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4a8907e2-277f-4985-8dad-5799a4a46e26",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        -480
      ],
      "parameters": {
        "width": 1820,
        "height": 1000,
        "content": "GitHub Auto-Assign Workflow\nTrigger: Listens for new GitHub issues or comments.\nSwitch: Checks if the action is either \"opened\" or \"created\" (i.e. new issue opened or comment added).\nIF no assignee? If it's a new issue, checks if there's no one assigned yet and the issue body includes \"assign me\".\n\n\u2705 If true \u2192 Assign Issue Creator (assigns the issue to the person who opened it + adds \"assigned\" label).\n\u274c Else \u2192 do nothing.\n\nIF wants to work? If it's a comment, checks if the comment includes \"assign me\".\n\nIf yes \u2192 goes to IF not assigned?\nIf the issue still has no assignee:\n\n\u2705 Assign Commenter (assigns the commenter + label).\n\n\nElse:\n\n\ud83d\udcac Add Comment \"This issue is already assigned to @someone\".\n\n\nElse \u2192 do nothing.\n\n\ud83d\udd27 Setup Guide (easy steps):\nClone/import: Paste this JSON into your n8n Editor (use the Import menu).\nConnect GitHub credentials:\n\nSet Github Trigger1 to listen on your owner/repo via OAuth.\nProvide OAuth credentials for the two GitHub nodes.\n\nEnable the workflow (turn it active).\nTest it out:\n\nOpen a new issue with \"assign me\" \u2192 you get assigned.\nComment \"assign me\" on unassigned issues \u2192 the commenter gets assigned.\nComment \"assign me\" on already assigned issues \u2192 auto-comment says someone else is assigned.\n\n\ud83d\udcdd Why this is handy:\n\nAutomates GitHub triage: anyone asking gets the issue!\nKeeps things fair: avoids conflicts by checking assignments.\nScales across issues & comments with just one simple workflow.\n\n\u2705 Optional Tweaks:\n\nAdjust trigger events (e.g. only issues, no comments).\nChange the regex to detect other phrases.\nAdd notifications (e.g., Slack or email alerts when assignment happens)."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "acdd4625-6ad4-4b4d-9e2f-0ed7bed010b4",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "IF no assignee?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF wants to work?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Github Trigger1": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF no assignee?": {
      "main": [
        [
          {
            "node": "Assign Issue Creator",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF not assigned?": {
      "main": [
        [
          {
            "node": "Assign Commenter",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF wants to work?": {
      "main": [
        [
          {
            "node": "IF not assigned?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing1",
            "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

Streamline your open source project with intelligent issue assignment automation.

Source: https://n8n.io/workflows/5004/ — original creator credit. Request a take-down →

More DevOps workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

DevOps

Assign Issues To Interested Contributors. Uses githubTrigger, noOp, github. Event-driven trigger; 11 nodes.

Github Trigger, GitHub
DevOps

Automate Assigning Github Issues. Uses noOp, github, githubTrigger. Event-driven trigger; 10 nodes.

GitHub, Github Trigger
DevOps

Automate assigning GitHub issues. Uses noOp, github, githubTrigger. Event-driven trigger; 10 nodes.

GitHub, Github Trigger
DevOps

This workflow assigns a user to an issue if they include "assign me" when opening or commenting. To use this workflow you will need to update the credentials used for the Github nodes.

GitHub, Github Trigger
DevOps

GitHub Issue Triage - Auto-Label by Complexity. Uses githubTrigger, github. Event-driven trigger; 6 nodes.

Github Trigger, GitHub