Code Review workflow
Configured with Agent, Github, Github Trigger, Google Sheets Tool, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- AI & models
- Trigger
- Web / API
- Code
- Integration
- Data store
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| PR Trigger | Trigger | Github Trigger | See node parameters |
| Get file's Diffs from PR | Web / API | HTTP Request | See node parameters |
| Create target Prompt from PR Diffs | Code | Code | See node parameters |
| GitHub Robot | Integration | Github | review |
| Add Label to PR | Integration | Github | edit |
| Code Best Practices | Data store | Google Sheets Tool | See node parameters |
| Code Review Agent | AI & models | Agent | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
githubApigithubOAuth2ApigoogleSheetsOAuth2ApiopenAiApi
Workflow notes
Sticky Note
1-The GitHub Trigger node initiates the workflow whenever a pull request event occurs on a specified repository. It enables real-time automation based on GitHub activity.
Sticky Note1
2-Get PR Diffs The HTTP Request node fetches the list of changed files and their diffs from the pull request that triggered the workflow. It uses the GitHub REST API to retrieve this data dynamically based on the trigger payload.
https://api.github.com/repos/{{$json.body.sender.login}}/{{$json.body.repository.name}}/pulls/{{$json.body.number}}/files
Sticky Note2
3-Create Prompt from diffs This Code node runs a JavaScript snippet to: -Parse file diffs from the previous HTTP Request node -Format each diff with its file name -Build a structured natural language prompt for the AI agent
The final output is a clear, contextual instruction like: "You are a senior iOS developer. Please review the following code changes in these files..."
Sticky Note3
Github Comment Poster Posts the AI-generated review as a comment on the pull request using GitHub API.
Sticky Note4
PR Labeler (optional) Automatically adds a label like ReviewedByAI to the pull request once the AI comment is posted.
Sticky Note5
Google Sheet Best Practices Enables the AI agent to reference to your team coding guidelines stored in a Google Sheet for more accurate and opinionated reviews. You can replace Google Sheets with any other database or tool.
Code Review workflow
Code Review workflow
Purpose and structure
This folder contains the Code Review workflow workflow. Its executable nodes use agent, code, github, githubTrigger, googleSheetsTool, httpRequest, lmChatOpenAi. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
PR Trigger
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1292_Code_GitHub_Automate_Webhook.json MIT; preserve source notices.