Skip to main content

create_pdf

Internal beta โ€” config shape is being migrated

The Automation API is an internal beta and is not released yet โ€” endpoints and payloads may change or be withdrawn without notice. This action's config is being migrated to a typed schema; the fields below reflect that in-progress shape. Always read the authoritative, live shape from GET /v1/automation/meta/action before building against it.

Create PDF โ€” renders an HTML template to a PDF. group: "action". No specific trigger context is required.

Part of the Email & documents family. This page documents the typed config; for how an action sits inside an automation definition, see Actions and Action examples.

Configโ€‹

Every member is optional โ€” each carries a canonical editor default, so an omitting caller still yields a complete action.

KeyTypeRequiredDescription
options_expandedbooleannoEditor-only UI flag: whether the advanced options section is expanded. Default false.
filenametemplate valuenoThe generated file's name. Empty when omitted.
custom_variable_defobjectnoThe custom variable the action outputs (the generated PDF file). { single_file, PDF } when omitted.
page_numbers_enabledbooleannoWhether page numbers are rendered. Default false.
header_and_footer_enabledbooleannoWhether the PDF header and footer are rendered. Default false.
page_sizeenumnoPage size. Default a4.
page_custom_widthcode valuenoCustom page width, used only when page_size is custom_size. Empty when omitted.
page_custom_heightcode valuenoCustom page height, used only when page_size is custom_size. Empty when omitted.
page_orientationenumnoPage orientation. Default portrait.
page_marginsenumnoPage margins preset. Default normal.
page_custom_margin_topcode valuenoCustom top margin, used only when page_margins is custom_margins. Empty when omitted.
page_custom_margin_rightcode valuenoCustom right margin, used only when page_margins is custom_margins. Empty when omitted.
page_custom_margin_bottomcode valuenoCustom bottom margin, used only when page_margins is custom_margins. Empty when omitted.
page_custom_margin_leftcode valuenoCustom left margin, used only when page_margins is custom_margins. Empty when omitted.
pdf_header_custom_margin_topcode valuenoCustom header top margin. Empty when omitted.
pdf_footer_custom_margin_bottomcode valuenoCustom footer bottom margin. Empty when omitted.
page_number_styleenumnoPage-number numbering style. Default decimal.
page_number_startcode valuenoThe number the first page's number starts at. Empty when omitted.
pdf_headertemplate valuenoHeader HTML template rendered on the first page. Empty when omitted.
pdf_header_expandedbooleannoEditor-only UI flag: whether the header section is expanded. Default false.
pdf_header_following_pagestemplate valuenoHeader HTML template rendered on following pages. Empty when omitted.
pdf_header_following_pages_enabledbooleannoWhether a distinct following-pages header is used. Default false.
pdf_footertemplate valuenoFooter HTML template rendered on the first page. Empty when omitted.
pdf_footer_expandedbooleannoEditor-only UI flag: whether the footer section is expanded. Default false.
pdf_footer_following_pagestemplate valuenoFooter HTML template rendered on following pages. Empty when omitted.
pdf_footer_following_pages_enabledbooleannoWhether a distinct following-pages footer is used. Default false.
pdf_body_expandedbooleannoEditor-only UI flag: whether the body section is expanded. Default false.
pdf_bodytemplate valuenoBody HTML template rendered as the PDF content. Empty when omitted.

page_size tokens (lower-case): letter, tabloid, legal, a3, a4, a5, envelope_10, custom_size. Custom dimensions apply only under custom_size.

page_orientation tokens (lower-case): portrait, landscape.

page_margins tokens (lower-case): normal, narrow, moderate, wide, custom_margins. Custom margins apply only under custom_margins.

page_number_style tokens (lower-case): decimal, decimal_leading_zero, lower_latin, upper_latin, lower_roman, upper_roman.

The four *_expanded members are editor-only UI flags and are omitted from the live discovery schema; they are documented here for completeness so a full-fidelity round-trip preserves them.

Exampleโ€‹

An action entry inside an automation definition's actions[]:

{
"type": "create_pdf",
"config": {
"filename": ["invoice-", { "kind": "variable", "source": "meta", "meta_type": "app_record_id" }, ".pdf"],
"page_size": "a4",
"page_orientation": "portrait",
"page_margins": "normal",
"pdf_body": ["<h1>Invoice</h1><p>Thank you for your order.</p>"]
}
}

Validation & behaviorโ€‹

  • No member is required โ€” each carries a canonical editor default. The four page enums default to page_size โ†’ a4, page_orientation โ†’ portrait, page_margins โ†’ normal, and page_number_style โ†’ decimal; every boolean defaults to false, and every template / code string defaults to the empty definition.
  • custom_variable_def is the action's output (the generated PDF file); omitting it yields the canonical { single_file, PDF } variable.
  • Custom dimensions (page_custom_*) apply only under the matching custom_size / custom_margins presets and are ignored otherwise.
  • The action renders an HTML template to a PDF and produces no reliable per-action success log โ€” do not rely on a success log entry to confirm the render.
  • Beta caveat: a GETโ†’PUT round-trip of a create_pdf action currently 400s on dev (remediation pending); treat it as a known beta limitation until fixed.

See alsoโ€‹