Skip to main content

Review GitHub pull requests with GPT-4o and send feedback and Slack alerts

Workflow preview

Workflow preview
100%
Review GitHub pull requests with GPT-4o and send feedback and Slack alerts preview
Open on n8n.io

1. Workflow Overview

Automatically review pull requests with AI and post feedback as GitHub comments Who is this for Engineering teams, code reviewers, and tech leads who want to automate code review feedback. Ideal fo...

Best for

  • DevOps automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.githubtrigger, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.github, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by TakatoYamada.

Original n8n.io source

1.1 Workflow description

Title
Review GitHub pull requests with GPT-4o and send feedback and Slack alerts
Workflow name
Review GitHub pull requests with GPT-4o and send feedback and Slack alerts

Automatically review pull requests with AI and post feedback as GitHub comments


Who is this for

Engineering teams, code reviewers, and tech leads who want to automate code review feedback. Ideal for repositories with high PR volume where consistent first-pass review is valuable.

What this workflow does

This workflow automates pull request code review using GPT-4o and routes findings to GitHub and Slack. When a pull request is opened, it fetches the raw diff, sends it to GPT-4o for analysis, and posts a formatted Markdown comment with severity rating, categorized issues, suggestions, and an overall score. Critical findings trigger immediate Slack alerts.

How to set up

  1. Add your GitHub OAuth2 credential to the trigger and comment nodes
  2. Add your OpenAI API credential to the GPT-4o node
  3. Add your Slack OAuth2 credential to both Slack notification nodes
  4. Configure n8n Variables: GITHUB_OWNER, GITHUB_REPO, and GITHUB_TOKEN
  5. Activate the workflow - the GitHub webhook registers automatically
  6. Open a test pull request to verify end-to-end execution

Requirements

  • GitHub repository with OAuth2 credentials and Personal Access Token
  • OpenAI API account with GPT-4o access
  • Slack workspace with OAuth2 app installed
  • Two Slack channels: one for critical alerts, one for review summaries

How to customize

Adjust the diff truncation limit (default 12,000 chars) in the Format PR Diff node. Modify the GPT-4o system prompt to focus on specific code quality concerns like security or performance. Update Slack channel routing based on your team's notification policy.


Node List

# Node Name Type Purpose
1 When PR Opened GitHub Trigger Receives pull_request webhook events
2 Check PR Open If Passes only action = opened to avoid duplicates
3 Fetch PR Diff HTTP Request Fetches the raw unified diff from GitHub
4 Format PR Diff Code Extracts PR metadata; truncates diff to 12,000 chars
5 AI Code Review with GPT-4 OpenAI Sends diff to GPT-4o; returns structured JSON review
6 Build Comment for GitHub Code Parses JSON; assembles Markdown comment
7 Post Comment to GitHub GitHub Posts the AI review comment on the pull request
8 Check Critical Severity If Routes based on CRITICAL vs non-critical severity
9 Alert Critical Issues to Slack Slack Sends urgent alert to #incident
10 Share Review Summary on Slack Slack Sends summary notification to #code-reviews

Total: 10 nodes (+ 5 Sticky Notes)


Sticky Note Compliance

# Sticky Note Title Color Role
1 Main Sticky Note (Overview) Yellow Workflow overview, How it works, Setup steps, Customization
2 Trigger and filter PR White Covers GitHub trigger and PR filter
3 Fetch and format diff White Covers diff retrieval and formatting
4 AI review and comment White Covers AI review and comment building
5 Severity check and alerts White Covers severity routing and Slack notifications

All sticky notes use H2 headings (## ) and follow n8n public guidelines.


Tags

ai gpt-4 openai github slack code-review devops automation

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - When PR Opened

Type / Role
n8n-nodes-base.githubTrigger - githubTrigger
Config choices
Version 1

Block 7 - Check PR Open

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 8 - Fetch PR Diff

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 9 - Format PR Diff

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - AI Code Review with GPT-4

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 11 - Build Comment for GitHub

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Post Comment to GitHub

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 13 - Check Critical Severity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 14 - Alert Critical Issues to Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.1

Block 15 - Share Review Summary on Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.1

3. Summary Table

Workflow Review GitHub pull requests with GPT-4o and send feedback and Slack alerts
Complexity advanced
Nodes 15
Categories DevOps, AI Summarization
Author TakatoYamada
Published 26 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15306/15306.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Review GitHub pull requests with GPT-4o and send feedback and Slack alerts do?

Automatically review pull requests with AI and post feedback as GitHub comments Who is this for Engineering teams, code reviewers, and tech leads who want to automate code review feedback. Ideal fo...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, AI Summarization use case.