Alchemy RecipeAdvancedworkflow

Legal contract review and client summary document generation

Published

Contract review is a bottleneck in most legal workflows. A lawyer receives a PDF contract, reads it thoroughly, extracts key information, writes a summary, and then sends it to the client. Each step happens sequentially, with the lawyer as the manual link between tools. If you handle multiple contracts weekly, this process burns hours.......

The reality is that most contracts follow patterns. Clauses cluster around payment terms, liability, termination conditions, and renewal dates. An intelligent workflow can identify these sections, summarise them, and generate a client-friendly document without human intervention between steps. Your job shifts from doing the work to reviewing the output....... For more on this, see Automated legal document review and client summary genera.... For more on this, see Legal document analysis and contract summarisation.

This guide shows you how to wire together three tools into an automated pipeline that takes a PDF contract, extracts the important bits, summarises them, and generates a polished client summary document, all triggered by a single upload. No manual copying between tabs. No waiting for tools to load. One contract in; one summary document out.

The Automated Workflow

We will use Chat with PDF (by Copilotus) to extract contract sections, Resoomer AI to condense the text, and Wordsmith AI to polish the final document. The orchestration happens in n8n, which gives you the most flexibility for this job and costs nothing to self-host.

The workflow proceeds like this: a user uploads a PDF to a designated folder or sends it via email. n8n detects the file, passes it to Chat with PDF for analysis, routes the extracted data to Resoomer for summarisation, feeds the summary into Wordsmith for tone and formatting, and then saves the final document to Google Drive or another cloud storage service. No manual handoff between any step.

Why n8n Instead of Zapier or Make?

Zapier and Make work well for simple workflows, but this one requires conditional routing and data transformation. Chat with PDF returns unstructured text; you need to clean it before Resoomer can process it efficiently. n8n's JavaScript nodes let you write custom logic without leaving the platform. You can also self-host n8n on a cheap server, making the cost negligible if you run this workflow hundreds of times per month.

If you prefer a managed solution, Make (formerly Integromat) is your second choice. Zapier will struggle with the data transformation steps and will cost more in operations.

Step 1:

Set Up File Detection

The workflow starts when a contract lands in your system. You have three options: monitor a Google Drive folder, watch an email inbox, or accept uploads via a webhook.

We will use Google Drive. In n8n, create a trigger node that monitors a folder every 5 minutes.


Node: Google Drive (Trigger)
Type: Watch for File Changes
Folder ID: [Your folder ID, found in the URL]
Polling interval: 5 minutes
Filter: Only process files ending in .pdf

Copy the folder ID from the URL when you open the folder in Google Drive:


https://drive.google.com/drive/folders/1ABC2defGHIjklMNO3pqrStuVwxyz456
                                        ↑
                                   Folder ID

This trigger activates whenever a new PDF appears in that folder. n8n passes the file ID and metadata to the next node.

Step 2:

Download the PDF and Extract Text with Chat with PDF

Chat with PDF (Copilotus) accepts files via API. You need to upload the PDF, then query it with a prompt designed to extract contract essentials.

First, download the file from Google Drive using n8n's built-in Google Drive node:


Node: Google Drive (Download File)
File ID: {{ $node.GoogleDriveTrigger.data.id }}
Output: File Buffer

Next, set up authentication with Copilotus. Sign up at https://copilotus.com/, create an API key in your dashboard, and store it in n8n's credentials.

Now add an HTTP POST node to upload the PDF to Copilotus and receive an analysis:


Node: HTTP Request
Method: POST
URL: https://api.copilotus.com/v1/files/upload
Headers:
  Authorization: Bearer {{ $credentials.copilotus_api_key }}
  Content-Type: multipart/form-data

Body (Multipart):
  file: [File Buffer from Google Drive node]
  model: gpt-4
  prompt: Extract and list the following from this contract: 1) Parties involved, 2) Payment terms, 3) Liability clauses, 4) Termination conditions, 5) Renewal terms, 6) Confidentiality obligations, 7) Governing law. Format as JSON.

