Skip to main content
Automate first-pass pull request reviews without posting unreviewed AI text to your repo. The workflow fetches PR metadata and diffs, drafts a review with an LLM, pauses for human approval in Command Center, then posts an approved comment on GitHub.

What you’ll build

Outcome: Reviewers see a structured summary in Command Center, edit or reject it, and only approved text is published as a GitHub comment.

Prerequisites

  • project_contributor access
  • GitHub personal access token with repo scope on target repositories
  • LLM provider configured in Providers
  • Optional: inbound webhook from GitHub (pull_request events) or manual runs with owner, repo, pr_number

Connectors to install

Build the workflow

1

Create workflow

Name it github-pr-review in Workflow Studio.
2

Validate input

lua_script requires owner, repo, and pr_number.
3

Fetch PR and files

Chain mcp_callget_pull_request then list_pull_request_files.
4

LLM review

llm_call with PR title, body, and file list in the prompt. Ask for risks, test gaps, and a suggested comment body.
5

Human approval

human_task with task_type: "approval" showing the draft comment. See Human tasks.
6

Post comment

mcp_calladd_issue_comment using the LLM draft text, gated by {{steps.approve-review.result.approved}}.
7

Trigger

Start runs manually, via API, or wire a GitHub webhook to an inbound subscription that maps pull_request.number to pr_number.

Validate input

Fetch PR

List changed files

LLM review

Human approval

Post comment

Command Approve only sets approved: true on the human task step — it does not copy draft_body into the result. Reference the LLM step for comment text, or complete the task via API with a custom result object. See Human tasks.

Full workflow graph (copy-paste)

Replace tenant_id, workflow_id, and bind your github MCP instance on each mcp_call step in Workflow Studio (instance picker sets server_url at publish time).
Start a run via Workflow Studio or:

Test run

Start a manual run:
Open Command Center, approve or edit the draft, then confirm the comment appears on the PR.

Variations

  • Add compare_commits for larger diff context before the LLM step.
  • Route low-confidence reviews: Lua checks for “BLOCK” in LLM output → always require human task.
  • On approval, call merge_pull_request instead of commenting (separate workflow with stricter gates).