Back to Alchemy
Alchemy RecipeIntermediateworkflow

Legal brief and client cost estimate generation from case documents

A partner at a mid-sized law firm hands you a stack of case files on Monday morning. By Wednesday, the client wants a brief summary of their matter, an estimate of legal fees, and a timeline. Your associate spends 6 hours reading, highlighting, and composing the brief in Word. Another 2 hours goes into costing out the work based on complexity and billable rates. By Thursday afternoon, you've got the documents, but you've also burned through 8 billable hours on work that's largely extractive, not strategic. Now multiply that by 15 cases a month. This is where the friction lives for most law firms. The raw materials for client briefs and cost estimates already exist in your case files. The work of assembling them is rote. Yet it consumes partner time and delays client communications because the process relies on careful reading followed by manual synthesis and writing. The solution is to build an automated workflow that reads your PDFs, extracts the essential facts, generates a professional client brief, and produces a cost estimate based on configurable rules. You hand off a case file; the system returns a draft brief and fee projection ready for partner review. No manual transcription. No re-reading. Just data extraction, structured synthesis, and output ready to send. For more on this, see Document Writing and Editing Faster: Using Dictation and .... 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.

The Automated Workflow

You'll need three layers for this to work: intake and analysis (reading the PDFs), content generation (writing the brief and estimate), and orchestration (gluing everything together). We'll use n8n as the orchestration backbone because it offers solid webhook support and integrates cleanly with all the tools we need. The flow goes like this: 1. A case PDF lands in your intake folder (or you trigger the workflow manually via a webhook).

  1. Chat With PDF by Copilot.us reads the document and extracts key case facts, parties, claims, and complexity signals.

  2. The extracted data gets passed to Copy.ai, which generates a professional client brief and executive summary.

  3. QuillBot refines the language to match your firm's tone and style.

  4. Smmry condenses the brief further into a one-page executive summary for the client email.

  5. Based on complexity scores extracted in step 2, a cost estimate is calculated (you define the rate tables).

  6. Both documents land in a specified folder or are emailed to the assigned partner. Let me walk you through the n8n configuration. Setting up the intake trigger:

Webhook node:
- Listen on POST /case-intake
- Accept JSON payload with case_file_path and assigned_partner_email
- Extract these values for downstream nodes

Create a simple webhook endpoint that accepts a JSON payload:

json
{ "case_file_path": "s3://your-bucket/case-files/Smith-v-Jones.pdf", "assigned_partner_email": "partner@firm.com", "matter_id": "2026-001-SJ"
}

Step 1: Extract facts from the PDF with Chat With PDF

Chat With PDF integrates via API. You'll prompt it to extract structured data:

POST https://api.chatwithpdf.com/v1/documents/analyse
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json { "document_url": "s3://your-bucket/case-files/Smith-v-Jones.pdf", "prompt": "Extract in JSON format: case_name, parties, jurisdiction, claims, key_facts, complexity_score (1-10), estimated_hours_per_claim. Be precise."
}

The response gives you structured JSON like:

json
{ "case_name": "Smith v. Jones Industries Ltd", "parties": ["Smith, John (Plaintiff)", "Jones Industries Ltd (Defendant)"], "jurisdiction": "High Court of Justice, Queen's Bench Division", "claims": ["Breach of contract", "Negligence", "Unjust enrichment"], "key_facts": ["Contract dated 15 March 2023", "Failure to deliver materials 12 July 2024", "Damages estimated £85,000"], "complexity_score": 7, "estimated_hours_per_claim": {"Breach of contract": 40, "Negligence": 35, "Unjust enrichment": 20}
}

In n8n, add an HTTP node set to POST, paste the endpoint and headers, and map the case file URL from your webhook payload.

Step 2: Generate the client brief with Copy.ai

Copy.ai has a content API. Use the extracted facts to prompt a brief generation:

POST https://api.copy.ai/v1/generate
Authorization: Bearer COPY_AI_API_KEY
Content-Type: application/json { "prompt": "Write a professional legal brief for a client (200-300 words) summarising the following case. Include parties, jurisdiction, claims, key facts, and next steps. Tone: formal but accessible.\n\nCase Name: {{case_name}}\nParties: {{parties}}\nClaims: {{claims}}\nKey Facts: {{key_facts}}", "model": "gpt-4o", "max_tokens": 500
}

In n8n, map the extracted JSON fields into the prompt using expressions like {{$json.case_name}}. Copy.ai returns the generated brief as plain text.

Step 3: Refine tone with QuillBot

QuillBot's API allows paraphrasing and tone adjustment. Feed the brief text:

