Analyze contract PDFs and score risk with Claude 3.5, Postgres, email and Slack alerts
Overview This workflow automates end-to-end contract analysis using AI. It extracts clauses, evaluates risks, tracks obligations, and generates an executive summary from uploaded contracts.
By combining multiple AI agents with structured parsing and scoring logic, the workflow provides deep legal insights and automatically flags high-risk contracts. It helps legal, compliance, and business teams review contracts faster, reduce risk, and ensure better decision-making.
How It Works
Webhook Trigger Accepts contract uploads via API endpoint.
Workflow Configuration Defines: Risk threshold Alert recipients Slack notification channel
PDF Text Extraction Extracts raw text from uploaded contract files.
Parallel AI Analysis Multiple AI agents process the contract simultaneously:
Clause Extraction Agent Identifies and categorizes contract clauses
Risk Assessment Agent Evaluates clause-level risks Assigns risk levels and recommendations
Obligation Extraction Agent Extracts responsibilities, deadlines, and commitments
Executive Summary Agent Generates structured contract summary and insights
Structured Output Parsing Ensures consistent JSON outputs for all agents
Data Aggregation Merges outputs from all AI agents into one dataset
Risk Scoring Engine Calculates weighted risk score based on: Clause types Risk levels Missing critical clauses AI confidence scores Generates: Score breakdown Red flags Recommendations
Data Preparation Formats contract data for storage and tracking
Database Storage Stores: Contract metadata Clauses Obligations Risk scoring results
Risk Evaluation Compares calculated risk score against threshold
Alert System If risk is high: Sends email alerts Sends Slack notifications
Setup Instructions
Webhook Setup Configure endpoint (contract-upload) Connect to your document upload system
AI Model Setup Add Anthropic (Claude 3.5) or OpenAI credentials Connect model to all AI agent nodes
Database Setup Configure Postgres credentials Create tables: contracts contract_clauses contract_obligations risk_scoring
Email Integration Configure Gmail or SMTP credentials Set alert recipient emails
Slack Integration Add Slack credentials Set channel ID for alerts
Configuration Settings Adjust: Risk threshold (e.g., 0.7) Alert recipients Slack channel
Use Cases
Legal contract review automation
Vendor agreement risk assessment
Compliance and audit workflows
Procurement contract validation
AI-powered legal tech solutions
Requirements
AI model API (Anthropic or OpenAI)
Postgres database
Email service (Gmail/SMTP)
Slack workspace
n8n instance
Key Features
Multi-agent AI contract analysis
Clause extraction and categorization
Risk scoring with weighted logic
Obligation tracking and deadline extraction
Executive summary generation
Automated high-risk alert system
Structured database storage for audit
Summary
A powerful AI-driven contract intelligence workflow that transforms unstructured legal documents into structured insights, risk scores, and actionable recommendations. It enables faster contract reviews, better risk management, and scalable legal automation.
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments