Analyze contract PDFs and score risk with Claude 3.5, Postgres, email and Slack alerts
Ready for 3.0What this workflow does
This AI workflow has 22 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Anthropic Chat Model, Postgres, Gmail and Slack.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Workflow Configuration (Edit Fields (Set)): sets 3 fields: riskThreshold, alertRecipients, slackChannel
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Clause Extraction Agent (AI Agent): runs an AI agent, with model: Claude 3.5 Model; output parser: Clause Parser
- Risk Assessment Agent (AI Agent): runs an AI agent, with model: Claude 3.5 Model; output parser: Risk Parser
- Obligation Extraction Agent (AI Agent): runs an AI agent, with model: Claude 3.5 Model; output parser: Obligation Parser
- Executive Summary Agent (AI Agent): runs an AI agent, with model: Claude 3.5 Model; output parser: Summary Parser
- Merge: merges the data from its input branches
- Calculate Risk Score (Code): runs custom JavaScript code
- Prepare Contract Data (Edit Fields (Set)): sets 18 fields: contract_id, contract_name, contract_type…
- Insert Contract (Postgres): uses Postgres
…plus 6 more steps. See the full node list below.
Services it uses
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.
Nodes used (12)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Slack
n8n-nodes-base.slack
From the author
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…