Skip to main content

Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts

Workflow preview

Workflow preview
100%
Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts preview
Open on n8n.io

1. Workflow Overview

Who it's for Legal, Procurement, and Compliance teams at mid size companies. ESN and agencies selling AI powered contract review as a service. How it works Upload a contract PDF through a rich form...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.formtrigger, n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.form, n8n-nodes-base.extractfromfile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ben daamer.

Original n8n.io source

1.1 Workflow description

Title
Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts
Workflow name
Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts

Who it's for

Legal, Procurement, and Compliance teams at mid-size companies. ESN and agencies selling AI-powered contract review as a service.

How it works

Upload a contract PDF through a rich form (with metadata: contract type, counterparty, department, submitter). The workflow first checks Supabase for duplicates to avoid re-analyzing the same contract. Then it runs a two-pass AI analysis: Pass 1 classifies the contract (type, parties, dates, jurisdiction), Pass 2 performs deep risk analysis (clause-by-clause risk levels, missing clauses, obligations, negotiation points, compliance flags). Results are scored 0–100 with risk levels (CRITICAL / HIGH / MEDIUM / LOW). A structured report is generated as both Slack Block Kit (rich formatting) and HTML email. High-risk contracts trigger a Slack alert with full blocks and an email report to the submitter. Low-risk contracts get a summary Slack notification. All analyses are stored in Supabase with full metadata for audit. An Error Trigger sends admin notifications to a dedicated Slack channel.

How to set up

  1. Run the SQL from the "Supabase Schema" sticky note in Supabase SQL Editor.
  2. Set environment variables: SUPABASE_URL, SUPABASE_SERVICE_KEY.
  3. Add credentials in n8n: OpenAI (Header Auth), Supabase, Slack, Gmail (optional).
  4. Configure the Config node: RISK_THRESHOLD, SLACK_CHANNEL, ADMIN_SLACK_CHANNEL, AI_MODEL, ALERT_EMAIL, ENABLE_EMAIL, CONTRACT_LANG.
  5. Activate the workflow and share the Form URL with your team.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Supabase Schema

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Step 1 Ingest

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Step 2 Deduplicate

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Step 3 Extract

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Step 4 AI Analysis

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Step 5 Report Alert

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Error Handling Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Upload Contract

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 10 - Manual Test

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 11 - Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 12 - Check Duplicate

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Already Exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 14 - Already Analyzed

Type / Role
n8n-nodes-base.form - form
Config choices
Version 2.4

Block 15 - Has File?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 16 - Extract PDF Text

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 17 - Sample Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Prepare Text

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Parse Classification

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 20 - Parse Risk Analysis

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Build Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Supabase Insert

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 23 - High Risk?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 24 - Form Ending

Type / Role
n8n-nodes-base.form - form
Config choices
Version 2.4

Showing the first 24 of 31 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts
Complexity advanced
Nodes 31
Categories Document Extraction, AI Summarization
Author ben daamer
Published 04 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13875/13875.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Analyze contract risk from PDFs with OpenAI, Supabase and Slack alerts do?

Who it's for Legal, Procurement, and Compliance teams at mid size companies. ESN and agencies selling AI powered contract review as a service. How it works Upload a contract PDF through a rich form...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.