AutomationFlowsAI & RAG › Pr Review - Trigger Reviewer

Pr Review - Trigger Reviewer

PR Review - Trigger Reviewer. Uses postgres, executeCommand, slack. Webhook trigger; 10 nodes.

Webhook trigger★★★★☆ complexity10 nodesPostgresExecute CommandSlack
AI & RAG Trigger: Webhook Nodes: 10 Complexity: ★★★★☆ Added:

This workflow follows the Postgres → Slack recipe pattern — see all workflows that pair these two integrations.

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": "PR Review - Trigger Reviewer",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "pr-opened",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-pr",
      "name": "Webhook: PR Opened",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "resource": "database",
        "operation": "select",
        "table": "workflow_state",
        "where": {
          "values": [
            {
              "column": "pr_number",
              "value": "={{ $json.pull_request.number }}"
            }
          ]
        }
      },
      "id": "get-state",
      "name": "Get Workflow State",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "check-iterations",
              "leftValue": "={{ $json.iteration_count }}",
              "rightValue": "={{ $env.MAX_ITERATIONS || 5 }}",
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "check-limits",
      "name": "Check Iteration Limits",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "check-author",
              "leftValue": "={{ $('Webhook: PR Opened').item.json.pull_request.user.login }}",
              "rightValue": "claudiusward",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "select-reviewer",
      "name": "Select Reviewer",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        660,
        -100
      ],
      "notes": "If Claudius created the PR, Claudette reviews (and vice versa)"
    },
    {
      "parameters": {
        "command": "docker run --rm \\\n  -e ROLE=\"reviewer\" \\\n  -e AGENT_NAME=\"Claudette\" \\\n  -e GITHUB_TOKEN=\"$CLAUDETTE_GITHUB_TOKEN\" \\\n  -e ANTHROPIC_API_KEY=\"$ANTHROPIC_API_KEY\" \\\n  -e REPO_URL=\"{{ $('Webhook: PR Opened').item.json.repository.clone_url }}\" \\\n  -e PR_NUMBER=\"{{ $('Webhook: PR Opened').item.json.pull_request.number }}\" \\\n  -e PR_TITLE=\"{{ $('Webhook: PR Opened').item.json.pull_request.title }}\" \\\n  -e PR_BODY=\"{{ $('Webhook: PR Opened').item.json.pull_request.body }}\" \\\n  -e PR_BRANCH=\"{{ $('Webhook: PR Opened').item.json.pull_request.head.ref }}\" \\\n  -e ITERATION_COUNT=\"{{ $('Get Workflow State').item.json.iteration_count + 1 }}\" \\\n  -e MAX_ITERATIONS=\"{{ $env.MAX_ITERATIONS || 5 }}\" \\\n  -v claudette_workspace:/workspace \\\n  multiagentworkflow-claudette"
      },
      "id": "run-claudette-reviewer",
      "name": "Run Claudette (Reviewer)",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        880,
        -200
      ],
      "notes": "Claudette reviews Claudius's PRs"
    },
    {
      "parameters": {
        "command": "docker run --rm \\\n  -e ROLE=\"reviewer\" \\\n  -e AGENT_NAME=\"Claudius\" \\\n  -e GITHUB_TOKEN=\"$CLAUDIUS_GITHUB_TOKEN\" \\\n  -e ANTHROPIC_API_KEY=\"$ANTHROPIC_API_KEY\" \\\n  -e REPO_URL=\"{{ $('Webhook: PR Opened').item.json.repository.clone_url }}\" \\\n  -e PR_NUMBER=\"{{ $('Webhook: PR Opened').item.json.pull_request.number }}\" \\\n  -e PR_TITLE=\"{{ $('Webhook: PR Opened').item.json.pull_request.title }}\" \\\n  -e PR_BODY=\"{{ $('Webhook: PR Opened').item.json.pull_request.body }}\" \\\n  -e PR_BRANCH=\"{{ $('Webhook: PR Opened').item.json.pull_request.head.ref }}\" \\\n  -e ITERATION_COUNT=\"{{ $('Get Workflow State').item.json.iteration_count + 1 }}\" \\\n  -e MAX_ITERATIONS=\"{{ $env.MAX_ITERATIONS || 5 }}\" \\\n  -v claudius_workspace:/workspace \\\n  multiagentworkflow-claudius"
      },
      "id": "run-claudius-reviewer",
      "name": "Run Claudius (Reviewer)",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        880,
        0
      ],
      "notes": "Claudius reviews Claudette's PRs"
    },
    {
      "parameters": {
        "resource": "database",
        "operation": "update",
        "table": "workflow_state",
        "data": {
          "values": [
            {
              "iteration_count": "={{ $('Get Workflow State').item.json.iteration_count + 1 }}",
              "last_review_at": "={{ $now.toISO() }}"
            }
          ]
        },
        "where": {
          "values": [
            {
              "column": "pr_number",
              "value": "={{ $('Webhook: PR Opened').item.json.pull_request.number }}"
            }
          ]
        }
      },
      "id": "update-iteration",
      "name": "Update Iteration Count",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        1100,
        -100
      ]
    },
    {
      "parameters": {
        "channel": "#alerts",
        "text": "=:warning: *PR Review Escalation*\n\nPR #{{ $('Webhook: PR Opened').item.json.pull_request.number }} has exceeded the maximum review iterations ({{ $env.MAX_ITERATIONS || 5 }}).\n\n*Repository:* {{ $('Webhook: PR Opened').item.json.repository.full_name }}\n*PR:* {{ $('Webhook: PR Opened').item.json.pull_request.html_url }}\n\nPlease review manually."
      },
      "id": "escalate",
      "name": "Escalate to Human",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        660,
        200
      ],
      "notes": "Configure with your Slack webhook or replace with email/other notification"
    },
    {
      "parameters": {
        "resource": "database",
        "operation": "update",
        "table": "workflow_state",
        "data": {
          "values": [
            {
              "status": "escalated",
              "escalated_at": "={{ $now.toISO() }}"
            }
          ]
        },
        "where": {
          "values": [
            {
              "column": "pr_number",
              "value": "={{ $('Webhook: PR Opened').item.json.pull_request.number }}"
            }
          ]
        }
      },
      "id": "update-escalated",
      "name": "Update State: Escalated",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        880,
        200
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ success: true, pr: $('Webhook: PR Opened').item.json.pull_request.number }) }}"
      },
      "id": "respond",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1320,
        0
      ]
    }
  ],
  "connections": {
    "Webhook: PR Opened": {
      "main": [
        [
          {
            "node": "Get Workflow State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow State": {
      "main": [
        [
          {
            "node": "Check Iteration Limits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Iteration Limits": {
      "main": [
        [
          {
            "node": "Select Reviewer",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Escalate to Human",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Reviewer": {
      "main": [
        [
          {
            "node": "Run Claudette (Reviewer)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Claudius (Reviewer)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Claudette (Reviewer)": {
      "main": [
        [
          {
            "node": "Update Iteration Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Claudius (Reviewer)": {
      "main": [
        [
          {
            "node": "Update Iteration Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Iteration Count": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalate to Human": {
      "main": [
        [
          {
            "node": "Update State: Escalated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update State: Escalated": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "multi-agent",
    "reviewer"
  ]
}
Pro

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

About this workflow

PR Review - Trigger Reviewer. Uses postgres, executeCommand, slack. Webhook trigger; 10 nodes.

Source: https://github.com/mikeyward/multiagentworkflow/blob/ddb197d9dddcdbffaa5dfc7b7d346737a8ae8d23/n8n/workflows/pr-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

Multi-Agent Pipeline Orchestrator. Uses httpRequest, executeCommand, slack, readWriteFile. Webhook trigger; 11 nodes.

HTTP Request, Execute Command, Slack +1
AI & RAG

This workflow automates customer feedback processing by analyzing sentiment, identifying key issues, generating personalized responses, and escalating critical cases to support teams when required. De

Redis, Postgres, Agent +7
AI & RAG

This workflow automates inventory management and customer engagement for e-commerce businesses and retail operations managing multiple product categories. It solves the critical challenge of maintaini

Agent, OpenAI Chat, Output Parser Structured +3
AI & RAG

Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2). Uses start, postgres, openAi, emailSend. Webhook trigger; 37 nodes.

Start, Postgres, OpenAI +4
AI & RAG

AI-Driven Handbook Generator with Multi-Agent Orchestration (Pyragogy AI Village). Uses start, postgres, openAi, emailSend. Webhook trigger; 36 nodes.

Start, Postgres, OpenAI +3