# Document templates

> Fix a company layout once, then let agents and workflows fill its fields to produce invoices, quotes, letters, reports, decks and emails.

## What a template is

A template is a fixed company layout with fields the agent fills. The agent sees only the field list and a when-to-use line; the server checks its values, fills the layout and produces the PDF, or for an email the message ready to send. The agent never sees the HTML, so it cannot change the layout.

Templates belong to the business account. Owners and dashboard editors edit them; viewers see them read-only.

## Create a template

1. Open **Templates** and choose **New template**.
2. Pick a template from the gallery: it opens in the editor at once. Or start blank in a format, **Document** (A4), **Presentation** (16:9) or **Email** (a 600 px column), or **From HTML** with your own page (pasted or uploaded), then enter **Name** and **When to use**.

Every format opens in the same editor. Starters are copied into your account, so product updates never change your template. **Duplicate**, in a template's **⋯** menu, makes a copy without its connections.

> **Tip** — Agents choose between templates by their when-to-use line: describe the situation, such as "Send a quote after a call".

## Edit on the document

You edit the rendered document; changes save by themselves.

### Decide what the agent writes

What the agent writes is violet on the page; everything else is the same in every document.

- Select an element and answer **Who writes this?**: **Always this text**, or **The agent** (for a table, **The agent fills the rows** makes it a list).
- To let the agent write only some words, select them and choose **Make field**; **Make fixed text** reverts a field.
- **Elements** → **Written by the agent** adds ready-made fields: short text, paragraphs, date, amount, list, optional part, and a link in an email.

**Fields** lists everything the agent fills and marks the descriptions still missing; click a row to find it on the page.

### Fields

Click a field to set **What the agent writes here** (the first description also names the field), the **Type** (short text, long text, number, amount, date, choice; a table is a list), **Required**, and limits such as length, options, currency or format.

The text inside a field is its example, checked at every save. For numbers, amounts and dates, set it in **Example**.

### Lists, optional parts and blocks

A list repeats its first row once per item, such as invoice lines; the other rows only fill the example. An optional part appears only when the agent says it applies, such as bank details: turn on **Only when it applies** on any element and say when.

The **+** between two pages, or **Add page** in **Pages**, adds a blank page (a slide in a deck) that every document includes once; the icons above a page move, duplicate or delete it. Reports and decks are made of blocks, such as a cover or a closing slide: select one to say what it is for and how often the agent may use it.

### Appearance

**Style**, in the left rail, sets the accent colour, the page colour and the font pair when the template supports them, as every starter does; an email also sets the colour around its column. An image still to choose, such as a starter's logo, is a dashed box on the page: click it or drop a file on it. **Header and footer** repeat a line on every printed page, with the page number and count from **Insert**.

## Arrange the page

A page is made of elements: **Text**, **Highlighted box**, **Image**, shapes (**Rectangle**, **Circle**, **Triangle**, **Line**), **Table**, **Columns** (two or three side by side), **Space** and a dividing rule. Add one from **Elements**, or drop an image file on the page (on an image, it replaces it); select one to change it in the side panel, **Duplicate** it or **Delete** it.

Elements take a **Background** or **Fill** (a colour or a gradient), **Text colour**, **Border**, **Corners**, **Shadow** and **Opacity**.

- **Flowing pages** (the A4 starters except the certificate): elements stack and the page grows with the content. Reorder by dragging an element's grip or with Alt+↑/↓. Set **Width**, **Placement**, **Text size** and **Text alignment**.
- **Fixed pages** (slides and the certificate): drag an element to move it and its handles to resize it, or type **Position and size**; guides snap to the page and to other elements. Use **Align to the page**, **Bring forward**, **Send backward** and the arrow keys.

## When agents start using your changes

A save without problems is live from the agents' next document; otherwise the editor lists the problems and agents keep the last valid version. **Download** saves it filled with its examples, as agents produce it: PDF, HTML, and images for decks and emails.

> **Watch out** — **Archive**, in the **⋯** menu, stops every agent from filling the template; it is refused for the only template of an agent or workflow that requires one. Restore it from **Show archived**.

## Email templates

An email is one 600 px column on a background colour, built with the same elements, on flowing pages only. Agents fill it into a message ready for mail clients, saved in the Workspace, and send it with the email tools. The approval shows the real message, and nothing is sent if the file changes after the approval. Images travel inside the message; a link field fills a button or a link with an address the agent provides.

## Connect agents and workflows

Open **Connections** from a template's **⋯** menu in the **Templates** list, or from the **Templates** section of an agent's Connections canvas. With several templates, the agent picks by when-to-use line and falls back to the **Default** one. **Template required** removes the freeform document tools, so every document comes from a template. A workflow's own templates and setting apply to its agent steps.

> **Rule** — Connections are checked every time a document is filled, approvals included. Removing one takes effect immediately.

## Ask the assistant

The dashboard assistant can create a template from a starter or from HTML, read and rewrite a template's HTML, change a layout from an instruction ("put the logo on the right"), rename a template or edit its when-to-use line, archive it and connect it to agents and workflows. It shows each change first and applies it only when you confirm; a layout change keeps every field unless you ask otherwise.

## What the agent can and cannot do

The agent chooses the template, its blocks, the values, the title, the file name and the folder. Invalid values are refused with every problem listed. The PDF and its source HTML go to documents/ in the agent's Home or the workflow folder by default, an email to documents/emails/ ([where files land](/en/docs/workspace/paths)). Filled documents are read-only: to correct one, the agent fills the template again.

## Limits

| Item | Limit |
| --- | --- |
| Template HTML, images included | 512 KB |
| One image | 250 KB |
| Field list seen by agents | 12 KB |
| Fields, list fields and optional parts included | 60 |
| Blocks per template / per document | 16 / 60 |
| Rows in one list | 200 |
| Templates per agent or workflow | 8 |

## Related

- [Template HTML](/en/docs/templates/html)
- [Paths and where files land](/en/docs/workspace/paths)
- [Agent tools](/en/docs/agents/tools)
- [Build a workflow](/en/docs/workflows/build)
