🔬 AI Contract Report: Plain English Translation + Risk Score Email (Claude/GPT-4o)

⚡ 10 views · 🔬 Document Extraction & Analysis

Description

Dual-AI translator that turns legal jargon into plain English with 0-100 risk scoring

Stop guessing what that 40-page lease actually says. This workflow uses two specialized AI agents to translate any PDF contract into plain English, calculate a 0-100 risk score, and flag hidden traps before you sign. You upload, it analyzes, you understand.

This is not another “AI contract generator” template. It does the opposite. You already have the contract, and this workflow decodes it for you. Your decision-making power stays intact because you see exactly what you’re agreeing to in language that makes sense.

How the workflow works

The workflow runs in eight stages:

  1. Upload and validate: User submits PDF contract via web form. The form only accepts .pdf files to prevent format errors.

  2. Security scan: The PDF is uploaded to VirusTotal for malware detection. A 20-second wait node gives the scan time to complete across 70+ antivirus engines.

  3. Route based on threat level: An IF node checks the scan results. Clean files (0 malicious flags) proceed to analysis. Infected files trigger an immediate rejection email with scan details and stop the workflow.

  4. Extract and prepare: A code node validates the form data and extracts the binary PDF. The Extract From File node converts the PDF to raw text. Another code node truncates the text to 40,000 characters (about 20 pages) to fit within AI context windows.

  5. AI Agent #1 - Translation: Claude Sonnet 4.5 reads the contract and translates legal jargon into plain English. It identifies the core parties, summarizes the agreement goal, breaks down key sections, maps obligations for both sides, and flags red flags like hidden fees or auto-renewal clauses. Output is structured JSON.

  6. AI Agent #2 - Risk Scoring: GPT-5 Mini analyzes the same contract text and assigns a 0-100 risk score. It looks for trap clauses (non-competes, one-sided indemnity, unfair termination terms) and provides a severity explanation. Output is structured JSON.

  7. Merge and format: A code node parses both AI outputs, handles JSON extraction from markdown code blocks, assigns color-coded risk labels (Low: green, Medium: yellow, High: orange, Critical: red), and merges everything into a single structured report object.

  8. Email delivery: The Gmail node sends a professional HTML email with the risk score visualization, executive summary, obligation breakdown, red flag warnings, and section-by-section translation table. The user gets the full analysis in their inbox.

Benefits

Target Audience

Required APIs

Easy Customization

đź”— Nodes Used

HTTP Request, Gmail, AI Agent, Anthropic Chat Model, OpenAI Chat Model, n8n Form Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup