Document management and automation
Legal Document Automation: From Template to Draft
By Lucerna LawPublished 7 min read
Legal document automation turns a document the firm drafts again and again into a template. The template marks what changes from one client to the next, such as names, dates, amounts and optional clauses, and the software fills those in from answers or from the matter. The lawyer reviews a draft instead of retyping one.
What is legal document automation?
Legal document automation is software that produces a first draft of a standard document from a template and a set of facts. The template holds the firm's approved language. The facts come from a questionnaire, a spreadsheet or the matter's records. The output is a Word or PDF document that a lawyer then reviews, edits and signs.
The documents that repay automation share a pattern. They are drafted often, their structure rarely changes, and the differences between one version and the next can be listed: engagement letters, simple wills, powers of attorney, demand letters, notices, standard pleadings, nondisclosure agreements and closing checklists. A document that is rewritten from first principles each time, such as a merger agreement or an appellate brief, gains less.
Automation is not the same as AI drafting. A template produces the same words every time the same answers go in, and a person can read the template to see exactly what it will say. A language model writes new text each time and cannot be read in advance. The two can work together, but they are checked in different ways, which the section on AI drafting below takes up.
Automation also sits next to the firm's document system, not inside it. The guide to legal document management software covers where the finished drafts are filed.
Template variables and conditions: the parts of an automated document
An automated template is ordinary text with markers in it. A variable is replaced by a value, such as the client's name. A condition keeps or drops a passage depending on an answer, such as a joint-client clause. A repeat writes a passage once per item in a list, such as each child named in a will.
The open-source tool docassemble shows the markers plainly. Its documentation explains that one way to build a document is to prepare a template in DOCX format and use the Jinja2 template language to plug in variables, and gives an example in which {{ user }} becomes the person's name and an {% if %} block includes a sentence only when a condition holds. The same page describes a second method, filling in fields in a PDF prepared in Adobe Acrobat Pro or similar software. Comparing its methods, the page says the DOCX and PDF methods give more direct, WYSIWYG control over document formatting.
Commercial products hide the syntax behind menus, but the same three parts are underneath. When a firm evaluates one, the useful question is not how the editor looks but what the template can express:
- Variables. Text, dates, numbers and currency, with formatting rules such as a date written out in words.
- Conditions. Include or omit a clause, and nest one condition inside another.
- Repeats. One passage per party, property, child or payment.
- Computed values. A deadline counted from a date, a total from a list, a pronoun from a person's details.
- Shared answers. A client's name entered once and used across every document in a set.
A template that cannot express a firm's real variations ends up producing drafts that are edited by hand, which brings back the errors automation was meant to remove.
Mail merge or document assembly: which does a firm need?
Mail merge fills one template from a list, one document per row. Document assembly asks a series of questions, applies rules to the answers, and builds a document whose content depends on them. A firm sending the same notice to two hundred people needs mail merge. A firm drafting a will needs assembly.
Microsoft describes mail merge as a way to create a batch of documents personalized for each recipient: a data source such as a list, spreadsheet or database is linked to the document, and placeholders called merge fields tell Word where the information goes. Excel spreadsheets and Outlook contact lists are, in Microsoft's words, the most common data sources. Mail merge is already in most firms' copy of Word, and it is enough for letters, labels, envelopes and simple notices.
Assembly goes further by deciding what to ask. Docassemble's documentation describes its applications as interviews that ask one question at a time to reach an end point, which may be a document, a signed document or the submission of an application. An assembly tool does not ask about a second executor if the client has named only one, and it does not include a guardianship clause when there are no minor children.
| Mail merge | Document assembly | |
|---|---|---|
| Input | A list or spreadsheet | Answers to questions |
| Logic | Little or none | Conditions, repeats, computed values |
| Output | One document per row | A set of documents shaped by the answers |
| Fits | Notices, letters, labels | Wills, engagement letters, pleadings, agreements |
Some firms use both: assembly for the documents that need judgment about structure, and mail merge for the high-volume correspondence around them.
Turning a firm precedent into a legal document automation template
A template starts with the precedent the firm already trusts. Take the best recent version, mark every place it changed between matters, decide which changes are variables and which are optional clauses, and write each rule down before building anything. The written list of variables and rules is the real template; the software only carries it out.
01
Precedent
Pick the current approved version of the document
02
Mark
Highlight every word that changed between past matters
03
Classify
Sort each change: variable, optional clause, or repeat
04
Rules
Write when each clause appears, in plain English
05
Build
Enter the template and rules in the tool
06
Test
Run real past matters through it and compare the output
A few habits keep templates honest.
- One owner per template. A named lawyer approves the language and any change to it.
- A version date on the template. The draft records which template version produced it, so a later error can be traced.
- Test cases from real matters. Run three or four closed matters through the template, including an awkward one, and compare the output with what was actually signed.
- A plain-English rule sheet. Anyone checking a draft should be able to read why a clause appeared.
- A review date. A statute, a court form or the firm's own terms will change, and the template has to change with them.
Court forms raise their own version problem: a court may require the current edition of a form, so an automated form is only as good as its last update. The guide to legal forms software covers how official forms are kept current.
Who checks a draft from legal document automation before it goes out?
A lawyer reads every automated draft before it is signed or sent, because a template only knows the facts it was given. When an answer is wrong, or the client's situation falls outside the rules the template was built on, the draft can be polished and still wrong. Review catches what the questionnaire never asked.
The failures are predictable, which makes them checkable.
- Wrong answer in, wrong document out. A misspelled name or a transposed date flows into every document in the set.
- A case the rules did not foresee. A blended family, a trust with two situs states, a party that is an entity rather than a person.
- A stale template. Language that was right when the template was built and has since been overtaken.
- A broken condition. A clause that should appear does not, and nothing in the draft shows that it is missing.
The last failure is the hardest to see, because a missing clause leaves no gap. A reviewer who knows what the full precedent contains reads for what should be there, not only for what is. A short checklist per template can list the clauses that must appear in every version.
The duty to supervise applies to automated work as it does to work done by staff. Where a paralegal or assistant runs the interview, the lawyer's review is part of that supervision. The post on Model Rule 5.3 and the people and tools a lawyer relies on sets out what the rule asks.
Where AI drafting differs from legal document automation
AI drafting writes new text from a request and whatever material it is given. Legal document automation fills a fixed template from known answers. A template can be read in advance and gives the same words every time. A model's draft cannot be read until it exists, so each one is checked against its sources after the fact.
That difference decides which tool fits which task. A firm that wants its engagement letter to say exactly the same thing to every client wants a template; any variation is an error. A lawyer who wants a first statement of facts from a deposition and a stack of emails is asking for something no template can hold, because the content depends on what the record says.
Lucerna Law is on the second side of that line. Asked for a statement of facts or an outline, it returns an answer in the chat with citations to the matter's files, for the lawyer to check and edit; the homepage describes what the product does with a matter's files. The post on building a memo's fact section from cited answers shows how a cited draft is checked line by line.
The two meet at the boundary. Facts drawn from a record with an AI tool, once checked, can become the answers that feed an automated template. The template then guarantees the language, and the lawyer's check of the facts guarantees what goes into it.