Copilotus processes the file asynchronously. The response includes a job ID. Store this for the next request:

{
  "job_id": "job_abc123def456",
  "status": "processing",
  "file_id": "file_xyz789"
}

Add a small delay node (3 seconds) to give Copilotus time to process, then add another HTTP POST to retrieve the results:


Node: HTTP Request (Retrieve Results)
Method: POST
URL: https://api.copilotus.com/v1/files/{{ $node.CopilotusUpload.data.file_id }}/analysis
Headers:
  Authorization: Bearer {{ $credentials.copilotus_api_key }}

Expected Response:
{
  "analysis": "Parties: ABC Corp and XYZ Ltd. Payment: Net 30 days...",
  "status": "complete"
}

The analysis output is raw text, often verbose. This is where step 3 comes in.

Step 3:

Condense with Resoomer AI

Resoomer specialises in text summarisation. It removes redundancy and tightens phrasing. Set up an HTTP POST to Resoomer's API:


Node: HTTP Request
Method: POST
URL: https://api.resoomer.com/api/summarize
Headers:
  Authorization: Bearer {{ $credentials.resoomer_api_key }}
  Content-Type: application/json

Body:
{
  "text": {{ $node.CopilotusRetrieve.data.analysis }},
  "language": "en",
  "summary_length": 300,
  "type": "general"
}

Resoomer returns a condensed version, typically 40-50% of the original length:

{
  "summary": "ABC Corp and XYZ Ltd entered into an agreement with payment due within 30 days of invoice...",
  "original_length": 1200,
  "summary_length": 450,
  "reduction_ratio": 62.5
}

The summary is now ready for final polishing.

Step 4:

Polish with Wordsmith AI

Wordsmith AI refines tone, fixes grammar, and formats the text for client delivery. It can rewrite summaries in plain language suitable for non-lawyers.

Set up another HTTP POST:


Node: HTTP Request
Method: POST
URL: https://api.wordsmith.ai/v1/refine
Headers:
  Authorization: Bearer {{ $credentials.wordsmith_api_key }}
  Content-Type: application/json

Body:
{
  "text": {{ $node.Resoomer.data.summary }},
  "tone": "professional_plain",
  "length": "preserve",
  "style_guide": "business_english",
  "output_format": "markdown"
}

Wordsmith returns polished text formatted in markdown, ready to convert to PDF or Word:

{
  "refined_text": "# Contract Summary: ABC Corp and XYZ Ltd\n\n

## Payment Terms\nInvoices are due within 30 days of receipt...",
  "tone_score": 8.2,
  "readability_score": 9.1
}

Step 5:

Save the Final Document

Create a new document in Google Drive, populate it with the refined summary, and save it in a client-facing folder:


Node: Google Drive (Create File)
Name: Contract_Summary_{{ $now.format('YYYY-MM-DD') }}_{{ original_filename }}
MIME Type: application/pdf (or application/vnd.google-apps.document)
Folder ID: {{ client_summaries_folder_id }}
Content: {{ $node.Wordsmith.data.refined_text }}

Optionally, add an email node to notify the client:


Node: Send Email
To: {{ client_email_address }}
Subject: Your Contract Summary is Ready
Body: Hi [Client Name],

Your contract summary is attached and ready for review. Please find the document linked below.

Link: [Google Drive share link]

Best regards,
[Your Name]

Complete Workflow Diagram

The data flow is linear:

  1. PDF uploaded to Google Drive → 2. Download file → 3. Upload to Copilotus → 4. Retrieve Copilotus analysis → 5. Send to Resoomer → 6. Polish with Wordsmith → 7. Save document to Google Drive → 8. Email client

No step waits for manual input. The entire process runs in 2-4 minutes per contract, depending on file size and API response times.

