Skip to main content

Convert GitHub commits into review-ready pull requests with Google Gemini

Workflow preview

Workflow preview
100%
Convert GitHub commits into review-ready pull requests with Google Gemini preview
Open on n8n.io

1. Workflow Overview

Description Categories Developer Automation, AI Agents, GitHub Automation, DevOps Productivity Build an AI Driven GitHub Pull Request Automation with n8n + MCP This workflow creates an AI powered G...

Best for

  • DevOps automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.mcptrigger, @n8n/n8n-nodes-langchain.toolworkflow, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ahmed Salama.

Original n8n.io source

1.1 Workflow description

Title
Convert GitHub commits into review-ready pull requests with Google Gemini
Workflow name
Convert GitHub commits into review-ready pull requests with Google Gemini

Description

Categories Developer Automation, AI Agents, GitHub Automation, DevOps Productivity


Build an AI-Driven GitHub Pull Request Automation with n8n + MCP

This workflow creates an AI-powered GitHub automation that turns raw commit history into a clean, professional pull request automatically.

When triggered via MCP or another workflow, it extracts repository details, fetches all commits from a target branch, uses AI to understand the intent behind the changes, and creates a well-structured pull request with a clear title and description.

The result is a reliable, no-manual-work system that standardizes pull requests and reduces review friction across teams.


Benefits

Consistent Pull Requests

Every PR follows a clean, readable structure regardless of who triggered it.

Zero Manual Formatting

No copy-pasting commit messages or writing descriptions by hand.

Faster Review Cycles

Reviewers get clear context upfront, reducing back-and-forth.

AI-Assisted Context Awareness

Commit history is summarized intelligently, not blindly concatenated.

MCP-Ready Automation

Can be called directly by AI tools like Cursor through MCP.


How It Works

MCP or Workflow Trigger

  • Triggered via MCP server or another n8n workflow
  • Accepts natural language or structured input

Repository Information Extraction

  • AI extracts:
  • Repository owner
  • Repository name
  • Source branch
  • Base branch

Commit Retrieval (GitHub API)

  • Fetches all commits for the source branch
  • Collects commit messages as context

Commit Summarization (AI)

  • AI analyzes commit history
  • Generates:
  • A concise PR title
  • A clear bullet-point description

Pull Request Creation

  • Creates a GitHub pull request automatically
  • Uses correct base and head branches
  • Inserts AI-generated title and description

Required Setup

GitHub

  • Repository access
  • OAuth or personal access token
  • Permission to read commits and create pull requests

AI Model

  • Google Gemini or compatible LLM
  • Connected via n8n AI nodes

n8n

  • Self-hosted or cloud
  • HTTP access to GitHub APIs
  • MCP Trigger enabled for AI tool access

Business Use Cases

Engineering Teams

  • Standardize PR quality across developers
  • Reduce cognitive load on contributors

DevOps & Platform Teams

  • Enforce PR hygiene automatically
  • Improve velocity without extra process

Founders & Tech Leads

  • Maintain clean repositories without micromanagement

Agencies & Consultants

  • Deliver AI-assisted GitHub automation to clients

Difficulty Level

Intermediate


Estimated Build Time

45–75 minutes


Monthly Operating Cost

  • GitHub: Existing plan
  • AI Model: Free tier or usage-based
  • n8n: Self-hosted or cloud

Typical range: $0–20/month


Why This Workflow Works

  • Commits are the most reliable source of change intent
  • AI summarizes meaning, not noise
  • MCP enables direct AI-to-automation execution
  • GitHub remains the single source of truth

Possible Extensions

  • Auto-assign reviewers based on files changed
  • Add PR labels using AI classification
  • Generate changelog entries automatically
  • Post PR summary to Slack or Teams
  • Enforce branch naming or commit standards

Details

Nodes used in workflow

  • MCP Trigger
  • AI Agent (Repository Extraction)
  • Structured Output Parser
  • GitHub API (Commits)
  • Summarize
  • AI LLM Chain
  • GitHub API (Create Pull Request)
  • If
  • Edit Fields (Set)
  • Sticky Note

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 2 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 3 - Check for Repository error

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 4 - MCP Server Trigger for Github

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 2

Block 5 - create_github_pr

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Subworkflow Entry Point

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 9 - Extract Repo & Branch Context

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 10 - Fetch GitHub Issues

Type / Role
n8n-nodes-base.githubTool - githubTool
Config choices
Version 1.1

Block 11 - Repo or Branch Validation

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 12 - Build Error Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Prepare PR Payload

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Create Pull Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 15 - Generate PR Title & Description

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.9

Block 16 - Aggregate Commit Messages

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 17 - LLM PR Writer Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Convert GitHub commits into review-ready pull requests with Google Gemini
Complexity advanced
Nodes 19
Categories DevOps, AI RAG
Author Ahmed Salama
Published 30 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13118/13118.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert GitHub commits into review-ready pull requests with Google Gemini do?

Description Categories Developer Automation, AI Agents, GitHub Automation, DevOps Productivity Build an AI Driven GitHub Pull Request Automation with n8n + MCP This workflow creates an AI powered G...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, AI RAG use case.