Skip to content

Render documents from n8n

The Typefold nodes for n8n render your published templates inside a workflow, without writing code. The Typefold node renders documents; the Typefold Trigger starts a workflow each time a render finishes.

  • A published template in Studio, such as an invoice.

  • An API key for n8n, created in Studio under Manage → API keys. Give it template:read, which n8n uses to check the key, and the permissions of the operations you use:

    Operation Permissions
    Render Report render:create, render:read
    Start Render render:create
    Get Render render:read
    Typefold Trigger webhook:manage

In n8n, open Settings → Community nodes, select Install, enter @typefold/n8n-nodes-typefold and confirm. See n8n’s guide to installing community nodes for details.

  1. Add a Typefold node to a workflow and, under Credential to connect with, choose Create new credential.
  2. Paste the key into API Key.
  3. Leave Base URL as https://app.typefold.dev. If your company runs its own Typefold, enter the address you open Studio at instead.
  4. Select Save. n8n tests the key and shows whether it works.

The Render Report operation renders a published template and returns the file, ready for the next node to email, upload or store.

  1. Set Operation to Render Report.
  2. Pick the Template from the list, or enter its name or ID.
  3. Choose the file in Format: PDF, XLSX, or a PNG, JPEG or WebP image of one page.
  4. Enter the template’s data as JSON in Data. To build it from earlier nodes, use an expression such as {{ $json }}.

The file is in the item’s data field; change the name with the Put Output File in Field option. For PDFs and images, Test Render returns a free file with a “TEST” watermark, so you can try the workflow without using your plan’s documents.

For an image, the Image Page, Image Width and JPEG Quality options pick the page, its size and the JPEG quality; see images.

To stamp a line of text such as COPY across every page of a PDF or image, add the Watermark Text option; it works for Start Render too. See watermarks for which letters it supports.

For long documents, or when a workflow should not wait, start a render and handle it when it finishes:

  1. In one workflow, add a Typefold node with the Start Render operation. Choose Template and pick it with its Data, or choose HTML and enter your own HTML. Format renders a PDF or an image. The node returns the render’s id and state.
  2. In a second workflow, start with a Typefold Trigger and pick the Events to react to: Render Succeeded, Render Failed or Render Cancelled.
  3. After the trigger, add a Typefold node with Get Render and set Render ID to {{ $json.data.renderId }}. With Download File on, a succeeded render’s PDF or image is in the item’s data field.

To upload the file to one of your storage destinations, add the Destination Name option to Start Render, and optionally Destination Path. With Keep Copy in Typefold off, Typefold keeps no copy, so Get Render returns only the render’s state.

The trigger receives every render in the workspace that ends in a chosen state, including renders your other applications start; see webhooks for the event’s fields. Each event has a data.test field that is true for test renders.

When you activate the workflow, or select Listen for test event, the trigger registers your n8n’s webhook address with Typefold under Manage → Webhooks, named after the workflow. It removes it again when you deactivate the workflow. n8n checks the signature of every request and ignores requests Typefold did not send.

  • Typefold must be able to reach your n8n from the internet. If your n8n runs on your own server, set its WEBHOOK_URL to its public https:// address.
  • Each active trigger uses one of the workspace’s 10 webhook endpoints, and listening for a test event uses one more while it listens.
  • If you rotate the endpoint’s signing secret in Studio, deactivate and activate the workflow within 24 hours, so the trigger picks up the new secret.