Skip to content

GitHub PR Review

Overview

The github_pr_review node fetches a GitHub pull request by repository and PR number, then produces a structured summary including metadata, diff statistics, review comments, and a generated review narrative. It requires a GitHub personal access token or OAuth credential with repo (or public_repo) scope. If the PR cannot be fetched — due to invalid credentials, a non-existent PR, or rate limiting — execution routes to the error output port with a typed error payload.

Configuration

FieldTypeRequiredDescription
repositorystringYesFull repository path in owner/repo format (e.g. octocat/hello-world). Must match the repository that hosts the target pull request.
pr_numbernumberYesPull request number to fetch. Must be a positive integer referencing an existing PR in the specified repository.
credential_idstringYesID of a stored GitHub credential (personal access token or OAuth token) with at least repo or public_repo scope.
include_diffbooleanNoWhen true, the full unified diff is fetched and included in the output payload. Defaults to false. Large diffs may impact downstream token usage.
summary_modelenumNoAI model used to generate the review narrative. Accepted values: gpt-4o, claude-sonnet, gemini-pro. Defaults to the workspace default model if unset.
max_diff_bytesnumberNoUpper bound on the diff payload size in bytes before it is truncated. Defaults to 32768. Applies only when include_diff is true.

Inputs

PortTypeDescription
inputanyTrigger signal that starts the node. Any upstream value is accepted; the node uses its own config to determine what to fetch.
pr_overrideobjectOptional dynamic override for repository and/or pr_number at runtime. Fields present in this object take precedence over the static config values. Shape: { repository?: string; pr_number?: number }.

Outputs

PortTypeDescription
outputobjectStructured PR review payload on success. Shape: { pr: PullRequestMeta; diff_stats: DiffStats; comments: ReviewComment[]; summary: string } where summary is the AI-generated review narrative.
errorobjectEmitted when the node fails to fetch or process the PR. Shape: { code: string; message: string; retryable: boolean }. Common codes: AUTH_FAILED, NOT_FOUND, RATE_LIMITED.

Example

json
{
  "nodeType": "github_pr_review",
  "config": {
    "repository": "acme-org/backend-api",
    "pr_number": 412,
    "credential_id": "cred_gh_prod_readonly",
    "include_diff": true,
    "max_diff_bytes": 65536
  }
}