The Manual Alternative

If you prefer more control or want to review intermediate outputs, insert a manual approval step after step 4. Add a Slack notification that posts the Resoomer summary and asks you to approve or edit it before sending to Wordsmith.


Node: Slack (Send Message)
Channel: #contract-review
Message: "New contract extracted. Summary below. React with ✅ to proceed or edit in thread to modify."
Blocks:
  - Summary: {{ $node.Resoomer.data.summary }}

Then add a Slack trigger to listen for your reaction or a conditional branch based on your approval. This adds 5-10 minutes to the process but gives you a checkpoint to catch errors before they reach clients.

Alternatively, export the Resoomer output to a Google Doc, share it with a colleague, and resume the workflow once they comment "approved".

Pro Tips

1. Handle API Rate Limits Gracefully

Copilotus and Resoomer rate-limit free accounts to 10-20 requests per day. If you process multiple contracts, you will hit these limits. In n8n, add a retry node with exponential backoff:


Node: Error Handler
Type: Catch and Retry
Max Retries: 3
Wait Between Retries: 10, 20, 40 seconds

Also, add a queue node before sending requests to Copilotus. This ensures requests are spaced out and prevents spike-induced rate limiting.

2. Validate Extracted Data Before Summarising

Chat with PDF sometimes extracts incomplete or garbled text, especially from scanned PDFs. Add a JavaScript validation node after step 2:

// Validate Copilotus output
const analysis = $node.CopilotusRetrieve.data.analysis;

if (analysis.length < 200) {
  throw new Error("Extracted text is too short. PDF may be unreadable.");
}

if (!analysis.includes("party") && !analysis.includes("agreement")) {
  throw new Error("Extracted text does not look like a contract.");
}

return analysis;

If validation fails, send an alert to you asking to upload a clearer version of the PDF.

3. Store Extraction Results for Auditing

Legal work requires a paper trail. After each step, write the intermediate output to a database or log file. In n8n, add a PostgreSQL node after Resoomer:


Node: PostgreSQL
Query: INSERT INTO contract_analysis 
  (contract_name, extraction_time, analysis_text, summary_text, status) 
VALUES 
  ($1, now(), $2, $3, 'complete')
Parameters:
  - {{ original_filename }}
  - {{ $node.CopilotusRetrieve.data.analysis }}
  - {{ $node.Resoomer.data.summary }}

This gives you a searchable record of every contract processed and allows you to rerun steps without re-uploading files.

4. Reduce Costs by Batching Contracts

If you process contracts in batches (e.g., Monday mornings), modify the workflow to accept multiple PDFs at once. Instead of triggering on individual files, wait until a folder contains 10 PDFs, then process them sequentially. This qualifies you for bulk pricing discounts on most AI APIs.

5. Test with a Sample Contract First

Before automating your entire intake process, run the workflow manually on a test contract. Upload a dummy PDF, watch each step complete, and review the final summary for accuracy. Adjust prompts in step 2 if the extraction is too broad or too narrow. A 10-minute manual test now saves hours of troubleshooting later.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat with PDF (Copilotus)Pro£20100 files/month; overage £0.10 per file
Resoomer AIBusiness£15Unlimited summaries; faster processing
Wordsmith AIProfessional£25500 requests/month; custom tone settings
n8nSelf-Hosted (Free)£0Host on a £5/month server or use n8n Cloud (£20+)
Google Drive Storage100 GB Plan£2For storing contracts and summaries
Total£62/monthScales to handle 500+ contracts/month

If you use Zapier instead of n8n, add £50-100/month depending on task frequency. Make (Integromat) costs £10-25/month and sits between Zapier and n8n in terms of features and price.

You now have a fully automated legal workflow. The time savings compound quickly; if you review three contracts weekly, you reclaim roughly 3-4 hours per month. At typical billing rates, that is £300-500 in recovered time, far exceeding the software cost.

More Recipes