TotalBase
Steps

Documents

Generate a PDF, from a template or a design.

In the admin: Workflows › a Workflow › a step

Two steps render a PDF: from a PDF template saved in Templates, or from a design written into the step. Both return the PDF as base64 content, which you usually store with a Create file step and attach to an email.

StepRendersResult, as {{step.data}}
Generate PDF from templatea saved PDF template, filled with data{ "mimeType": "application/pdf", "content": "<base64>" }
Generate PDFa pdfme design in the step, filled with datathe same

Generate PDF from template

Field
TemplateRequired. A PDF template from Templates
DataA JSON object: a value for each of the template's placeholders, with {{…}}

Rendering a template is reading it: the executor needs READ on that template, within their row filter, as when a user prints it. Otherwise the step fails with TEMPLATE_ACCESS_DENIED before the template is loaded. An administrator executor passes.

Order completed renders Acme's Work order template:

FieldValue
TemplateWork order
Data{"number": "{{start.data.number}}", "description": "{{start.data.description}}", "resolution": "{{start.data.resolution}}", "signed_by": "{{start.data.signed_by}}"}

Then a Create file stores {{pdf.data.content}} as WO-000123.pdf, and Send email attaches it. Editing the template in Templates changes the PDFs every workflow renders from then on, without publishing the workflow.

Generate PDF

Field
DesignRequired. A pdfme design object (basePdf and schemas), the same shape a PDF template stores
DataA JSON object: values for the design's placeholders. A value that isn't text is written as JSON

Use it for a one-off layout that doesn't deserve a template. Anything reused belongs in Templates, where it can be edited without changing the workflow.

Returning a file to the App

When a page of the App runs a workflow through a Call variable, a result shaped as a file is opened by the App as a file:

{ "asset": "f3a9…", "filename": "WO-000123.pdf" }

or, without storing it, { "mimeType": "application/pdf", "content": "<base64>", "filename": "WO-000123.pdf" }. End the workflow with a Finish with result that returns one of them.

Prefer storing the PDF and returning its asset: base64 content travels through the run and, with a Detailed history, is kept in it.

Errors

CodeWhen
TEMPLATE_ACCESS_DENIEDthe executor may not read the template
TEMPLATE_NOT_FOUNDno template with that id
TEMPLATE_WRONG_KINDthe template is an email template, not a PDF one

Next steps