TemplateTo icon

TemplateTo

Powerful Template Based Document Generation

Actions6

Overview

This node integrates with a template-based document generation service, allowing users to render templates into various formats. Specifically, the "Pdf Renderer" resource with the "Render as PDF Byte Array" operation enables rendering a selected template into a PDF format and returns the result as a byte array. This is useful when you want to generate PDF documents dynamically within an automation workflow without saving them directly as files, for example, to send them as email attachments or upload them to cloud storage.

Practical examples:

  • Generating invoices or reports on the fly from predefined templates and sending them via email.
  • Creating PDF certificates or tickets dynamically based on user data.
  • Integrating with other systems that require PDF content in binary form rather than as a file.

Properties

Name Meaning
Template The specific template to be rendered. You select one from available templates loaded dynamically by the node.

Output

The output contains a JSON array where each item corresponds to the rendered PDF content of the selected template. The key part of the output is the PDF represented as a byte array (binary data encoded in a suitable format). This byte array can be used downstream in workflows for further processing, such as saving to disk, uploading, or emailing.

If the node supports binary data output (not explicitly shown in the code), it would typically provide the PDF content in the binary property of the output item.

Dependencies

  • Requires access to the external TemplateTo API service at https://api.templateto.com.
  • Needs an API authentication token credential configured in n8n to authorize requests to the TemplateTo API.
  • The node uses internal helper functions to load available templates dynamically.

Troubleshooting

  • Common issues:
    • Invalid or missing API credentials will cause authentication failures.
    • Selecting a non-existent template ID will likely result in an error response from the API.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:
    • Authentication errors: Ensure the API key or token is correctly set up in the node credentials.
    • Template not found: Verify the template ID exists and is accessible.
    • API request failures: Check network connection and API service status.

Links and References

Discussion