> For the complete documentation index, see [llms.txt](https://docs.allshore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allshore.ai/clients-and-pipeline/generating-documents-from-templates.md).

# Generating documents from templates

Rather than writing every MSA by hand, your firm authors **document templates** once and generates documents from them.

## Templates

Templates live in **Configure → Document templates**. (Not to be confused with **Checklist templates** in Settings — different thing entirely: those drive onboarding tasks.) MSA / SOW / NDA skeletons can be seeded to start from.

**Authoring a template is a partner admin action** — it's the wording your firm sends out under its own name. **Generating** a document from an approved template is everyday work any partner staff member can do.

## Merge fields

A template body carries placeholders that fill in at generation time from three sources:

* **your firm** — business name, address lines, footer note (from Settings → Invoice branding);
* **the client** — name, legal name, address, and the signer's name, email, and title (from the client's firmographics);
* **the document** — its title and effective date.

The screen lists the available fields, so you don't have to memorize them.

## What happens when you generate

Pick a template and a client, give the document a title and (optionally) an effective date, and optionally link it to a commercial contract. Allshore creates a **draft** in the document ledger immediately and renders its PDF a moment later — so the row appears before the file does.

**A placeholder that can't be filled never silently disappears and never fails the render.** It appears in the finished PDF as a visible marker like `[[missing: client.signerName]]`. That's deliberate: an unfilled blank you can see is far safer than one you can't, and it means a raw `{{…}}` can never reach a signed contract. If you see markers in a generated draft, fill in the underlying data (usually the client's firmographics) and generate again.

One consequence worth knowing: a contract document has no estimate behind it, so estimate fields in an MSA body will always render as missing markers. Estimate figures belong in a proposal, not a contract.

An unparseable effective date is refused outright rather than stored.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.allshore.ai/clients-and-pipeline/generating-documents-from-templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
