{
  "name": "Review GitHub pull requests with AI and log results to PostgreSQL and Slack",
  "nodes": [
    {
      "id": "c504d998-629d-4b9e-af8b-e958c06154aa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        48
      ],
      "parameters": {
        "width": 820,
        "height": 720,
        "content": "## AI Code Review Assistant\n\nAutomatically analyzes GitHub pull requests and provides AI-powered suggestions for code improvements. Reviews code quality, security, performance, and best practices. Gen"
      }
    },
    {
      "id": "91577eab-fbdb-413f-80b3-4732e86fd19d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1162,
        95
      ],
      "parameters": {
        "width": 468,
        "height": 513,
        "content": "## 1. Trigger PR Detection\n\nListens for new pull requests from GitHub webhook or manual trigger to start code review process"
      }
    },
    {
      "id": "d05acccf-134a-428a-9e59-e11500c01d80",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -654,
        255
      ],
      "parameters": {
        "width": 620,
        "height": 353,
        "content": "## 2. Fetch & Analyze Code\n\nRetrieves PR details, extracts code diffs, and prepares data for AI analysis"
      }
    },
    {
      "id": "ba9e7c28-9695-4751-b830-3b5967c84d26",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -144
      ],
      "parameters": {
        "width": 396,
        "height": 905,
        "content": "## 3. AI Review & Score\n\nAnalyzes code for quality, security, performance, and best practices. Generates improvement suggestions"
      }
    },
    {
      "id": "e9d15c91-34a0-46e8-9e8a-e5da04ed0b04",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        64
      ],
      "parameters": {
        "width": 496,
        "height": 553,
        "content": "## 4. Post Review & Notify\n\nPosts detailed review comments to GitHub PR and sends notifications via Slack. Stores results in database"
      }
    },
    {
      "id": "d438d0b0-cf6d-486e-937c-83ed26ae160f",
      "name": "GitHub Webhook - PR Events",
      "type": "n8n-nodes-base.githubTrigger",
      "position": [
        -1088,
        448
      ]
    },
    {
      "id": "4d2ec010-c68c-409d-b05f-556f960fabb0",
      "name": "Fetch Changed Files in PR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        448
      ]
    },
    {
      "id": "7a882f99-3d81-43af-870c-cc4e3cbdee45",
      "name": "Merge PR Details and Files",
      "type": "n8n-nodes-base.merge",
      "position": [
        -640,
        448
      ]
    },
    {
      "id": "47100d08-9231-4bfe-aeac-89164508d4b2",
      "name": "Extract Code Diffs",
      "type": "n8n-nodes-base.code",
      "position": [
        -416,
        448
      ]
    },
    {
      "id": "bcbe12e5-1ec7-44f1-9ca9-77b088a7a6b6",
      "name": "Score Review & Categorize Issues",
      "type": "n8n-nodes-base.code",
      "position": [
        -192,
        448
      ]
    },
    {
      "id": "f331cde5-8464-4201-9dce-e5a172f551ed",
      "name": "Route by Review Severity",
      "type": "n8n-nodes-base.switch",
      "position": [
        32,
        448
      ]
    },
    {
      "id": "bcb0d8cc-3963-4283-81a2-aec75e87eadc",
      "name": "Post Review to GitHub PR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        352
      ]
    },
    {
      "id": "54acd30a-8f92-4053-96da-4910dc31622c",
      "name": "Store Review Results in PostgreSQL",
      "type": "n8n-nodes-base.postgres",
      "position": [
        256,
        544
      ]
    },
    {
      "id": "546147e3-1040-44a4-964e-709ea61880dc",
      "name": "Send Summary to Slack",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        448
      ]
    },
    {
      "id": "d64976ed-b757-422c-a53c-6f7a80d7caa9",
      "name": "Log Review Completion",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        448
      ]
    }
  ],
  "connections": {
    "Extract Code Diffs": {
      "main": [
        [
          {
            "node": "Score Review & Categorize Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Summary to Slack": {
      "main": [
        [
          {
            "node": "Log Review Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Review to GitHub PR": {
      "main": [
        [
          {
            "node": "Send Summary to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Review Severity": {
      "main": [
        [
          {
            "node": "Post Review to GitHub PR",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store Review Results in PostgreSQL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post Review to GitHub PR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Changed Files in PR": {
      "main": [
        [
          {
            "node": "Merge PR Details and Files",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "GitHub Webhook - PR Events": {
      "main": [
        [
          {
            "node": "Fetch Changed Files in PR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge PR Details and Files": {
      "main": [
        [
          {
            "node": "Extract Code Diffs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score Review & Categorize Issues": {
      "main": [
        [
          {
            "node": "Route by Review Severity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Review Results in PostgreSQL": {
      "main": [
        [
          {
            "node": "Send Summary to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}