Login
Free Sign Up
Docs
/

Experience - Pdf - Create

Type identifier: experience:pdf:create Category: Flow Operations

Description

Renders a published Experience with the app target in headless Chromium using print media mode, then creates and uploads a PDF file. The node emits the created PDF as a file handle for downstream nodes.

Input Handles

Handle

Data Type

Required

Description

trigger

trigger

Yes

Execution trigger input.

{variable}

varies

No

Dynamic handles for configured datum inputs.

Input Handle Details

trigger

  • Type: trigger
  • Notes: Starts PDF generation when received.

Dynamic Datum Input Handles

  • Type: generated from configured datum references
  • Notes:

    • Handles are generated when datumInputs are configured.
    • Each handle id is the configured input value key.

Output Handles

Handle

Data Type

Description

success

trigger

Emitted after PDF generation and upload succeed.

error

trigger

Emitted when rendering or upload fails.

file

file

The generated PDF file entry.

Output Handle Details

file

  • Type: file entry with Flow context
  • Notes:

    • mimeTypeId is pdf

Configuration Options

Property

Type

Required

Default

Description

label

string

Yes

"Experience - Pdf - Create"

Display label for the node.

experienceId

string (cuid2)

Yes*

-

Experience to render.

appEndpointId

string (cuid2) | ligantic_app_endpoint

No

canonical endpoint

App endpoint selection.

datumInputs

datum inputs

No

-

Datum values to include in generated Experience URL.

fileName

string

No

<experience name>.pdf

Output filename.

format

"A4" | "Letter" | "Legal"

No

"A4"

PDF page format.

orientation

"portrait" | "landscape"

No

"portrait"

PDF orientation.

margin.top

string

No

-

Top page margin CSS size (for example 10mm).

margin.right

string

No

-

Right page margin CSS size.

margin.bottom

string

No

-

Bottom page margin CSS size.

margin.left

string

No

-

Left page margin CSS size.

printBackground

boolean

No

true

Include background graphics/colours in output.

scale

number

No

-

Render scale from 0.1 to 2.

displayHeaderFooter

boolean

No

false

Enable Chromium header/footer templates.

headerBlockId

string

No

-

Block id to render into the PDF header template.

footerBlockId

string

No

-

Block id to render into the PDF footer template.

timeoutSeconds

number

No

30

Timeout in seconds (1 to 120).

* Required to run; a missing value takes the error path.

Behaviour

Execution Flow

  1. Validates that experienceId resolves to a published Experience path.
  2. Resolves configured datum inputs.
  3. Establishes render authentication:

    • If the run context includes a user-backed Space identity for the Flow's Space (such as the built-in USER and ADMIN roles for a signed-in Ligantic user), the Experience is rendered via cloud as that user, so the Experience does not need to be publicly accessible.
    • Otherwise (no identity, an identity for a different Space, or an identity not backed by a user, such as a guest or magic-link session), the Space must have a guest authentication strategy, and the app endpoint Experience is rendered anonymously.
  4. Renders the page in print media mode, waits for the page to load (waiting for network idle is best-effort), and produces the PDF.
  5. Saves the PDF and emits the resulting file entry on file.
  6. Emits success on completion or error on failure.

Authentication and Prerequisites

  • One of the following must hold:

    • the run context carries a user-backed Space identity for the Flow's Space (for example, a Flow triggered by a signed-in Ligantic user with the built-in USER or ADMIN role) — rendered via cloud, or
    • the Space has a guest authentication strategy — rendered anonymously via the app endpoint.
  • The rendering session is subject to normal Experience access control: the identity's role must grant access to the target Experience, otherwise the render returns not-found and the node fails. Built-in USER/ADMIN roles can access any Experience in the Space via cloud.

Header and Footer Blocks

When displayHeaderFooter is enabled, headerBlockId and footerBlockId select blocks from the experience that are rendered into Chromium header/footer templates. Template classes like pageNumber/totalPages/date/title are not injected automatically by this node.

Examples

Basic PDF Export

{
  "type": "experience:pdf:create",
  "data": {
    "label": "Experience - Pdf - Create",
    "experienceId": "exp_1234567890abcdef123456",
    "format": "A4",
    "orientation": "portrait",
    "printBackground": true,
    "timeoutSeconds": 30
  }
}

PDF Export With Margins and Footer

{
  "type": "experience:pdf:create",
  "data": {
    "label": "Invoice PDF",
    "experienceId": "exp_1234567890abcdef123456",
    "fileName": "invoice.pdf",
    "format": "Letter",
    "orientation": "portrait",
    "margin": {
      "top": "12mm",
      "right": "10mm",
      "bottom": "14mm",
      "left": "10mm"
    },
    "displayHeaderFooter": true,
    "footerBlockId": "footer-block-id",
    "timeoutSeconds": 45
  }
}

Related pages