Templates / Analyze legal contract risk with Google Gemini hybrid RAG and Supabase

Analyze legal contract risk with Google Gemini hybrid RAG and Supabase

Ready for 3.0

by Divyanshu Gupta ✓ · 210 views · created 2026-04-26 · Document Extraction, AI RAG

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 26 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Google Gemini, Google Gemini Chat Model and Supabase. It also calls generativelanguage.googleapis.com and kwfhbdrqlfnzlixvbpsl.supabase.co over HTTP.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Merge: merges the data from its input branches
  2. get job id (Edit Fields (Set)): sets 1 field: job_id
  3. Clause Splitter (Code): runs custom JavaScript code
  4. Extract from File: extracts data from a file (pdf)
  5. Classify Clause Type (Google Gemini): uses Google Gemini
  6. extract JSON from Gemini response (Code): runs custom JavaScript code
  7. Prepare Embedding Request (Code): runs custom JavaScript code
  8. Generate Embedding (HTTP Request): calls generativelanguage.googleapis.com (POST)
  9. Extract Embedding (Code): runs custom JavaScript code
  10. Wait: pauses before continuing

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

Services it uses

Google GeminiGoogle Gemini Chat ModelSupabase

HTTP calls to: generativelanguage.googleapis.com, kwfhbdrqlfnzlixvbpsl.supabase.co

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 (11)

From the author

🚀 What This Workflow Does This workflow transforms any PDF legal contract into a detailed AI-powered risk report — in under 5 minutes. Upload a contract, and the system automatically splits it into clauses, analyses each one using Hybrid RAG (semantic +…

Excerpt from Divyanshu Gupta'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.