Back to Alchemy
Alchemy RecipeIntermediateworkflow

Automated legal brief generation from court documents

24 March 2026

Introduction

Legal professionals spend countless hours extracting key information from court documents, summarising findings, and formatting briefs for clients or internal review. A typical workflow involves reading through PDFs, highlighting relevant sections, creating notes, condensing those notes into summaries, and then rewriting everything into a polished brief format. This manual process is not only time-consuming but also prone to human error and inconsistency.

The good news: you can automate nearly all of this work. By combining three AI tools with an orchestration platform, you can build a workflow that takes a court document, extracts its content, summarises it intelligently, and generates a formatted legal brief, all without touching a single file yourself. The entire process runs from trigger to completion with zero manual handoff.

This guide shows you exactly how to set this up using Chat-with-PDF-by-Copilotus for document interaction, Resoomer AI for intelligent summarisation, and Wordsmith AI for final brief generation. We'll walk through the configuration step by step, using real API examples so you can replicate this in your own environment.

The Automated Workflow

Overall Architecture

The workflow operates as a linear pipeline with four distinct stages: trigger, extraction, summarisation, and generation. A new court document triggers the process, Chat-with-PDF extracts content and answers specific legal questions about it, Resoomer condenses that information, and Wordsmith AI transforms it into a formal brief. All communication between tools happens via API calls orchestrated by your chosen platform.

For this workflow, we recommend starting with Zapier if you want the fastest setup with minimal technical overhead. If you need more granular control over transformations or want to avoid per-task charges, n8n is the better choice. Make (formerly Integromat) sits somewhere in the middle. For the most powerful option with full code execution, Claude Code offers native integration with all three tools, though it requires more manual triggering.

Step 1: Document Ingestion and Trigger

Your workflow begins when a new document arrives. This could be triggered by:

  • An email with an attachment lands in a designated inbox;
  • A file appears in a Google Drive or Dropbox folder;
  • A webhook fires from your document management system;
  • A manual submission through a form.

For this example, we'll assume documents arrive via email to a dedicated address, such as briefs@yourfirm.com. Set up your orchestration tool to monitor this inbox and trigger when an attachment matching certain criteria (PDF files, specific sender domains, or email subject keywords) arrives.

In Zapier, this trigger looks like this:


Trigger: Gmail - New Attachment
Conditions:
  - From: Contains "@court.gov" OR From Mailbox: "[Designated Inbox]"
  - Attachment filename: Ends with ".pdf"
Action: Save attachment and pass to next step

In n8n, you would use the Gmail node with similar configuration. In Make, use the Gmail Watch Attachments module.

Once triggered, the orchestration tool extracts the PDF file and stores its URL or base64 content in a variable for the next step.

Step 2: Content Extraction via Chat-with-PDF

Chat-with-PDF-by-Copilotus allows you to upload a PDF and ask specific questions about its contents. Rather than extracting raw text (which often returns messy, unstructured output from OCR or embedded PDFs), you ask the AI to identify and summarise key legal elements.

The API endpoint for Chat-with-PDF typically follows this pattern:


POST https://api.chatpdf.copilotus.ai/v1/documents/upload
Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: multipart/form-data

Body:
  file: [binary PDF data or file stream]
  description: "Court document for legal brief"

This returns a document ID. You then query it with:


POST https://api.chatpdf.copilotus.ai/v1/chat/completions
Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

Body:
{
  "document_id": "doc_abc123xyz",
  "messages": [
    {
      "role": "user",
      "content": "Extract the following from this court document: 1) Case name and number, 2) Judge name, 3) Parties involved, 4) Date of decision, 5) Key rulings, 6) Legal precedents cited. Format as structured JSON."
    }
  ],
  "model": "gpt-4",
  "temperature": 0.3
}

The low temperature (0.3) ensures consistent, factual extraction rather than creative interpretation. The API returns structured JSON containing all identified elements.

In your orchestration tool, this becomes a single step. In Zapier, you would use the Webhook (Catch Raw Request) action or a custom API call step. In n8n, use the HTTP Request node configured as above. In Make, use the HTTP node.

Store the JSON response in a variable, for example extracted_data. The output should look like:

{
  "case_name": "Smith v. State of California",
  "case_number": "2024-CV-001234",
  "judge": "Hon. Margaret Chen",
  "parties": ["John Smith (Plaintiff)", "State of California (Defendant)"],
  "decision_date": "2024-03-15",
  "key_rulings": [
    "Motion for summary judgment denied",
    "Case proceeds to trial on negligence claims"
  ],
  "precedents": [
    "Smith v. Jones (2020)",
    "Williams v. State (2019)"
  ]
}

Step 3: Intelligent Summarisation via Resoomer AI

