{
  "name": "Automate GitHub PR linting with Google Gemini AI and auto-fix PRs",
  "nodes": [
    {
      "id": "8dedfb4b-d477-4fa5-9a9b-68b74450d1fe",
      "name": "Listen for Trigger from Github Workflow",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1040,
        -540
      ]
    },
    {
      "id": "4bec8f3a-5670-4fe5-916f-b7fab3165880",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1780,
        -580
      ]
    },
    {
      "id": "0e043c94-5b69-41f5-9f27-9dd5ea45a628",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2200,
        -660
      ]
    },
    {
      "id": "68047540-a8ea-4836-9d5b-3b81515f98fc",
      "name": "Get PR Files",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        360,
        -540
      ]
    },
    {
      "id": "29b9cace-ceaa-446c-a547-ac25c4331d5a",
      "name": "Get File Contents",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        -540
      ]
    },
    {
      "id": "a8920578-706a-4ed6-8c58-9be88f16420c",
      "name": "Convert Base64 to Text File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        780,
        -540
      ]
    },
    {
      "id": "1fccb56b-ca82-4c9b-9ede-f669a97067f6",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        980,
        -560
      ]
    },
    {
      "id": "543be972-e489-4ca0-8a43-d77442081016",
      "name": "Create Code/FilePath Object",
      "type": "n8n-nodes-base.set",
      "position": [
        1200,
        -560
      ]
    },
    {
      "id": "ac2ac571-5a1c-4f06-b45f-296fc43557c8",
      "name": "Collect All Files Changed",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1440,
        -560
      ]
    },
    {
      "id": "9062c98b-6937-4411-9a21-6f047084ab78",
      "name": "Get PR GitHub Branch",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -580,
        -520
      ]
    },
    {
      "id": "8c9f3d57-b73d-46a1-a7f8-b8ea49fbdbd0",
      "name": "Create GitHub Blob",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1660,
        -120
      ]
    },
    {
      "id": "3bba3645-f54e-46aa-866f-426404581221",
      "name": "Create GitHub Tree",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1880,
        -120
      ]
    },
    {
      "id": "26213bce-5117-475c-98a1-926140cdeec4",
      "name": "Create GitHub Commit",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2080,
        -140
      ]
    },
    {
      "id": "cb6918d1-4345-4f77-8667-c4ae6c790db5",
      "name": "Create Pull Request",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2580,
        -520
      ]
    },
    {
      "id": "8b9240b2-e23a-4f49-851a-1810d24f1bf3",
      "name": "Create Branch",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2480,
        -300
      ]
    },
    {
      "id": "ea314631-174f-4d03-a947-0710b2870ed1",
      "name": "Get Latest Main Branch Commit SHA",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -340,
        -540
      ]
    },
    {
      "id": "36633281-8335-4381-9393-cb1f64390bee",
      "name": "Get Latest Main Branch Tree Hash",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        140,
        -540
      ]
    },
    {
      "id": "435d5b12-3a71-4dbf-9d5d-97b30b249414",
      "name": "Get Branch",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2280,
        -200
      ]
    },
    {
      "id": "b26415fa-b898-4d79-a7da-8f66451f0747",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1500,
        -340
      ]
    },
    {
      "id": "9ec4b763-a3c8-4d5b-a50c-64842038a4ba",
      "name": "Set Common Fields",
      "type": "n8n-nodes-base.code",
      "position": [
        -820,
        -540
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Branch": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get PR Files": {
      "main": [
        [
          {
            "node": "Get File Contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Branch": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Create Code/FilePath Object",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File Contents": {
      "main": [
        [
          {
            "node": "Convert Base64 to Text File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Common Fields": {
      "main": [
        [
          {
            "node": "Get PR GitHub Branch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create GitHub Blob": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create GitHub Tree": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Pull Request": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create GitHub Commit": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get PR GitHub Branch": {
      "main": [
        [
          {
            "node": "Get Latest Main Branch Commit SHA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Collect All Files Changed": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to Text File": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Code/FilePath Object": {
      "main": [
        [
          {
            "node": "Collect All Files Changed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Latest Main Branch Tree Hash": {
      "main": [
        [
          {
            "node": "Get PR Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Latest Main Branch Commit SHA": {
      "main": [
        [
          {
            "node": "Get Latest Main Branch Tree Hash",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Listen for Trigger from Github Workflow": {
      "main": [
        [
          {
            "node": "Set Common Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}