Alchemy RecipeIntermediateworkflow

Automated legal brief generation from court documents

Published

Legal briefs are repetitive work. A lawyer receives a court document, reads it, summarises the key facts and holdings, then formats everything into a structured brief. Most of that labour is mechanical: extracting information, condensing it, and arranging it in a standard format. Yet many firms still handle this manually, burning billable hours on work that automation can do in minutes.

The core problem is fragmentation. Your PDF sits in email. You copy text into a separate summarisation tool. You paste the summary into a word processor. You format it manually. Each handoff introduces delays and risks losing context. What if you could automate the entire chain: ingest the document, extract key information, generate a structured brief, and deliver it formatted and ready to review?............ For more on this, see Automated legal document review and client summary genera.... For more on this, see Legal contract review and client summary document generation.

This workflow combines three specialised AI tools through an orchestration platform to handle the complete journey from raw court document to polished brief, with zero manual transfers between steps.

The Automated Workflow

Which Orchestration Tool to Choose

For this workflow, n8n is the best fit. It handles file uploads gracefully, supports webhook triggers, and manages longer execution times without timeout issues. Zapier works but caps text lengths and requires workarounds for large PDFs. Make is reliable but less transparent with its internal request routing. Claude Code gives you flexibility but requires more engineering if you want scheduling and error recovery.

We'll use n8n because it lets you see exactly what's flowing between each step, handle retries, and add conditional logic if needed.

Setting Up the Trigger

You need a reliable entry point. The simplest approach is a webhook that receives files via a form submission or direct HTTP POST. Create an n8n workflow and add a webhook node as your trigger.


POST /webhook/legal-brief-generator

Content-Type: multipart/form-data

file: <your PDF>
case_name: Smith v. Jones
jurisdiction: Federal District Court

