Automated PR code reviews with GitHub, GPT-4, and Google Sheets best practices
Needs changesNeeds 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 8 nodes and runs on Github events (pull request). Along the way it connects OpenAI Chat Model, GitHub and Google Sheets.
How it runs
Trigger: On Github events (pull request).
- Get file's Diffs from PR (HTTP Request): calls an HTTP API
- Create target Prompt from PR Diffs (Code): runs custom JavaScript code
- Code Review Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Code Best Practices)
- GitHub: work with review
- Add Label to PR (GitHub): edit
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 Code Review Agent (v1.9): 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) Code Review Agent (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (7)
- OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Github Trigger
n8n-nodes-base.githubTrigger - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - GitHub
n8n-nodes-base.github - Google Sheets Tool
n8n-nodes-base.googleSheetsTool - AI Agent
@n8n/n8n-nodes-langchain.agent
From the author
AI-Agent Code Review for GitHub Pull Requests Description: This n8n workflow automates the process of reviewing code changes in GitHub pull requests using an OpenAI-powered agent. It connects your GitHub repo, extracts modified files, analyzes diffs, and uses…