Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Planned, not doneThe source describes an intention, not a finished result.

Add Automated Review Comments to New Pull Requests

Overview

Build an n8n workflow that checks a repository for new pull requests on a schedule, has an AI agent read each diff and draft a review comment, and posts it only after a reviewer approves in Slack.

Problem or Objective

More in Coding and Code Review

AI Agents and Models

Tools and Integrations

Tools
GitHub · Slack
Prerequisites
An n8n instance, GitHub credentials with access to the repository, an API key for a chat model, and a Slack workspace for approvals. The workflow must be saved and published for the schedule to run.

How It Works

In n8n, add GitHub credentials for an account with access to the repository. Start the workflow with a Schedule Trigger that runs every 15 minutes during working hours. Use the GitHub node to get the repository's open pull requests, keep only those not yet reviewed (store reviewed numbers in a sheet or table), and fetch each one's diff with the GitHub node's Get Diff operation. Pass the diff to an AI Agent node with a chat model and your review checklist (likely bugs, missing tests, unclear names, possible secrets). Connect a GitHub tool that creates a pull request comment, and put that tool behind a human review step with Slack as the approval channel. A reviewer sees the proposed comment and approves or denies it; only approved comments are posted. Labels, approvals and merges stay with people. Try it on a sandbox repository first, then save and publish the workflow so the schedule runs.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up n8n.
  2. Connect the toolsConnect the tools this workflow relies on: GitHub, Slack.
  3. Check the prerequisitesAn n8n instance, GitHub credentials with access to the repository, an API key for a chat model, and a Slack workspace for approvals. The workflow must be saved and published for the schedule to run.
  4. Gather your detailsCollect what the prompt asks for: Repository name, Maximum points per comment, Team conventions to check, Largest diff to review in full, Pull request diff.
  5. Run the starter promptPaste the starter prompt below into n8n and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at docs.n8n.io before you rely on it.

Practical Starter Prompt: Review this pull request diff

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
You review pull requests for [Repository name]. Read the diff below and draft one review comment with at most [Maximum points per comment] points, each naming the file and line, covering likely bugs, missing tests, unclear names and anything that looks like a secret or security risk. Follow our conventions: [Team conventions to check]. If the diff is longer than [Largest diff to review in full] lines, say so and review only the most important files. Use the GitHub comment tool once per pull request; a person approves the comment before it is posted. Never approve, label or merge. Diff: [Pull request diff]

Put the comment tool behind human review so a person approves every comment before it is posted. Test on a sandbox repository first, and keep labels, approvals and merges with people.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. n8n's pages document a Schedule Trigger for fixed intervals, a GitHub node that covers pull requests and can serve as an AI agent tool, an AI Agent node that needs at least one connected tool, and human review that pauses the workflow until a person approves a tool call through a channel such as Slack. No cited page measures how useful model-written review comments are, so treat them as suggestions for the human reviewer.

Limitations and Considerations

Each comment waits for a person's approval in Slack before it reaches the pull request, and the workflow never approves, labels or merges. The diff goes to the model provider you connect, so check your organisation's policy before sending private code and leave out files that hold secrets. Give the GitHub credential only the access needed to read pull requests and comment. Check your model provider's pricing before running it on large diffs. The Schedule Trigger page says the workflow must be saved and published for the schedule to run. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

AI Agent Repository

Source code of the agent that does the work.

Official Website

The official site of the main tool or project in this use case.

Visit Website (opens in a new tab)n8n.io

Related Videos

About n8n-io/n8n

About n8n-io/n8n

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. Schedule Trigger | Nodes | n8n Docs (opens in a new tab)

    Project documentation · docs.n8n.io · Undated · Source checked 25 Nov 2026, 12:10 UTC

    What this source supports
    • Use the Schedule Trigger node to run workflows at fixed intervals and times.
  2. GitHub | Nodes | n8n Docs (opens in a new tab)

    Project documentation · docs.n8n.io · Undated · Source checked 27 Nov 2026, 07:14 UTC

    What this source supports
    • Use the GitHub node to automate work in GitHub, and integrate GitHub with other applications.
    • This node can be used to enhance the capabilities of an AI agent.
  3. AI Agent | Nodes | n8n Docs (opens in a new tab)

    Project documentation · docs.n8n.io · Undated · Source checked 26 Nov 2026, 17:27 UTC

    What this source supports
    • Connect a chat model and one or more tools, and the agent decides which tools to call to complete a task.
  4. Human-in-the-loop for tools | Build | n8n Docs (opens in a new tab)

    Project documentation · docs.n8n.io · Undated · Source checked 26 Nov 2026, 17:35 UTC

    What this source supports
    • You can require human approval before an AI Agent executes a specific tool.
Report a problem

More with n8n

Planned, not done

Support Customers Through Telegram Messages

An n8n workflow turns new customer emails and contact-form messages into tasks with draft replies, and sends each draft to the owner in Telegram with Approve and Decline buttons before anything goes out.

docs.n8n.ion8n-io/n8n
Planned, not done

Expand an Editorial Outline into an SEO-Ready Long Article

An n8n workflow passes an editor's outline through two Basic LLM Chain nodes: one writes a long draft section by section, the other returns structured search metadata for the editor to review.

docs.n8n.ion8n-io/n8n
Planned, not done

Monitor Reddit for Questions About n8n Automations

An n8n workflow searches Reddit on a schedule for posts where people want n8n workflows built or fixed, saves each post as searchable embeddings, and lets you query the collection to see common problems.

docs.n8n.ion8n-io/n8n

View all: n8n