Review contract clauses against your playbook with Google Drive and Claude

Go to Workflow
0 views
Built by SEVENEDGE SEVENEDGE
Created on August 26, 2026

Description

Quick overview
This workflow watches a Google Drive folder for new contracts, uses Anthropic Claude to extract and assess clauses against your legal playbook and hard limits, then aggregates a verdict, optionally pauses for a human decision, logs the results to Google Sheets, and sends notifications via a webhook.

How it works
Triggers when a new file is created in a specific Google Drive folder (or runs manually with a provided file ID).
Downloads the contract from Google Drive, converts it to Base64, and sends it to the Anthropic Messages API to extract a structured list of clauses.
Splits the extracted clauses into small batches and uses Anthropic Claude to assess each clause against your playbook, producing severity, explanations, and suggested redlines.
Aggregates all clause findings into a single review, deterministically sets a verdict (with hard-limit breaches forcing a “DO_NOT_SIGN”), and decides whether human review is required.
If escalation is needed, posts decision links to your webhook endpoint and waits for a reviewer to proceed, request redlining, or reject; otherwise it auto-clears the contract.
Builds a severity-ordered report, appends the full review record to a Google Sheets log, and posts a completion notice to the same webhook.

Setup
Connect Google Drive credentials and set the folder to watch in the trigger (or set a test file ID for manual runs).
Add Anthropic access for both extraction and assessment: an HTTP Header Auth credential with x-api-key for the Anthropic Messages API request, and an Anthropic credential for the Claude assessment model.
Update the configuration values for ourSide, playbook, hardLimits, and (optionally) the Anthropic model name and clause batch size.
Connect Google Sheets credentials and select the target spreadsheet and sheet tab used as the review log.
Set notifyWebhookUrl to an endpoint (for example, Slack/Teams incoming webhook) that can receive the reviewer decision message and completion notice.

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
Code
n8n-nodes-base.code
Google Drive
n8n-nodes-base.googleDrive
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured