Back to Alchemy
Alchemy RecipeIntermediateautomation

Legal contract extraction and compliance checklist generation

Legal teams spend weeks on contract review work that is fundamentally routine. You receive a vendor agreement, a client NDA, a partnership contract, or a service level agreement. Someone must read it, highlight the key obligations, extract payment terms, identify liability caps, note renewal dates, flag non-standard clauses, and compile a compliance checklist. This work is necessary but crushes productivity. It delays deal closure and pulls senior lawyers away from negotiation and strategy. The problem compounds across deal volume. A mid-market company might process 50 to 100 contracts annually. At an average of 2 to 4 hours per contract for extraction and compliance mapping, that is 100 to 400 lost billable hours. Worse still, manual extraction introduces inconsistency. One reviewer might miss a clause that another flags immediately. Risk goes undetected until it surfaces as a problem. Automation can collapse this timeframe from hours to minutes whilst improving consistency. By routing contracts through a purpose-built extraction pipeline, you extract terms once, generate compliance checklists automatically, and store structured data in a format your team can action immediately. This post walks through a zero-handoff workflow that turns a PDF contract into a compliance report without human intervention between steps. For more on this, see Legal contract review and client summary document generation.

The Automated Workflow

The workflow sits on n8n, an open-source orchestration platform that integrates tightly with document processing, language models, and data storage. n8n offers better control over LLM routing than Zapier and does not lock you into proprietary nodes like Make does. For this process, you will use four connected stages: document ingestion, contract analysis, checklist generation, and structured output.

Stage 1: Document Ingestion and Triggering

Set up an n8n webhook that accepts PDF files via a multipart form upload. This webhook triggers whenever a contract lands in a designated folder (via a cloud storage connector) or when someone submits a form. The webhook receives the PDF binary and stores it temporarily in n8n's internal file storage.

POST /webhook/contract-intake
Content-Type: multipart/form-data { "file": "<binary PDF data>", "contract_name": "vendor_agreement_acme.pdf", "contract_type": "vendor_services", "company_name": "ACME Corp"
}

Once the file arrives, pass it directly to Chat With PDF by Copilot.us. This tool converts the PDF into a queryable document object that you can interact with via API. Copilot.us exposes a REST endpoint that accepts the file and returns a document ID.

POST https://api.copilot.us/v1/documents/upload
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data { "file": "<binary PDF data>"
}

The response contains a document_id. Store this in an n8n variable; you will use it for all subsequent queries against that contract.

json
{ "document_id": "doc_abc123def456", "filename": "vendor_agreement_acme.pdf", "status": "ready"
}

Stage 2: Contract Analysis with Structured Queries

With the document uploaded, you now run a series of structured queries against it. Rather than asking Chat With PDF a loose question like "tell me about payment terms," you ask precise questions designed to extract specific contract obligations. Build a loop in n8n that executes five queries sequentially. Each query calls the Chat With PDF API with a specific prompt. For example:

POST https://api.copilot.us/v1/documents/{document_id}/query
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json { "query": "List all payment terms including amounts, due dates, and invoicing conditions. Format as JSON with keys: amount, currency, due_date, payment_method, late_payment_penalty.", "response_format": "json"
}

Run similar queries for: - Liability and indemnification clauses with caps and exclusions

  • Term duration, renewal conditions, and termination triggers
  • Data protection and confidentiality obligations
  • Dispute resolution and governing law Each query returns a JSON object. n8n stores these responses in a structured array. If Chat With PDF cannot find information for a particular query, it returns an empty object or null; you will handle this in the validation step.

Stage 3: Checklist Generation with Claude

Pass the extracted contract data to Claude Opus 4.6 via the Anthropic API. Claude receives the contract excerpt or summarised terms and generates a compliance checklist tailored to your company's risk profile. The prompt instructs Claude to produce a structured checklist with priority levels and action owners.

