PDF Templates

Last updated: March 2026

Design professional PDF documents - invoices, contracts, reports, certificates - using a visual template builder. Templates pull live data from your entities and can be generated automatically through workflows.

The template builder

The PDF Template Builder provides a visual editor for designing document layouts. You build templates by defining sections, placing fields, and configuring styles. The builder includes a real-time preview so you can see exactly how the generated PDF will look before saving.

Templates are stored as structured definitions that combine layout, field mappings, and conditional logic. When a PDF is generated, the template engine resolves all field references against the source data, evaluates conditions, processes tables, and renders the final document.

1

Create a template

Navigate to the PDF Templates section and click "New Template". Give it a name and description. The template editor opens with a blank canvas.

2

Configure the data source

Open the Data Source panel to connect your template to an entity. This determines which fields are available for dynamic content. You can select the primary entity and include related entities.

3

Add and arrange fields

Use the Field Editor to place dynamic fields in your template. Each field maps to an entity field and will be replaced with actual data when the PDF is generated.

4

Preview and save

Use the preview function to render the template with sample data. Adjust the layout until satisfied, then save the template.

Data sources

Each PDF template is connected to one or more data sources. The primary data source is an entity whose records provide the main content for the document. For example, an invoice template connects to an "Invoices" entity and pulls in customer details, line items, totals, and dates.

The data source panel lets you browse available fields from the connected entity, including related entity fields. Field references use dot notation for nested data (e.g., customer.name, customer.email). The field resolver handles the traversal of relations at generation time.

Conditional content

Templates support conditional rendering to show or hide sections based on data values. For example, you can display a "PAID" stamp only when an invoice has been paid, or show different terms based on the customer type.

The condition evaluator uses the same expression syntax as the workflow system. Conditions can reference any field from the data source and support operators like equals, not equals, greater than, is empty, and more.

Tip

Use conditional sections to create versatile templates. A single invoice template can handle both paid and unpaid invoices, different currencies, and variable numbers of line items.

Tables and line items

The table processor handles repeating data like invoice line items, order items, or report rows. When you define a table section in your template, you specify a field that contains an array of items. The processor iterates over each item and generates a row in the PDF.

Table columns map to fields within each item. You can configure column headers, widths, alignment, and formatting. Calculated fields like subtotals and grand totals are supported through the template normalizer, which pre-processes data before rendering.

Generating PDFs

PDFs can be generated in three ways: manually from a record view, automatically through a workflow, or via the AI agent tools. In a workflow, the Generate PDF node takes a template ID and a record ID, renders the PDF, and makes it available for download or email attachment.

When an agent uses the generate_pdf tool, it specifies the template and source record. The generated PDF is stored in the media library and can be attached to emails, shared via links, or downloaded.

Note

PDF generation requires the template and data source to be properly configured. If a referenced field is missing from the data, it will appear blank in the output. Use the preview function to verify your template before deploying it in workflows.