See llms.txt for all machine-readable content.

Back to Templates

Review contracts and generate legal PDF reports with Google Drive, OpenAI, and Slack

Created by

Created by: Intuz  || intuz
Intuz

Last update

Last update 3 days ago

Categories

Share


Quick overview

This workflow monitors a Google Drive folder for new contract files, extracts text from uploaded PDFs, analyzes key clauses and risks with OpenAI, generates an attorney-ready PDF report via HTML-to-PDF conversion, saves the report back to Google Drive, moves the original contract, and notifies a Slack channel.

How it works

  1. Triggers every minute when a new file is created in a specified Google Drive folder.
  2. Downloads the new contract file from Google Drive and extracts the full text from the PDF.
  3. Sends the extracted contract text to OpenAI to produce structured JSON covering contract type, key terms, risk score, risks, missing clauses, and recommendations.
  4. Converts the structured OpenAI analysis into a professionally styled HTML attorney report using OpenAI.
  5. Converts the HTML report into a PDF file and saves it to a target Google Drive folder.
  6. Moves the original contract file into a separate “processed” Google Drive folder and posts a completion message with risk details and the report link to a Slack channel.

Setup

  1. Connect Google Drive OAuth credentials and set the intake folder to watch, the destination folder for reports, and the processed folder for moved contracts.
  2. Add an OpenAI API credential and confirm the selected model (gpt-4o-mini) is available for your account.
  3. Configure the HTML-to-PDF node (HTMLCSS to PDF) and ensure it is installed and available in your n8n instance.
  4. Connect Slack credentials and set the target channel (for example, #legal-reviews) for notifications.

Requirements

  • Before using this workflow, ensure you have access to the following services:

Required Integrations
-Google Drive Account
-OpenAI API
-Slack Workspace

Required Credentials
-Google Drive OAuth2 credentials
-OpenAI API credentials
-Slack API credentials

Required Inputs
-PDF contracts uploaded to a monitored Google Drive folder
-Access to a destination Google Drive folder for generated reports

Recommended Permissions
-Read access to incoming contract folders
-Write access to report output folders
-Permission to post messages to the configured Slack channel

Customization

  • This workflow can be customized to fit your organization's contract review process.

Review Criteria-Modify the AI review instructions to analyze:
-Legal risks
-Compiance requirements
-Vendor agreement
-Service contracts
-Employment agreements
-Procurement contracts
-NDAs

Risk Assessment Rules

Customize how the workflow evaluates:
-High-risk clauses
-Missing provisions
-Liability limitations
-Payment terms
-Termination conditions
-Data privacy obligations

Report Format

Adjust the generated report to include:
-Executive summaries
-Risk scores
-Clause-by-clause analysis
-Compliance findings
-Recommended actions
-Legal reviewer notes

Notifications

Customize Slack notifications by:
-Changing channels
-Adding stakeholders
-Including approval links
-Adding report summaries
-Triggering notifications only for high-risk contracts

Additional info

Connect with us:
Website: https://www.intuz.com/n8n-workflow-automation-templates
Email: [email protected]
LinkedIn: https://www.linkedin.com/company/intuz

For Custom Worflow Automation

https://www.intuz.com/get-started/