With structured data extracted, you now pass it to Resoomer AI, which specialises in condensing longer texts into concise summaries. Rather than summarising the raw PDF (which might miss nuance), you summarise a comprehensive narrative built from the extracted data.

First, construct a formatted narrative from your extracted data. This acts as an intermediary representation:


Case Summary Input:
Case Name: Smith v. State of California (Case No. 2024-CV-001234)
Presiding Judge: Hon. Margaret Chen
Decision Date: March 15, 2024

Parties:
- Plaintiff: John Smith
- Defendant: State of California

Key Rulings:
1. Motion for summary judgment denied
2. Case proceeds to trial on negligence claims

Relevant Precedents:
- Smith v. Jones (2020)
- Williams v. State (2019)

[Include additional context from the extracted findings]

The Resoomer API endpoint is:


POST https://api.resoomer.com/api/summarize
Headers:
  Authorization: Bearer YOUR_RESOOMER_API_KEY
  Content-Type: application/json

Body:
{
  "text": "[Your formatted narrative above]",
  "length": 40,
  "language": "en"
}

The length parameter controls output length; 40 corresponds to approximately 40% of the input. Resoomer returns a condensed summary that captures the most important information whilst discarding redundancy.

Example output:


Smith v. State of California (2024-CV-001234): On 15 March 2024, Judge Margaret Chen denied the State's motion for summary judgment in this negligence case brought by John Smith. The decision allows the case to proceed to trial, building on precedent established in Smith v. Jones (2020) and Williams v. State (2019).

Store this in a variable, for example summarised_content.

Step 4: Brief Generation via Wordsmith AI

Wordsmith AI transforms this condensed summary into a polished, formally structured legal brief. It handles tone, structure, and formatting to produce client-ready output.

The Wordsmith API for brief generation:


POST https://api.wordsmith.ai/v1/generate/brief
Headers:
  Authorization: Bearer YOUR_WORDSMITH_API_KEY
  Content-Type: application/json

Body:
{
  "input_text": "[Your summarised_content variable]",
  "brief_type": "legal_decision_summary",
  "tone": "formal",
  "include_sections": [
    "case_header",
    "parties",
    "key_findings",
    "legal_precedents",
    "implications"
  ],
  "output_format": "markdown",
  "length": "medium"
}

Wordsmith returns a formatted brief ready for distribution:

## Case Information
**Case Name:** Smith v. State of California
**Case Number:** 2024-CV-001234
**Court:** [Jurisdiction]
**Presiding Judge:** Hon. Margaret Chen
**Decision Date:** 15 March 2024

## Parties
- **Plaintiff:** John Smith
- **Defendant:** State of California

## Key Findings
The defendant's motion for summary judgment has been denied, permitting the case to proceed to trial. This decision affirms the plaintiff's right to pursue negligence claims.

## Applicable Precedent
The court's ruling builds upon established precedent, particularly:
- Smith v. Jones (2020)
- Williams v. State (2019)

## Implications
This decision signals the court's willingness to allow factual disputes in negligence cases to proceed to trial rather than being resolved at the motion stage.

Step 5: Storage and Delivery

The final brief should be automatically stored and delivered. Common options include:

  • Save to Google Drive with a naming convention: Brief_[CaseName]_[Date].md;
  • Send via email to relevant team members;
  • Post to Slack in a designated channel;
  • Store in your document management system via API.

In Zapier, use the Google Drive action to create a file. In n8n, use the Google Drive node or a custom HTTP request to your DMS API. In Make, use the Google Drive module or a webhook to trigger downstream processes.

Complete Workflow Configuration Example (n8n)

Here is a minimal working configuration for n8n that ties everything together:


Workflow Nodes:

1. Email Trigger
   Type: Email (IMAP)
   Mailbox: briefs@yourfirm.com
   Polling: Every 5 minutes

2. Extract Attachment
   Type: Move Binary File
   Input: Email attachment
   Output: File URL or Base64

3. Chat-with-PDF Upload
   Type: HTTP Request
   Method: POST
   URL: https://api.chatpdf.copilotus.ai/v1/documents/upload
   Authentication: Bearer token
   Body: multipart/form-data with file

4. Chat-with-PDF Query
   Type: HTTP Request
   Method: POST
   URL: https://api.chatpdf.copilotus.ai/v1/chat/completions
   Body: { "document_id": "{{$node[\"Chat-with-PDF Upload\"].json.document_id}}", "messages": [...] }
   Output: Structured JSON stored as variable

5. Format Narrative
   Type: Set (Variables)
   Input: Combine extracted_data fields into markdown string

6. Resoomer Summarise
   Type: HTTP Request
   Method: POST
   URL: https://api.resoomer.com/api/summarize
   Body: { "text": "{{$node[\"Format Narrative\"].json.narrative}}", "length": 40 }
   Output: summarised_content

7. Wordsmith Generate Brief
   Type: HTTP Request
   Method: POST
   URL: https://api.wordsmith.ai/v1/generate/brief
   Body: { "input_text": "{{$node[\"Resoomer Summarise\"].json.summary}}", "brief_type": "legal_decision_summary", ... }
   Output: final_brief

8. Save to Google Drive
   Type: Google Drive
   Action: Create File
   Filename: Brief_{{$node[\"Chat-with-PDF Query\"].json.case_name}}_{{now.toFormat("yyyy-MM-dd")}}.md
   Content: {{$node[\"Wordsmith Generate Brief\"].json.output}}

9. Send Email Notification
   Type: Send Email (SMTP)
   To: legal-team@yourfirm.com
   Subject: Brief Generated: {{$node[\"Chat-with-PDF Query\"].json.case_name}}
   Body: Attached brief has been generated and saved.

Error handling should be added at each critical step. Use try-catch nodes or conditional logic to handle API failures, timeouts, or malformed documents. For example, if Chat-with-PDF fails to process a document, log the error and send an alert rather than proceeding with empty data.

The Manual Alternative

If your firm requires human review at any stage, you can introduce manual approval steps without losing the workflow's efficiency. After the Wordsmith brief is generated, add a manual review node that sends the draft brief to a designated attorney for approval. They review it in their email or a web form, approve or request revisions, and then the workflow either finalises the document or loops back to regenerate with feedback.

In Zapier, use the "Wait for Webhook" action or the built-in form feature. In n8n, add a manual execution node or webhook listener. In Make, use the Email Alert module combined with conditional routing based on the user's response.

This approach preserves quality control whilst still eliminating the busywork of extraction and initial formatting. Many firms find this hybrid model optimal during the first few weeks of implementation, moving to fully automated briefing once they gain confidence in the tool's output.

Pro Tips

1. Rate Limiting and API Quotas

Each tool enforces rate limits. Chat-with-PDF typically allows 100 requests per minute on paid plans; Resoomer allows 1000 requests per day; Wordsmith varies by plan. Before rolling out this workflow firm-wide, calculate your expected daily document volume and ensure your plan tiers accommodate it. If you exceed limits, orchestration tools will queue requests, but response time degrades significantly. Consider staggering document processing or batch-processing overnight if volume is high.

2. Temperature and Consistency

In the Chat-with-PDF prompt, we specified temperature: 0.3 for factual extraction. This is critical. A higher temperature (above 0.7) introduces randomness that makes the extracted data unreliable for legal work. Keep extraction and summarisation temperatures low (0.2-0.4), and only increase temperature for generative tasks where some variation is acceptable.

3. Handling Scanned vs. Digital PDFs

Court documents arrive in two forms: native digital PDFs (text-searchable) and scans (image-based). Chat-with-PDF handles both, but scans require OCR processing, which is slower and occasionally misses text in poor-quality scans. Add a validation step that checks the extracted data for completeness. If key fields (like case number or judge name) are missing or nonsensical, flag the document for manual review rather than allowing a corrupted brief to proceed.

4. Cost Optimisation

Zapier charges per task; if your document triggers five API calls, that's five tasks billed. n8n has no per-task charges but requires self-hosting or a paid cloud plan. For 50-100 documents monthly, Zapier is cost-effective. For 500+, n8n becomes cheaper. Claude Code incurs API charges only for actual API calls and has no per-workflow overhead, making it ideal for very high volumes but requiring more setup.

5. Customising Extraction by Document Type

Not all court documents have the same structure. A motion differs from a judgment, which differs from a settlement agreement. Instead of a single extraction prompt, create a conditional branch based on detected document type. Use Chat-with-PDF to classify the document first ("Is this a judgment, motion, settlement, or appeal?"), then use type-specific prompts to extract relevant fields. This prevents the workflow from looking for "judge name" in a motion that has no judge assigned yet.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat-with-PDF-by-CopilotusPro£40–60100 requests/min; allows ~3000 documents/month at 2 req/doc avg
Resoomer AIPremium£12–201000 requests/day; sufficient for most firms
Wordsmith AIProfessional£50–80Depends on output volume; ~10,000 briefs/month included
ZapierTeam£99/monthPay-as-you-go if under 100 tasks/month; Team plan for higher volume
n8nCloud Pro (or self-hosted)£50/month (or £0 + hosting)No per-task charges; better for high volume
MakePro£10–25Operations-based pricing; cheaper than Zapier for high volume
Claude CodePay-as-you-go£0 + API costsOnly pay for API calls; minimal overhead; no per-workflow charge
Google Drive StorageStandard£0–4.99100GB free; additional storage as needed

Total Estimated Cost: £160–260/month for a medium-volume firm using Zapier or Make, or £100–170/month using n8n with self-hosting. Per-document cost ranges from £0.15 to £0.40 depending on tool choices and document complexity.