Analyze contract risk and red flags with OpenAI from a web form
Ready for 3.0What this workflow does
This AI workflow has 10 nodes and runs when someone submits an n8n form (“Contract & ToS Red-Flag Analyzer”). Along the way it connects OpenAI Chat Model.
How it runs
Trigger: When someone submits an n8n form (“Contract & ToS Red-Flag Analyzer”).
- Map Form Fields (Code): runs custom JavaScript code
- Long Enough? (If): checks a condition and branches into true / false
- Prepare Input (Code): runs custom JavaScript code
- Too Short - Error Response (n8n Form): shows the next form page
- Analyze Contract (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Risk Report Schema
- Build HTML Report (Code): runs custom JavaScript code
- Send Report (n8n Form): shows the next form page
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 (7)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - n8n Form
n8n-nodes-base.form - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
From the author
Quick overview This workflow collects pasted contract or terms-of-service text via an n8n Form and uses OpenAI to generate a structured risk score, plain-English summary, and flagged clauses, then returns a color-coded HTML report to the submitter. How it…