Auto-review GitHub pull requests with n8n
They used an n8n workflow to inspect new GitHub pull requests, generate a review with an LLM, and post feedback back to the PR.
- What they did
- A GitHub trigger in n8n started the workflow whenever someone opened a pull request. The flow then pulled the changed files from GitHub, combined each filename with its diff in a Code node, and sent that context to an OpenAI chat model framed as a senior iOS developer. It also used a Google Sheet of Swift style rules as a reference before GitHub nodes added a review comment and a ReviewedByAI label.
- How it went
- In a test pull request that added iota cryptocurrency support, the agent left one overall comment and added the label. The review was useful as a first pass, but it tended to be wordy and could overlook the main issues.
- Tips
- Check the output of each node as you assemble the workflow. If you want file-by-file inline remarks, plan for a loop that handles each diff and its line numbers.
Try it yourself with n8n
Set up an n8n workflow for my GitHub repo [owner/repo] that starts when a new pull request is opened. Fetch the changed files and diffs, compare them with these team rules: [paste guidelines], and ask an AI model to review the code for bugs, readability, and missing tests. Draft a single PR comment and suggest a label like [label name]. Before anything is posted, stop and show me the exact comment and label for approval. If I approve, then post the comment and apply the label to the pull request.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
2 more reports of this
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Let n8n be the deployment target for your agent
They used Claude to draft, edit, and ship n8n workflows through the API instead of building each node manually.
Set up an alert-diagnosis workflow for Kubernetes incidents
An n8n flow takes Alertmanager alerts, checks several MCP-connected systems, and writes a read-only diagnostic reply in Mattermost.
Break a runtime migration into tiny reviewable PRs
GitHub engineers had Copilot agents carry out most of a large TypeScript-to-Rust runtime rewrite.
Refactor an app and try a Telegram API upgrade
One developer used Replit Agent to refactor a card app and to attempt a Telegram bot update, with mixed results.
Use Copilot CLI subagents for parallel terminal work
A commenter used GitHub Copilot CLI to split repo work across multiple subagents, run commands in parallel, and review the results live.
Use Scout to lint, fix, commit, and push from the terminal
A developer used Microsoft Scout in a local terminal to fix a syntax issue, review changes, and push a new branch after approval steps.