Review GitHub pull requests with Mistral and send decisions to Slack

Quick overview This workflow receives GitHub webhook events for pull requests, pushes, and branch/tag creates, filters out actions from the repo owner, and posts alerts to Slack (optionally Discord). For pull requests, it uses Mistral to generate an AI review from the PR diff and supports a human approval form.

How it works Receives a GitHub webhook request and filters for push, create, and pull_request events coming from non-owner accounts (and non-deleted branches). Routes the event by type and, for push and create events, extracts key details and posts a notification to Slack (optionally Discord). For pull request opened, reopened, or synchronize events, extracts PR metadata such as title, URLs, branch refs, and change counts. Uses Mistral (via an AI agent) to fetch the PR unified diff over HTTP and generate a structured JSON review, optionally consulting existing GitHub PR reviews for synchronize re-reviews. Posts the AI recommendation to Slack with a link to a hosted PR review form (optionally Discord) and waits up to 24 hours for a reviewer decision. Applies the reviewer decision back to GitHub by approving the PR and merging it, requesting changes with a comment, or closing the PR, then posts a confirmation message to Slack (optionally Discord).

Setup Create a GitHub webhook on your repository for pull_request, push, and create events and point it to this workflow’s webhook URL path (/webhook/github). Add GitHub credentials (a Personal Access Token with repo access) for posting PR reviews and update any repository/owner mappings if needed. Add Slack OAuth credentials and set the target Slack channel name/ID in the Slack message nodes. (Optional) Add a Discord webhook credential and enable the Discord nodes if you want Discord notifications. Add Mistral Cloud API credentials for the chat model used by the AI review agent.

0
Downloads
0
Views
8.18
Quality Score
intermediate
Complexity
Author:Dave Sartori(View Original β†’)
Created:7/5/2026
Updated:7/5/2026

πŸ”’ Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments