{
  "name": "Convert GitHub commits into review-ready pull requests with Google Gemini",
  "nodes": [
    {
      "id": "1e461404-a788-40d5-8c41-e2f24e062cd0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        272,
        624
      ]
    },
    {
      "id": "3ff48ae4-f4a8-4ed4-a878-caf91b19338d",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        544,
        624
      ]
    },
    {
      "id": "a79a9efb-4269-44ad-a33b-3cb0d9f1a54b",
      "name": "Check for Repository error",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        272
      ]
    },
    {
      "id": "0c9f5f07-8059-48d7-aa97-9ea45d64dd8d",
      "name": "MCP Server Trigger for Github",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        128,
        -352
      ]
    },
    {
      "id": "c96743bb-f689-4aa4-a365-35c2b918b9be",
      "name": "create_github_pr",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        464,
        -80
      ]
    },
    {
      "id": "8def05a1-46d6-42d7-8039-a25340c0438f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -320
      ],
      "parameters": {
        "width": 576,
        "height": 800,
        "content": "## How it works\n\nA GitHub issue triggers the MCP server.\n\nMCP forwards the issue context to this workflow.\n\nRepository details are extracted using AI.\n\nCommits from the target branch are fetched.\n\nCom"
      }
    },
    {
      "id": "92915031-6779-4b8a-bef5-ba27acac07f5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -496
      ],
      "parameters": {
        "width": 592,
        "height": 576,
        "content": "## MCP Issue Trigger\n\nListens for new or updated GitHub issues via MCP and starts the automation flow."
      }
    },
    {
      "id": "89bb2592-02bd-4345-ae79-39bd4f8862a5",
      "name": "Subworkflow Entry Point",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -16,
        368
      ]
    },
    {
      "id": "336cb283-c4ff-4c00-852e-d8d8a0ab1ed3",
      "name": "Extract Repo & Branch Context",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        320,
        368
      ]
    },
    {
      "id": "7f6cb32c-7363-4fa4-b01f-55ca9ee4344d",
      "name": "Fetch GitHub Issues",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        112,
        -80
      ]
    },
    {
      "id": "c4a0643f-433f-440e-a37b-edfe2ebd7c34",
      "name": "Repo or Branch Validation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        784,
        368
      ]
    },
    {
      "id": "a2d1a0b6-f3d4-4dc1-83d2-9c68b05b89e6",
      "name": "Build Error Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1424,
        288
      ]
    },
    {
      "id": "8703f716-6780-44ed-a195-c71e7ce3658c",
      "name": "Prepare PR Payload",
      "type": "n8n-nodes-base.set",
      "position": [
        1424,
        480
      ]
    },
    {
      "id": "e66b73c9-e51b-4db2-a63f-d665f152e516",
      "name": "Create Pull Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2192,
        288
      ]
    },
    {
      "id": "5607aebb-6cb5-43e3-8c3a-8034bca002c1",
      "name": "Generate PR Title & Description",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1840,
        288
      ]
    },
    {
      "id": "d32a4f90-f1f7-46a6-a64e-643ce2711624",
      "name": "Aggregate Commit Messages",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1632,
        288
      ]
    },
    {
      "id": "e08a9e7a-7a99-4278-b80d-4c60fae0dbdb",
      "name": "LLM PR Writer Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1936,
        480
      ]
    },
    {
      "id": "ab4b402d-e845-4dfa-84da-ae6d02956754",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        160
      ],
      "parameters": {
        "width": 1184,
        "height": 608,
        "content": "## Context & Intelligence\n\nReceives data from MCP, extracts repository and branch context, fetches commits, and prepares structured input for AI reasoning."
      }
    },
    {
      "id": "55f95864-7bf0-48aa-b47f-3bf315649e9f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        160
      ],
      "parameters": {
        "width": 1232,
        "height": 608,
        "content": "## PR Generation & Execution\n\nTransforms commit context into a PR title and description, validates output, and creates the pull request via GitHub API."
      }
    }
  ],
  "connections": {
    "create_github_pr": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger for Github",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch GitHub Issues": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger for Github",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "LLM PR Writer Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate PR Title & Description",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Build Error Response": {
      "main": [
        [
          {
            "node": "Aggregate Commit Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Subworkflow Entry Point": {
      "main": [
        [
          {
            "node": "Extract Repo & Branch Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Repo & Branch Context",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Extract Repo & Branch Context",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Commit Messages": {
      "main": [
        [
          {
            "node": "Generate PR Title & Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Repo or Branch Validation": {
      "main": [
        [
          {
            "node": "Check for Repository error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Repository error": {
      "main": [
        [
          {
            "node": "Prepare PR Payload",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Build Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Repo & Branch Context": {
      "main": [
        [
          {
            "node": "Repo or Branch Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate PR Title & Description": {
      "main": [
        [
          {
            "node": "Create Pull Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}