Back to n8n Automations

Case Study / Document Intelligence / 01

AI Contract Review & Red Flag Detection System

An automated first-pass contract review system built in n8n that processes uploaded contracts, analyzes important provisions, identifies potential risks, calculates an overall contract risk score, and prepares the completed analysis for human review.

01 / Project Overview

A structured first pass for contract review.

The system is designed as decision support rather than automatic legal approval. It turns an uploaded agreement into structured findings that can be reviewed by the contract owner or a qualified human reviewer.

Input

Uploaded contract files received through Google Drive.

Analysis

Clause, risk, supporting-evidence, and review-priority checks.

Output

Human-review-ready findings tracked in Sheets and delivered through Slack.

The Challenge

Contract screening creates repetitive, detail-heavy work.

Manual contract screening often requires repetitive work such as locating key clauses, checking whether important provisions are missing, identifying potentially unfavorable terms, and preparing findings for another reviewer.

Long agreements add another challenge: they can exceed the practical context size of a single analysis request.

The Solution

A controlled analysis path for standard and long contracts.

The workflow extracts contract text, identifies and reconciles important clauses against a predefined checklist, analyzes potential risks, verifies evidence, removes duplicate findings, and calculates an overall risk score.

Standard contracts use the normal path. Larger contracts enter a dedicated chunking pipeline that analyzes manageable sections, aggregates the findings, and produces one unified review for human review.

03 / Workflow Architecture

An end-to-end contract-analysis workflow.

The workflow extracts contract text, routes standard and long documents through the appropriate analysis paths, and prepares risk-scored findings for human review.

Architecture Details

Designed for traceable handoff.

The end-to-end n8n workflow handles contract intake, document extraction, clause analysis, normal and long-contract processing, risk scoring, escalation, human-review preparation, Slack notifications, and processed-file management.

Stack / Tools

Connected services for the review path.

Orchestration

n8n

Coordinates intake, routing, analysis, review preparation, and connected tools.

Analysis

OpenRouter

Supports structured first-pass contract and clause analysis.

Intake + files

Google Drive

Receives source agreements and manages processed contract files.

Tracking

Google Sheets

Keeps contract-review records and workflow state traceable.

Review delivery

Slack

Sends structured contract-review output for human review.

04 / Workflow Breakdown

How the system works.

01

Contract intake & extraction

  1. 01

    Contract text extraction

  2. 02

    Standard contract processing

  3. 03

    Long-document / chunked contract processing

  4. 04

    Contract metadata extraction

02

Clause & risk analysis

  1. 05

    Clause detection

  2. 06

    Clause reconciliation

  3. 07

    Missing-clause identification

  4. 08

    Red-flag detection

  5. 09

    Risk analysis

  6. 10

    Evidence verification

  7. 11

    Finding deduplication

  8. 12

    Prompt-injection detection

03

Review preparation

  1. 13

    Risk scoring

  2. 14

    Escalation classification

  3. 15

    Human-review routing

04

Tracking and notifications

  1. 16

    Google Sheets contract tracking

  2. 17

    Slack review notifications

  3. 18

    Google Drive file management

07 / System Outcome

A traceable, human-review-ready contract first pass.

The finished system turns an uploaded contract into a structured first-pass review with identified clauses, missing provisions, red flags, supporting evidence, overall risk scoring, escalation logic, and a human-review-ready summary.

It also supports large contracts through a dedicated chunking pipeline and keeps the review process traceable through Google Sheets, Slack, and Google Drive.

Identifies

Clauses, missing provisions, red flags, and supporting evidence

Routes

Standard and long contracts through appropriate analysis paths

Prepares

Risk scoring, escalation, and human-review-ready output

Review Delivery

Structured findings delivered for review.

After analysis, the system sends a structured Slack review containing the contract type, processing mode, risk level, risk score, review priority, red-flag count, missing-clause count, AI-generated summary, contract link, and final review status.

The system does not automatically approve contracts or determine whether an agreement is safe to sign. It performs an automated first-pass review and prepares findings for the contract owner or a qualified human reviewer.

A high-risk contract-review notification. Redacted information remains exactly as provided.Click to expand