POST https://api.anthropic.com/v1/messages
Authorization: x-api-key YOUR_ANTHROPIC_KEY
Content-Type: application/json { "model": "claude-opus-4.6", "max_tokens": 2000, "system": "You are a legal compliance specialist. Generate a checklist of compliance actions and risks based on the extracted contract terms provided. Output as JSON with keys: item, priority (high/medium/low), description, action_required, owner.", "messages": [ { "role": "user", "content": "Contract: Vendor Services Agreement with ACME Corp. Extracted terms: [payment terms, liability clauses, confidentiality obligations]. Generate a compliance checklist for an in-house legal team." } ]
}

Claude returns a structured JSON object containing the checklist items. This is the raw compliance output before any polish.

Stage 4: Paraphrasing and Finalisation

Pass the checklist items through QuillBot to standardise language and ensure clarity. This step removes jargon and produces checklist language that non-lawyers can understand and action. n8n calls QuillBot's API for each checklist item.

POST https://api.quillbot.com/v1/paraphrase
Authorization: Bearer YOUR_QUILLBOT_KEY
Content-Type: application/json { "text": "Ensure that the vendor's liability cap does not exceed annual fees and that indemnification covers third-party IP claims.", "formality": "formal", "tone": "professional"
}

Collect the paraphrased items into a final output document.

Stage 5: Storage and Notification

Store the final structured output in a Google Sheet, Airtable base, or your internal database. n8n's integration nodes support both. Include columns for contract name, extraction date, key obligations, compliance checklist, priority ratings, and action owner. Send a notification to your legal team via Slack or email with a direct link to the stored record and a summary of high-priority items.

json
{ "contract_name": "vendor_agreement_acme.pdf", "extraction_date": "2026-03-15T10:30:00Z", "payment_terms": { "amount": 50000, "currency": "GBP", "due_date": "Net 30" }, "liability_cap": "Annual fees", "compliance_items": [ { "item": "Review IP indemnification scope", "priority": "high", "owner": "General Counsel" } ]
}

The entire flow from PDF upload to stored checklist takes 3 to 5 minutes depending on contract length and model response time.

The Manual Alternative

If you prefer to avoid code and orchestration platforms, you can run this workflow semi-manually using the web interfaces directly. Upload your PDF to Chat With PDF, copy the extracted text, paste it into Claude via your browser, copy the checklist output, refine it in QuillBot, and store the result in a spreadsheet. This approach trades automation time for control; you retain the option to edit Claude's output before it locks into your system. Many teams find this balance appropriate if they process fewer than 10 contracts monthly.

Pro Tips

Rate Limits and Batching

Chat With PDF and Anthropic both enforce rate limits.

If you are processing multiple contracts, configure n8n's queue node to space requests by 5 to 10 seconds. This prevents throttling and maintains reliability.

Error Handling for Incomplete Extraction

Some contracts contain images, scanned pages, or unusual layouts that cause Chat With PDF to return incomplete results. Build a validation step into your n8n workflow that flags any query returning fewer than 50 characters. Route these contracts to a human review queue rather than generating a false checklist.

Cost Optimisation with Smaller Models

For straightforward vendor agreements, consider routing to Claude Sonnet 4.6 instead of Opus 4.6. Sonnet costs 60% less and handles extraction-style tasks equally well. Reserve Opus for complex multi-party agreements or contracts with non-standard language.

Reusing Document IDs

Chat With PDF keeps uploaded documents in its system for 30 days. If you need to re-query a contract (for instance, to extract additional obligations), reuse the document_id rather than re-uploading. This cuts API calls and cost.

Secure Handling of Confidential Data

Use Okara AI as an alternative to Chat With PDF if your contracts contain highly sensitive information. Okara encrypts documents end-to-end and does not retain copies after processing. The workflow remains identical; swap the API endpoint and credentials.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat With PDF (Copilot.us)Pro£25–50Per-document upload; ~£0.50 per contract at typical volume
Anthropic API (Claude Opus 4.6)Pay-as-you-go£20–60~£0.03 per 1,000 tokens; 500-token response per checklist
QuillBot APIPremium£15–30Per-word pricing; ~£5 per contract for paraphrasing
n8n (self-hosted)Open-source£0Or £30+ monthly for n8n Cloud if you prefer managed hosting
Slack notificationsFree or Pro£0–120Free tier sufficient for notification delivery
Total per contract,~£2–5At 100 contracts per year, roughly £200–500 annual spend