Templates / Review GitHub pull requests and label them using OpenAI GPT-4o-mini and Slack

Review GitHub pull requests and label them using OpenAI GPT-4o-mini and Slack

Needs changes

by yu-ya ✓ · 395 views · created 2025-12-19 · AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 16 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects GitHub, OpenAI Chat Model, Slack and Google Sheets.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Filter: keeps only the items that match a condition
  2. Extract PR Data (Code): runs custom JavaScript code
  3. Get PR Files (GitHub): list (file)
  4. Fetch PR Diff (HTTP Request): calls an HTTP API
  5. Merge: merges the data from its input branches
  6. Analyze File Changes (Code): runs custom JavaScript code
  7. AI Code Reviewer (AI Agent): runs an AI agent, with model: OpenAI Chat Model
  8. Parse AI Review (Code): runs custom JavaScript code
  9. Add PR Labels (GitHub): edit
  10. Post Review Comment (GitHub): create comment

…plus 4 more steps. See the full node list below.

Services it uses

GitHubOpenAI Chat ModelSlackGoogle Sheets

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Code Reviewer (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Code Reviewer (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (12)

From the author

Automate GitHub pull request reviews and labeling using OpenAI This workflow automates the first line of code review for your development team. By leveraging OpenAI, it analyzes pull request diffs, assigns descriptive labels based on change size and category,…

Excerpt from yu-ya's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.