Analyze Legal Documents with GPT & o4-mini plus Gmail & Google Sheets
Description
This workflow lets you upload a PDF document and automatically analyze it with AI. It extracts the text, summarizes the content, flags key clauses or risks, and then delivers the results via Gmail while also storing them in Google Sheets for tracking.
Itโs designed for legal, compliance, or contract review use cases, but can be adapted for any document analysis scenario. Test it here: PDF Document Assistant
๐น Instructions / Setup
Webhook Input
Upload a PDF document by sending it to the webhook URL.
Extract from File
The workflow extracts text from the uploaded PDF.
Pre-processing (Code Node)
Cleans and formats extracted text to remove unwanted line breaks or artifacts.
Basic LLM Chain (OpenAI)
Summarizes or restructures document content using OpenAI.
Adjust the prompt inside to fit your analysis needs (summary, risk flags, clause extraction).
Post-processing (Code Node)
Further structures the AI output into a clean format (JSON, HTML, or plain text).
AI Agent (OpenAI)
Runs deeper analysis, answers questions, and extracts insights.
Gmail
Sends the results to a recipient.
Configure Gmail credentials and set your recipient address.
Google Sheets
Appends results to a Google Sheet for record-keeping or audits.
Respond to Webhook
Sends a quick acknowledgment back to confirm the document was received.
๐น Credentials Needed
OpenAI API key (for Chat Model + Agent)
Gmail account (OAuth2)
Google Sheets account (OAuth2)
๐น Example Use Case
Upload a contract PDF โ workflow extracts clauses โ AI flags risky terms โ Gmail sends formatted summary โ results stored in Google Sheets.
Related Templates
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
๐ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments