Analyze contract risk from Google Drive PDFs with OpenAI, Claude, Gemini, Sheets and Gmail
Ready for 3.0What this workflow does
This AI workflow has 17 nodes and runs on Google Drive events (file created). Along the way it connects Google Drive, OpenAI Chat Model, Anthropic Chat Model and Google Gemini Chat Model and 2 more.
How it runs
Trigger: On Google Drive events (file created).
- Filter: keeps only the items that match a condition
- Set Processing Parameters (Edit Fields (Set)): sets 6 fields: aiProvider, googleSheetId, sheetTabName…
- Download PDF from Drive (Google Drive): download
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Prepare Text for Analysis (Code): runs custom JavaScript code
- Route by AI Provider (Switch): routes items into branches
- OpenAI Contract Analysis (Information Extractor): extracts structured fields from text with AI, with model: OpenAI GPT-4 Model
- Claude Contract Analysis (Information Extractor): extracts structured fields from text with AI, with model: Claude Sonnet Model
- Gemini Contract Analysis (Information Extractor): extracts structured fields from text with AI, with model: Gemini Chat Model
- Normalize AI Analysis (Code): runs custom JavaScript code
…plus 3 more steps. See the full node list below.
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 (14)
- Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Filter
n8n-nodes-base.filter - Edit Fields (Set)
n8n-nodes-base.set - Google Drive
n8n-nodes-base.googleDrive - Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Google Sheets
n8n-nodes-base.googleSheets - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow watches a Google Drive folder for new PDF contracts, extracts their text, analyzes them with OpenAI, Anthropic Claude, or Google Gemini to produce a structured risk assessment, logs the results to Google Sheets, and sends a Gmail…