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.