AutomationFlowsAI & RAG › GitHub Code Review with AI Agent

GitHub Code Review with AI Agent

Original n8n title: Gitflow: 4 - Code Review

Gitflow: 4 - Code Review. Uses githubTrigger, github, aiAgent. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexity4 nodesGithub TriggerGitHubAi Agent
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Gitflow: 4 - Code Review",
  "nodes": [
    {
      "parameters": {
        "githubApi": "YOUR_GITHUB_API_CREDENTIAL_ID",
        "events": [
          "pull_request.synchronize"
        ]
      },
      "name": "GitHub Trigger",
      "type": "n8n-nodes-base.githubTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "owner": "eivindingebrigtsen",
        "repository": "agent",
        "operation": "getPullRequestDiff",
        "pullRequestNumber": "={{ $json.body.pull_request.number }}"
      },
      "name": "GitHub: Get Diff",
      "type": "n8n-nodes-base.github",
      "typeVersion": 3,
      "position": [
        500,
        300
      ],
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "prompt": "You are a senior code reviewer. Analyze the following diff. Check for bugs, style issues, security vulnerabilities, and adherence to best practices. Provide your feedback as a formal PR review.",
        "model": "gemini-pro",
        "text": "={{ $('GitHub: Get Diff').item.json.diff }}"
      },
      "name": "AI Agent: Review Code",
      "type": "n8n-nodes-base.aiAgent",
      "typeVersion": 1,
      "position": [
        750,
        300
      ],
      "credentials": {
        "geminiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "owner": "eivindingebrigtsen",
        "repository": "agent",
        "operation": "createReview",
        "pullRequestNumber": "={{ $json.body.pull_request.number }}",
        "body": "={{ $('AI Agent: Review Code').item.json.output }}",
        "event": "COMMENT"
      },
      "name": "GitHub: Post Review",
      "type": "n8n-nodes-base.github",
      "typeVersion": 3,
      "position": [
        1000,
        300
      ],
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "GitHub Trigger": {
      "main": [
        [
          {
            "node": "GitHub: Get Diff",
            "type": "main"
          }
        ]
      ]
    },
    "GitHub: Get Diff": {
      "main": [
        [
          {
            "node": "AI Agent: Review Code",
            "type": "main"
          }
        ]
      ]
    },
    "AI Agent: Review Code": {
      "main": [
        [
          {
            "node": "GitHub: Post Review",
            "type": "main"
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "4"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Gitflow: 4 - Code Review. Uses githubTrigger, github, aiAgent. Event-driven trigger; 4 nodes.

Source: https://github.com/eivindingebrigtsen/agent/blob/e0b57ed02a522ed6adc2b1c58c5feadf427d4a80/.n8n/workflow-4-code-review.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Gitflow: 5 - Review Triage. Uses githubTrigger, aiAgent, github. Event-driven trigger; 4 nodes.

Github Trigger, Ai Agent, GitHub
AI & RAG

Gitflow: 1 - Task Intake & Issue Creation. Uses manualTrigger, aiAgent, github. Event-driven trigger; 4 nodes.

Ai Agent, GitHub
AI & RAG

This workflow transforms your software release process by automatically generating clean, professional changelogs from your Git commit history. It listens for new version tags in your GitHub repositor

Github Trigger, GitHub, Agent +2
AI & RAG

Ensure your GitHub repositories stay configuration-accurate and documentation-compliant with this intelligent AI-powered validation workflow. 🤖 This automation monitors repository updates, compares co

Github Trigger, GitHub, Agent +5
AI & RAG

Github-Ai-Code-Review. Uses githubTrigger, httpRequest, agent, lmChatOpenAi. Event-driven trigger; 21 nodes.

Github Trigger, HTTP Request, Agent +2