> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.flowella.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create PDF document templates

> Build the PDF templates that HubSpot's Generate Document workflow action renders — headings, paragraphs, tables, spacers, and contact property tokens.

The **Settings → Document templates** screen is where you create and manage the PDF templates that the [Generate Document](/hubspot/workflow-actions#generate-document) HubSpot workflow action renders. Each template defines the layout of a PDF and the contact properties to fill it with.

## Opening Document templates

From the left navigation click **Settings**, then choose **Document templates** under the **Integrations** section of the settings sidebar.

You need the **Owner** or **Admin** role to create, edit, or delete document templates. Members can view the list.

## Building a template

A template has a **Name** and a **Template JSON** definition. The definition sets an optional document title and a list of blocks rendered top to bottom:

| Block       | Renders as                         |
| ----------- | ---------------------------------- |
| `heading`   | A heading line                     |
| `paragraph` | A body text paragraph              |
| `table`     | A table built from rows of cells   |
| `spacer`    | Vertical whitespace between blocks |

Insert contact properties anywhere in the title, heading text, paragraph text, or table cells with double-brace tokens in the `contact.<property>` form, such as `{{contact.firstname}}`. When the Generate Document action runs, Flowella replaces each token with the enrolled contact's value.

```json theme={null}
{
  "title": "Letter for {{contact.firstname}}",
  "blocks": [
    { "type": "heading", "text": "Hello {{contact.firstname}}" },
    { "type": "paragraph", "text": "Email: {{contact.email}}" },
    { "type": "spacer" },
    {
      "type": "table",
      "rows": [
        ["Name", "{{contact.firstname}} {{contact.lastname}}"],
        ["Phone", "{{contact.phone}}"]
      ]
    }
  ]
}
```

Click **Create template** to save it. To change an existing template, pick it from the **Templates** list, edit the name or JSON, and click **Save changes**.

## Using a template in HubSpot

Each row in the **Templates** list shows the template ID with a **Copy ID** button. Copy it and paste it into the **Document template ID** field of the **Generate Document** action in your HubSpot workflow.

When the workflow runs, Flowella renders the template with the enrolled contact's properties, saves the PDF to your HubSpot files, and returns the file URL and HubSpot file ID for later workflow steps. See [Generate Document](/hubspot/workflow-actions#generate-document) for the action's full configuration.

## Related

<CardGroup cols={2}>
  <Card title="Generate Document (HubSpot)" icon="network" href="/hubspot/workflow-actions#generate-document">
    The workflow action that renders these templates.
  </Card>

  <Card title="AI Document Reader (HubSpot)" icon="scan-text" href="/hubspot/workflow-actions#ai-document-reader">
    The companion action that reads documents into contact properties.
  </Card>
</CardGroup>