POST https://api.quillbot.com/data/textEditorApi
Authorization: Bearer QUILLBOT_API_KEY
Content-Type: application/json { "text": "{{brief_from_copy_ai}}", "intensity": "medium", "language": "en_GB"
}

QuillBot returns a refined version. This step ensures consistency with your firm's voice.

Step 4: Create executive summary with Smmry

Smmry specialises in concise summaries. Pass the refined brief:

POST https://api.smmry.com/SM_API_KEY
Content-Type: application/json { "sm_api_input": "{{refined_brief_from_quillbot}}", "sm_length": 5
}

Set sm_length to 5 for a very tight summary (roughly 40% of original length). You get back a punchy one-page executive summary.

Step 5: Calculate cost estimate

This doesn't require an external API. Use n8n's function node to build a cost table:

javascript
const complexity = $json.extracted_facts.complexity_score;
const hourlyRate = 250; // £ per hour
const claims = $json.extracted_facts.estimated_hours_per_claim; let totalHours = 0;
let claimBreakdown = {}; for (const [claim, hours] of Object.entries(claims)) { const adjustedHours = hours * (1 + (complexity - 5) * 0.05); claimBreakdown[claim] = { hours: Math.round(adjustedHours), cost: Math.round(adjustedHours * hourlyRate) }; totalHours += adjustedHours;
} const totalCost = Math.round(totalHours * hourlyRate);
const contingencyBuffer = Math.round(totalCost * 0.15); return { claim_breakdown: claimBreakdown, total_hours: Math.round(totalHours), hourly_rate: hourlyRate, subtotal: totalCost, contingency_buffer_15_percent: contingencyBuffer, estimated_total_fee: totalCost + contingencyBuffer
};

This function adjusts hours based on complexity and produces a structured cost estimate.

Step 6: Assemble and deliver

Use n8n's Gmail or Slack node to send both the brief and cost estimate. Or write both to a Google Drive folder as formatted documents. For email delivery:

Gmail node:
To: {{assigned_partner_email}}
Subject: Case Brief & Cost Estimate - {{matter_id}} - {{case_name}}
Body: "Please see attached brief and cost estimate for review and client approval."
Attachments: - brief.txt (from Copy.ai + QuillBot) - executive_summary.txt (from Smmry) - cost_estimate.json (from function node)

Alternatively, use Make.com's Google Docs module to create a formatted template document and populate it with the data.

The Manual Alternative

If your firm prefers tighter control or needs to review cases before brief generation, you can trigger each step individually. Read the PDF yourself in Chat With PDF, copy the extracted facts into a spreadsheet, then run Copy.ai and QuillBot as standalone tools in your browser. This takes longer but gives you full visibility into what the system extracts before it generates client-facing content. You might do this for high-stakes matters or when the file contains sensitive information that you want to validate before automation.

Pro Tips

Monitor rate limits.

Chat With PDF and Copy.ai both have per-minute request limits on their APIs.

If you're processing more than 5-10 cases daily, you'll need to upgrade to higher-tier plans or add delays between requests using n8n's delay nodes. Test with 1-2 cases first.

Validate complexity scoring.

The complexity score from Chat With PDF drives your cost estimates. Run the first 10 cases through the full workflow, then have a partner review whether the estimated hours match actual timesheets. Adjust the complexity multiplier in your function node based on this feedback.

Handle PDFs that fail extraction.

Some scanned documents or image-heavy files won't parse cleanly. Add error handling in n8n so that if Chat With PDF returns fewer than 3 key facts, the workflow pauses and sends you a notification instead of generating an incorrect brief. Use n8n's conditional nodes to check response quality.

Customise your cost tables.

Different practice areas have different hourly rates. Instead of hard-coding £250/hour, read the hourly rate from a spreadsheet based on the assigned partner's practice group. Store this in a Google Sheet and query it in your function node.

Reuse briefs for multiple purposes.

Once you've generated a client brief, store it in a knowledge base or CRM linked to the matter ID. You can pull it into future correspondence or discovery requests without re-reading the original file.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat With PDF by Copilot.usProfessional (500 PDFs/month)£25–50Scales with document volume; includes API access
Copy.aiBusiness (20,000 credits/month)£49Sufficient for ~200 brief generations; credits roll over
QuillBotPremium API£180–300Per-user or team licensing; includes tone adjustments
SmmryStandard API tier£15–30Per-10,000 API calls; very affordable
n8nSelf-hosted or Cloud (Pro)£0 or £20Cloud Pro covers up to 200,000 executions/month; self-hosted is free
Make (alternative to n8n)Team plan£99Covers unlimited scenarios and 10,000 operations/month
Google Drive (for output storage)Workspace Business Standard£13.50/userBundled storage and collaborative editing