When a PDF arrives at that webhook, n8n starts processing. Store the file in a temporary location (n8n's built-in file handling works fine for documents under 50MB).

Step 1: Extract Content with Chat-with-PDF-by-Copilotus

The first node reads your PDF and pulls out the essential information. Chat-with-PDF-by-Copilotus has a straightforward API. You send the PDF binary and a prompt, and it returns structured text.


POST https://api.copilotus.app/v1/chat

{
  "file": "<base64-encoded PDF>",
  "prompt": "Extract the following from this court document: 1. Case caption and court. 2. Date of decision. 3. Judge name. 4. Procedural history in 2-3 sentences. 5. Facts of the case in 4-5 sentences. 6. Legal issues presented. 7. Holding of the court. 8. Reasoning. 9. Dissents or concurrences if any. Format as JSON.",
  "api_key": "YOUR_API_KEY"
}

The API returns something like this:

{
  "extracted_content": {
    "case_caption": "Smith v. Jones, 123 F.3d 456 (2nd Cir. 2023)",
    "court": "United States Court of Appeals for the Second Circuit",
    "decision_date": "2023-06-15",
    "judge": "Judge Patricia Chen",
    "procedural_history": "The plaintiff filed suit in district court alleging breach of contract. The defendant moved to dismiss. The court denied the motion and allowed discovery to proceed.",
    "facts": "Smith and Jones entered a software licensing agreement in 2020. Smith claimed Jones failed to provide technical support as promised. Jones argued the contract was ambiguous regarding support obligations.",
    "legal_issues": "1. Whether the contract terms were unambiguous. 2. Whether Jones breached the duty to provide reasonable support.",
    "holding": "The court held that the contract language was ambiguous and that reasonable support was implied.",
    "reasoning": "Extrinsic evidence showed both parties understood support to be included. Industry standards support this interpretation.",
    "dissent": null
  }
}

In n8n, store this JSON output in a variable so the next node can access it.

Step 2: Summarise with Resoomer AI

You now have structured extracted content, but the sections are still verbose. Resoomer AI specialises in condensing longer text while preserving meaning. Use it to tighten the procedural history, facts, and reasoning.


POST https://api.resoomer.com/summarize

{
  "text": "The plaintiff filed suit in district court alleging breach of contract. The defendant moved to dismiss. The court denied the motion and allowed discovery to proceed.",
  "length": "short",
  "api_key": "YOUR_API_KEY"
}

Resoomer returns:

{
  "summary": "Plaintiff sued for breach of contract; defendant's motion to dismiss was denied and discovery proceeded."
}

In your n8n workflow, create a node that loops through each section of the extracted content (procedural history, facts, reasoning) and calls Resoomer. Combine the results back into your structured data.

The n8n configuration for this step looks like:


Node: "Summarise Sections"
Type: HTTP Request (POST)
URL: https://api.resoomer.com/summarize
Method: POST
Headers: 
  Content-Type: application/json
Body:
  {
    "text": "{{ $node['Extract Content'].json.extracted_content.facts }}",
    "length": "short",
    "api_key": "{{ $env.RESOOMER_API_KEY }}"
  }

Repeat this node for each section you want condensed. Store results in a new variable like {{ $node['Summarise Sections'].json.summary }}.

Step 3: Generate the Formatted Brief with Wordsmith AI

Now you have clean, condensed information. Wordsmith AI generates the final brief in your preferred format and style. This tool excels at composition and can enforce consistent structure.


POST https://api.wordsmith.ai/v2/generate

{
  "template": "legal_brief",
  "data": {
    "case_caption": "Smith v. Jones, 123 F.3d 456 (2nd Cir. 2023)",
    "court": "United States Court of Appeals for the Second Circuit",
    "decision_date": "2023-06-15",
    "judge": "Judge Patricia Chen",
    "procedural_history": "Plaintiff sued for breach of contract; defendant's motion to dismiss was denied and discovery proceeded.",
    "facts": "Smith and Jones licensed software in 2020. Smith alleged Jones failed to provide promised support. Jones claimed the contract was ambiguous on support obligations.",
    "legal_issues": ["Whether contract terms were unambiguous", "Whether Jones breached the support duty"],
    "holding": "The court held that the contract language was ambiguous and reasonable support was implied.",
    "reasoning": "Extrinsic evidence showed both parties understood support to be included; industry standards supported this interpretation.",
    "dissent": null
  },
  "output_format": "markdown",
  "style": "concise",
  "api_key": "YOUR_API_KEY"
}

Wordsmith returns formatted markdown:

**Smith v. Jones**, 123 F.3d 456 (2nd Cir. 2023)

**Court:** United States Court of Appeals for the Second Circuit  
**Date:** 15 June 2023  
**Judge:** Patricia Chen

## Procedural History

Plaintiff sued for breach of contract; defendant's motion to dismiss was denied and discovery proceeded.

## Facts

Smith and Jones licensed software in 2020. Smith alleged Jones failed to provide promised support. Jones claimed the contract was ambiguous on support obligations.

## Issues

1. Whether contract terms were unambiguous
2. Whether Jones breached the support duty

## Holding

The court held that the contract language was ambiguous and reasonable support was implied.

## Reasoning

Extrinsic evidence showed both parties understood support to be included; industry standards supported this interpretation.

In n8n, map your condensed data into the Wordsmith API call, retrieve the output, and store it.

Step 4: Deliver the Brief

The final step sends the completed brief to where you need it. Common destinations: email to the requesting lawyer, save to cloud storage (Google Drive, OneDrive, Dropbox), or POST to your internal case management system.

For email delivery, add an n8n Email node:


Node: "Email Brief"
Type: Send Email
To: {{ $node['Trigger'].json.recipient_email }}
Subject: Legal Brief: {{ $node['Extract Content'].json.extracted_content.case_caption }}
Body: {{ $node['Generate Brief'].json.brief_markdown }}
Attachments: 
  - Filename: brief.md
    Data: {{ $node['Generate Brief'].json.brief_markdown }}

For cloud storage, use n8n's Google Drive or Dropbox nodes to upload the markdown file.

Complete Workflow in n8n

Here's the full sequence of nodes:

  1. Webhook trigger receives PDF and metadata
  2. HTTP request to Chat-with-PDF-by-Copilotus extracts structured content
  3. Loop node iterates through sections and calls Resoomer API for summaries
  4. Merge node combines condensed sections back into a single object
  5. HTTP request to Wordsmith AI generates the final brief
  6. Email node sends the brief to the requesting user
  7. (Optional) Google Drive node saves a copy to a case folder

Each node passes its output to the next. If any API call fails, n8n's built-in retry logic kicks in (configurable: wait 1 minute, then retry up to 3 times). If retries exhaust, the workflow pauses and alerts you.

The Manual Alternative

If you prefer to stay in control at each stage, you can run these tools independently:

  1. Upload your PDF to Chat-with-PDF-by-Copilotus directly via its web interface and copy the extracted JSON.
  2. Paste each section into Resoomer's web app individually and copy the summaries.
  3. Paste the condensed data into Wordsmith AI's template editor and generate the brief.
  4. Download the brief and email or file it manually.

This takes roughly 15-20 minutes per document, depending on length and complexity. Automation reduces it to under 2 minutes and eliminates transcription errors. The trade-off is the initial setup time for n8n (1-2 hours).

Pro Tips

1. Handle API Rate Limits Gracefully

Chat-with-PDF-by-Copilotus throttles at 100 requests per hour on the free tier. If you process multiple briefs in bulk, add a delay node between requests in n8n. Right-click the node and set "Add delay between retries": 40 seconds. This spreads 100 PDFs across a full hour without triggering rate limits.


Node Settings:
Delay: 40 seconds
Between each execution

2. Build a Fallback for OCR Failures

If your PDF is scanned (image-based) rather than text-based, Chat-with-PDF-by-Copilotus may struggle. Add conditional logic: if the extracted content is empty or below 100 characters, your workflow could email an alert to a human reviewer. In n8n, use an "If" node:


Condition: {{ $node['Extract Content'].json.extracted_content.text.length < 100 }}
Then: Send email to legal_team@firm.com with subject "Manual Review Required: Scanned PDF"
Else: Continue to summarisation

3. Cost Optimisation: Batch Processing

Instead of calling Resoomer on every section, batch them. Resoomer charges per request. If you summarise procedural history, facts, and reasoning separately, that's 3 API calls per brief. If you concatenate all three into one request with section markers, that's 1 call. The output is nearly identical, and you save 66%.


Single request version:
{
  "text": "

## Procedural History\n...\n\n

## Facts\n...\n\n

## Reasoning\n...",
  "length": "short"
}

4. Validation Before Generation

Add a validation step before calling Wordsmith AI. Check that all required fields are populated. Create a simple Script node in n8n:

if (!$node['Extract Content'].json.extracted_content.case_caption) {
  throw new Error('Missing case caption. Cannot generate brief.');
}
if (!$node['Extract Content'].json.extracted_content.holding) {
  throw new Error('Missing holding. Cannot generate brief.');
}
return true;

This prevents malformed briefs and saves Wordsmith API credits.

5. Audit Trail and Version Control

Save every intermediate output to a log file. In n8n, add a Google Sheets append node after the final step:


Spreadsheet: Legal Briefs Log
Columns:
- Timestamp
- Case Caption
- Document URL
- Extraction Status
- Summary Status
- Brief Generated (Yes/No)
- Brief URL

This gives you a searchable record of every brief generated, useful for compliance and debugging.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat-with-PDF-by-CopilotusPro£151000 PDFs/month; £0.015 per additional PDF
Resoomer AIStandard£10500 summaries/month; £0.02 per additional
Wordsmith AICreator£251000 generations/month; £0.025 per additional
n8nCloud Pro£20/monthIncludes 50,000 workflow executions; suitable for ~500 briefs/month
n8n Storage (for logs/versions)Included in Cloud ProIncluded1GB storage sufficient for metadata and audit trails
Total£70/monthSupports up to 500 briefs monthly; marginal cost per brief ~£0.14 after tooling

If your firm generates 500 briefs per month, the cost is approximately £0.14 per brief plus overhead. Manual generation at 15 minutes per brief, at £0.50 per minute (accounting for lawyer time, benefits, overheads), costs roughly £7.50 per brief. Automation saves £7.36 per brief, or £3,680 monthly at scale.

More Recipes