Templates / Contract extraction, risk analysis & compliance automation with GPT-4.1 Mini

Contract extraction, risk analysis & compliance automation with GPT-4.1 Mini

Ready for 3.0

by Cheng Siong Chin ✓ · 510 views · created 2025-11-12 · Document Extraction, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 23 nodes and runs on a schedule (every day at 02:00) (plus 2 other triggers). Along the way it connects Gmail, Embeddings OpenAI, OpenAI Chat Model and Postgres and 1 more.

How it runs

Trigger: On a schedule (every day at 02:00) (plus 2 other triggers).

  1. Workflow Configuration (Edit Fields (Set)): sets 8 fields: repositoryApiUrl, dashboardApiUrl, clmSystemUrl…
  2. Merge: merges the data from its input branches
  3. Fetch Contracts from Repository (HTTP Request): calls an HTTP API
  4. Extract Contract Content (Extract from File): extracts data from a file (pdf)
  5. Vector Store - Contract Clauses (Simple Vector Store): stores documents in the Simple vector store, with embeddings: OpenAI Embeddings; document loader: Document Loader - Contract Processing
  6. AI Agent: runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Parser - Compliance Results
  7. Calculate Risk Score (Code): runs custom JavaScript code
  8. Store Compliance Results (Postgres): uses Postgres
  9. Route by Risk Level (Switch): routes items into 3 branches
  10. Alert - High Risk Contracts (Slack): uses Slack

…plus 5 more steps. See the full node list below.

Services it uses

GmailEmbeddings OpenAIOpenAI Chat ModelPostgresSlack

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail - Contract Emails).

Nodes used (18)

From the author

How It Works Scheduled triggers initiate automated contract reviews. The system fetches documents from cloud storage and email, then uses AI to extract key terms, obligations, and compliance requirements. Multi-model parsing identifies gaps, inconsistencies,…

Excerpt from Cheng Siong Chin's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.