workflow.jsondevelopmentN8nv1.0

n8n: GitHub PR to Discord

Webhook listener for GitHub PR events. Posts formatted notifications to a Discord channel.

Setup time: ~10 min
Last updated: Mar 8, 2026
byFullVibeAIcontributor

Template

workflow.json
{
  "name": "GitHub PR to Discord",
  "nodes": [
    {
      "name": "GitHub Webhook",
      "type": "n8n-nodes-base.webhook",
      "parameters": {
        "httpMethod": "POST",
        "path": "github-pr",
        "responseMode": "onReceived"
      }
    },
    {
      "name": "Filter PR Events",
      "type": "n8n-nodes-base.filter",
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.body.action }}",
              "operation": "regex",
              "value2": "^(opened|closed|review_requested)$"
            }
          ]
        }
      }
    },
    {
      "name": "Format Message",
      "type": "n8n-nodes-base.code",
      "parameters": {
        "jsCode": "const pr = items[0].json.body.pull_request; const action = items[0].json.body.action; const emoji = { opened: ':green_circle:', closed: pr.merged ? ':purple_circle:' : ':red_circle:', review_requested: ':eyes:' }[action] || ':white_circle:'; return [{ json: { content: `${emoji} **PR ${action}**: [${pr.title}](${pr.html_url}) by ${pr.user.login}` } }];"
      }
    },
    {
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "parameters": {
        "operation": "message",
        "webhookUri": "YOUR_DISCORD_WEBHOOK_URL",
        "content": "={{ $json.content }}"
      }
    }
  ],
  "connections": {
    "GitHub Webhook": { "main": [[{ "node": "Filter PR Events" }]] },
    "Filter PR Events": { "main": [[{ "node": "Format Message" }]] },
    "Format Message": { "main": [[{ "node": "Discord" }]] }
  }
}

Setup

  1. 1

    Copy the workflow JSON above.

  2. 2

    In n8n, go to Workflows and click Import.

  3. 3

    Paste the JSON and update credential references.

  4. 4

    Activate the workflow.

Import into n8n

This is an n8n workflow. Import it directly into your n8n instance.

  1. 1

    Open your n8n instance (localhost:5678 or your cloud URL).

  2. 2

    Go to Workflows and click the + New button.

  3. 3

    Click the three-dot menu in the top right, then select "Import from JSON".

  4. 4

    Paste the workflow JSON from the template above.

  5. 5

    Update any placeholder values (channel names, webhook URLs, credentials).

  6. 6

    Activate the workflow with the toggle in the top right.

# Alternatively, import via n8n CLI:
n8n import:workflow --input=workflow.json

Version History

v1.0Initial releaseMar 8, 2026

Framework

N8n

Requirements

Webhook (n8n node)
Discord (n8n node)

File type

workflow.json

Version

v1.0

Updated Mar 8, 2026

Contributor

FullVibeAI →

Community submission

You might also like