Review GitHub pull requests and label them using OpenAI GPT-4o-mini and Slack
Needs changesWhat 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.
- Filter: keeps only the items that match a condition
- Extract PR Data (Code): runs custom JavaScript code
- Get PR Files (GitHub): list (file)
- Fetch PR Diff (HTTP Request): calls an HTTP API
- Merge: merges the data from its input branches
- Analyze File Changes (Code): runs custom JavaScript code
- AI Code Reviewer (AI Agent): runs an AI agent, with model: OpenAI Chat Model
- Parse AI Review (Code): runs custom JavaScript code
- Add PR Labels (GitHub): edit
- Post Review Comment (GitHub): create comment
…plus 4 more steps. See the full node list below.
Services it uses
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.0 | Replace 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)
- Webhook
n8n-nodes-base.webhook - Filter
n8n-nodes-base.filter - Code
n8n-nodes-base.code - GitHub
n8n-nodes-base.github - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Slack
n8n-nodes-base.slack - Aggregate
n8n-nodes-base.aggregate - Google Sheets
n8n-nodes-base.googleSheets - Respond to Webhook
n8n-nodes-base.respondToWebhook
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,…