Explain contract PDFs and flag risky clauses with Gemini and Gmail

Go to Workflow
0 views
Built by Oka Hironobu Oka Hironobu
Created on July 23, 2026

Description

Quick Overview
This workflow collects a contract PDF via an n8n form, extracts its text, uses Google Gemini to generate a structured plain-language review with risk flags, logs the results to Google Sheets, and emails the requester a different summary based on the detected risk level.

How it works
Receives a contract PDF, document type, and optional concern through an n8n Form trigger.
Extracts selectable text from the uploaded PDF and stops with a Gmail email if the document appears unreadable (for example, a scanned PDF).
Sends the extracted contract text and the user’s concern to Google Gemini to produce a structured plain-language summary, risk level, obligations, key dates, costs, risky clauses with severity, and questions to ask.
Formats the structured Gemini output into email-friendly sections and calculates a risky-clause count.
Appends the review details to a Google Sheets spreadsheet for recordkeeping.
Routes by the risk level and sends the requester a tailored Gmail message (high: “do not sign yet”, medium: “worth a closer look”, low: plain summary, otherwise: generic summary), and sends a failure email if the AI review errors.

Setup
Connect credentials for Google Gemini (PaLM) API, Gmail, and Google Sheets.
Select the target Google Sheets spreadsheet and sheet in the append step (for example, a sheet named “Contract Reviews”).
Publish the n8n form and share its URL so users can upload text-based PDFs (not scans) and provide their email, document type, and optional concern.

Nodes Used (6)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Google Sheets
n8n-nodes-base.googleSheets
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured