Review contract risks and route approvals with Google Drive, OpenAI, and Gmail
Ready for 3.0What this workflow does
This AI workflow has 15 nodes and runs on Google Drive events (file created). Along the way it connects Google Drive, OpenAI, Gmail and Google Sheets.
How it runs
Trigger: On Google Drive events (file created).
- Normalize File Metadata (Edit Fields (Set)): sets 5 fields: fileId, fileName, mimeType…
- Validate PDF Input (If): checks a condition and branches into true / false
- Download Contract PDF (Google Drive): download
- Extract Contract Text (Extract from File): extracts data from a file (pdf)
- Extract Contract Clauses (OpenAI): uses OpenAI
- Parse JSON (Code): runs custom JavaScript code
- Company Policy Engine (Code): runs custom JavaScript code
- Derive Approval Level (Switch): routes items into 2 branches
- Legal Approval Email (Gmail): send and wait for a reply
- Finance Approval Email (Gmail): send and wait for a reply
…plus 4 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
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 (10)
- Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Google Drive
n8n-nodes-base.googleDrive - Extract from File
n8n-nodes-base.extractFromFile - OpenAI
@n8n/n8n-nodes-langchain.openAi - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code
From the author
Quick overview This workflow monitors a Google Drive folder for new contract PDFs, extracts and analyzes their text with OpenAI, routes the contract for email-based approval via Gmail based on contract value and policy risks, and logs the final decision to…