# Analyze contract risk from PDFs with OpenAI and Supabase: n8n workflow

> Started by someone submitting a form, and works across Gmail, Slack and Supabase. 23 steps, 3 branches: large, and worth reading before you trust it with...

Source: https://millionrounds.com/workflow/analyze-contract-risk-from-pdfs-with-openai-and-supabase (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Analyze contract risk from PDFs with OpenAI and Supabase

Started by someone submitting a form, and works across Gmail, Slack and Supabase. 23 steps, 3 branches: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanalyze-contract-risk-from-pdfs-with-openai-and-supabase)

**23 steps** Large: read it before trusting it with anything live

**3** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 3 Logic 9 Service 11

The steps in the order they run, from what starts it.

- 1 **Upload Contract** Form trigger *Starts it*
- 2 **Manual Test** Manual trigger *Starts it*
- 3 **Error Trigger** Error trigger *Starts it*
- 4 **Config** Set *Logic*
- 5 **Slack Admin, Error** Slack *Service*
- 6 **Check Duplicate** Http Request *Service*
- 7 **Already Exists?** If *Logic*
- 8 **Already Analyzed** Form *Service*
- 9 **Has File?** If *Logic*
- 10 **Extract PDF Text** Extract From File *Service*
- 11 **Sample Data** Set *Logic*
- 12 **Prepare Text** Code *Logic*
- 13 **AI Pass 1 - Classify** Http Request *Service*
- 14 **Parse Classification** Code *Logic*
- 15 **AI Pass 2 - Deep Risk** Http Request *Service*
- 16 **Parse Risk Analysis** Code *Logic*
- 17 **Build Report** Code *Logic*
- 18 **Supabase Insert** Supabase *Service*
- 19 **High Risk?** If *Logic*
- 20 **Slack Alert - High Risk** Slack *Service*
- 21 **Gmail - Risk Report** Gmail *Service*
- 22 **Slack Summary - Low Risk** Slack *Service*
- 23 **Form Ending** Form *Service*

## How it's built

- **Starts on:** Someone submitting a form
- **Steps:** 23, with 3 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Slack, Supabase
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Slack and Supabase accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone submitting a form.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 23 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 23 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanalyze-contract-risk-from-pdfs-with-openai-and-supabase)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Back up your n8n workflows to GitHub with Slack** 23 steps · GitHub, Slack](https://millionrounds.com/workflow/back-up-your-n8n-workflows-to-github-with-slack)
- [**Build an event-driven pub/sub bus with HTTP and Slack** 23 steps · Slack](https://millionrounds.com/workflow/build-an-event-driven-pub-sub-bus-with-http-and-slack)
- [**Monitor customer risk and AI feedback with PostgreSQL** 23 steps · Discord, Gmail](https://millionrounds.com/workflow/monitor-customer-risk-and-ai-feedback-with-postgresql)
- [**Trello task management with Telegram and Supabase** 23 steps · Supabase, Telegram](https://millionrounds.com/workflow/trello-task-management-with-telegram-and-supabase)
- [**URL and IP lookups with Greynoise and VirusTotal** 23 steps · Gmail, Slack](https://millionrounds.com/workflow/url-and-ip-lookups-with-greynoise-and-virustotal)
- [**User authentication system with Gmail and Postgres** 23 steps · Gmail, Postgres](https://millionrounds.com/workflow/user-authentication-system-with-gmail-and-postgres)
