GitHub + Slack: faster PR triage and clear alerts
PRs don’t slow teams down because the code is hard. They slow teams down because triage is messy: no consistent labels, no quick first-pass review, and a Slack thread that starts after someone pings “can someone look?” three times.
Engineering Managers feel it when cycle time climbs and nobody can explain why. A DevOps Engineer sees it when “small change” PRs ship late because they got buried. And frankly, senior devs get tired of repeating the same first-round feedback. This GitHub Slack triage automation gives every PR an instant, consistent baseline review.
You’ll set up a workflow that reads the PR diff, applies useful labels, posts a structured review comment, alerts Slack, and logs the details in Google Sheets so you can see what’s really happening over time.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: GitHub + Slack: faster PR triage and clear alerts
flowchart LR
subgraph sg0["AI Code Reviewer Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>GitHub PR Webhook"]
n1@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter PR Events", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Extract PR Data"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/github.dark.svg' width='40' height='40' /></div><br/>Get PR Files"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Fetch PR Diff"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge PR Info"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Analyze File Changes"]
n7@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n8@{ icon: "mdi:robot", form: "rounded", label: "AI Code Reviewer", pos: "b", h: 48 }
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Parse AI Review"]
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/github.dark.svg' width='40' height='40' /></div><br/>Add PR Labels"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/github.dark.svg' width='40' height='40' /></div><br/>Post Review Comment"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/slack.svg' width='40' height='40' /></div><br/>Notify Slack"]
n13@{ icon: "mdi:cog", form: "rounded", label: "Aggregate Results", pos: "b", h: 48 }
n14@{ icon: "mdi:database", form: "rounded", label: "Log to Sheets", pos: "b", h: 48 }
n15["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Respond to Webhook"]
n3 --> n5
n12 --> n13
n10 --> n13
n4 --> n5
n14 --> n15
n5 --> n6
n2 --> n3
n2 --> n4
n9 --> n10
n9 --> n11
n9 --> n12
n8 --> n9
n1 --> n2
n13 --> n14
n0 --> n1
n7 -.-> n8
n11 --> n13
n6 --> n8
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n8 ai
class n7 aiModel
class n1 decision
class n14 database
class n0,n4,n15 api
class n2,n6,n9 code
classDef customIcon fill:none,stroke:none
class n0,n2,n3,n4,n5,n6,n9,n10,n11,n12,n15 customIcon
Why This Matters: PRs Get Stuck in “Review Limbo”
Most teams don’t have a “review problem.” They have a triage problem. A new pull request comes in, and nobody knows if it’s a tiny refactor, a risky config change, or a big feature that needs a second set of eyes. So it sits. Or it gets a quick “LGTM” with no context, which helps nobody. Meanwhile, Slack gets noisy, developers context-switch, and the same basic checks (scope, risk, test coverage hints) get repeated by humans every single time. It’s exhausting, and it’s a bad use of senior attention.
Individually, these issues feel small. Together, they drag down throughput and quality.
- PR labels end up inconsistent, so you can’t sort work by risk or size with any confidence.
- Reviewers waste time opening a PR just to understand what changed and where.
- Slack notifications are either too vague (“new PR”) or too chatty, so people tune them out.
- There’s no clean reporting trail, which makes it hard to improve review standards week to week.
What You’ll Build: Automated PR Triage + AI First-Pass Review
This workflow starts the moment a pull request is opened (or updated) in GitHub. It pulls the PR metadata, fetches the list of changed files, and downloads the raw diff so it can evaluate what actually changed. Next, it categorizes the update using simple logic (for example, change size labels like size/S or size/L) and passes the diff into an AI reviewer powered by OpenAI. The AI produces a structured summary, a quality score, and specific strengths and concerns that read like a real first-round review. Finally, the workflow updates the PR with the right labels, posts a review comment back into GitHub, sends a clean Slack alert to your team channel, and logs the whole event to Google Sheets for tracking.
The workflow begins with a GitHub webhook trigger, then gathers the PR details and diff. After that, AI generates an actionable review you can actually use, and the workflow pushes the result to GitHub, Slack, and Google Sheets so the same information is visible everywhere.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say your team handles about 15 PRs a day. A human “first look” is usually 10 minutes: check files, skim diff, guess risk, write a quick summary for Slack. That’s roughly 2.5 hours daily just to get to the point where real review can start. With this workflow, the trigger is instant, the AI review runs in the background, and the only “manual” time is reading the summary in Slack or GitHub. For many teams, that means getting a couple hours back every day while reviews get more consistent.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- GitHub for webhook, repo access, labels, and comments
- Slack to notify your #code-reviews channel
- Google Sheets to log PR metadata and outcomes
- OpenAI API key (get it from the OpenAI API dashboard)
Skill level: Intermediate. You’ll paste a webhook URL into GitHub, connect credentials in n8n, and tweak a prompt without breaking the structure.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A pull request triggers the workflow. GitHub sends a “pull request opened” or “synchronize” event to n8n’s webhook, and the workflow immediately checks that it’s a PR action you care about.
PR details and diffs are collected. n8n pulls metadata (title, author, branch, URLs), fetches the list of changed files with the GitHub node, and downloads the raw diff via an HTTP request so the review is based on the real changes.
AI creates a practical first-pass review. The workflow assesses change impact (like “small vs large”) and sends the diff into an AI Agent using an OpenAI chat model. You get back a summary, a quality score, and specific strengths and concerns, which is then interpreted into clean fields n8n can act on.
GitHub, Slack, and Sheets all get updated. Labels are applied in GitHub, a review comment is posted to the PR discussion, Slack gets a concise alert with the key points, and Google Sheets stores the result for later reporting.
You can easily modify the labeling rules and the AI reviewer prompt to match your team’s standards. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Webhook Trigger
Set up the inbound GitHub webhook so the workflow can receive pull request events.
- Add the PR Webhook Intake node and set Path to
github-pr-review. - Set HTTP Method to
POSTand Response Mode toresponseNode. - In GitHub, create a webhook for pull request events pointing to the n8n webhook URL generated by PR Webhook Intake.
Tip: Use GitHub’s “Pull request” events (opened and synchronize) so the next filter step passes the correct payload structure.
Step 2: Connect GitHub and Validate PR Actions
Filter the webhook to only process actionable PR events and prepare GitHub access for file retrieval and updates.
- In Validate PR Actions, set the first condition to compare Left Value
={{ $json.body.action }}with Right Valueopened. - Add a second condition in Validate PR Actions with Left Value
={{ $json.body.action }}and Right Valuesynchronize, using the OR combinator. - Open Retrieve PR Files, and set Owner to
={{ $json.repoOwner }}, Repository to={{ $json.repoName }}, Resource tofile, and Operation tolist. - Open Apply PR Labels and Publish Review Comment to prepare GitHub credentials for label and comment updates.
Credential Required: Connect your GitHub credentials in Retrieve PR Files, Apply PR Labels, and Publish Review Comment.
Step 3: Set Up PR Data Processing and Parallel Fetching
Parse the incoming webhook payload and fetch files and diff data in parallel for downstream analysis.
- In Parse Pull Request Info, paste the provided JavaScript to extract fields like
prNumber,repoOwner,repoName, anddiffUrl. - Set Download PR Diff URL to
={{ $('Parse Pull Request Info').first().json.diffUrl }}. - Configure Combine PR Details with Mode
combineand Combine BycombineAll. - Confirm the execution flow: Parse Pull Request Info outputs to both Retrieve PR Files and Download PR Diff in parallel, then both feed into Combine PR Details.
⚠️ Common Pitfall: If GitHub sends a different payload format, Parse Pull Request Info may not find body.pull_request. Validate with a test webhook event.
Step 4: Set Up AI Review and Interpretation
Generate an AI review from the diff summary, then interpret the response into labels and comments.
- In Assess Change Impact, keep the provided JavaScript to compute
diffPreviewandsuggestedLabelsbased on size. - Configure OpenAI Chat Engine with Model set to
gpt-4o-mini. - In AI Review Agent, set Text to
=PR Review for: {{ $json.prTitle }}. Diff: {{ $json.diffPreview }}and keep the System Message describing the JSON format. - In Interpret AI Review, use the existing JavaScript to map the AI output into
finalLabelsandreviewComment.
Credential Required: Connect your OpenAI credentials in OpenAI Chat Engine. AI Review Agent uses OpenAI Chat Engine as its language model, so credentials must be added to the parent model node.
Step 5: Configure Output Actions and Logging
Apply labels, post comments, notify Slack, and log the results before responding to the webhook.
- In Apply PR Labels, set Owner to
={{ $json.repoOwner }}, Repository to={{ $json.repoName }}, Issue Number to={{ $json.prNumber }}, and Labels to={{ $json.finalLabels }}. - In Publish Review Comment, set Body to
={{ $json.reviewComment }}and keep Operation ascreateCommentwith Owner, Repository, and Issue Number mapped from the PR fields. - In Send Slack Alert, set Text to
New PR Review for #{{ $json.prNumber }}, Select tochannel, and update Channel ID value[YOUR_ID]. - Confirm the parallel execution: Interpret AI Review outputs to Apply PR Labels, Publish Review Comment, and Send Slack Alert in parallel.
- In Aggregate Outcomes, set Aggregate to
aggregateAllItemData, then configure Append to Sheets with Operationappend. - Finalize the response with Return Webhook Reply set to Respond With
jsonand Response Body={{ {success: true} }}.
Credential Required: Connect your Slack credentials in Send Slack Alert and your Google Sheets credentials in Append to Sheets.
Step 6: Test and Activate Your Workflow
Validate the end-to-end flow using a real PR event, then enable the workflow for production use.
- Click Execute Workflow and send a test pull request event from GitHub to the PR Webhook Intake URL.
- Verify that Retrieve PR Files and Download PR Diff both execute, then check that Combine PR Details and Assess Change Impact produce combined data.
- Confirm outputs: labels applied in GitHub, a comment posted by Publish Review Comment, a Slack message from Send Slack Alert, and a new row appended by Append to Sheets.
- When satisfied, toggle the workflow Active to enable production execution.
Troubleshooting Tips
- GitHub credentials can expire or lack repo scopes. If labels or comments fail, check the GitHub node credentials and confirm the token has permission to write to issues and pull requests.
- If you’re using HTTP requests to fetch diffs, GitHub can return truncated responses on very large PRs. When the AI output looks “thin,” verify the diff download step and consider limiting which files you include.
- Slack bot tokens often work, but the bot is not invited to the channel. If alerts don’t show up, open the channel details in Slack and add the app to that channel first.
Quick Answers
About 30 minutes if your GitHub, Slack, and Sheets are ready.
No. You will connect accounts, paste a webhook URL into GitHub, and adjust a couple of fields and prompts.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs, which are usually a few cents per PR depending on diff size.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Most teams start by editing the “AI Code Reviewer” system message to match their coding standards and preferred tone, then adjust the “Assess Change Impact” and “Analyze File Changes” logic to add labels like frontend, documentation, or infra based on file paths. You can also add an If node after the AI analysis to handle edge cases, like only posting Slack alerts when the quality score is below your threshold.
Usually it’s expired OAuth credentials or missing repo permissions. Reconnect the GitHub credential in n8n and confirm it can write labels and comments to that repository. If it fails only on some PRs, check whether the PR comes from a fork, since permissions can be restricted there.
Plenty for most teams. On n8n Cloud Starter you get a monthly execution allowance, and each PR event usually counts as one execution. If you self-host, there’s no platform execution limit; you’ll be constrained by your server and the time it takes to fetch diffs and run the AI review.
Often, yes. This workflow needs branching logic, a few transformation steps, and an AI review that’s based on the full diff, not a tiny summary field. n8n handles that kind of “real workflow” without charging you extra for every path. Self-hosting is another big deal if you have lots of PRs and don’t want per-task pricing anxiety. Zapier or Make can still be fine for simple “PR opened → send message” alerts, but once you add labeling, analysis, and logging, n8n is usually the calmer choice. If you want help deciding, Talk to an automation expert.
Once this is live, PRs arrive with context, labels, and a baseline review already attached. You’ll spend your review time on real engineering judgment, not on figuring out what changed.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.