Presenta icon

Presenta

Interact with Presenta API to render documents/images using templates

Overview

This node integrates with the Presenta API to render documents or images based on predefined templates. It allows users to send a JSON payload to the API, which then generates output files such as PDFs or various image formats. This is useful for automating document generation workflows, such as creating reports, certificates, invoices, or marketing materials dynamically from data.

Typical use cases include:

  • Generating PDF reports from structured data.
  • Creating images (PNG, JPEG, WEBP) from templates for social media or web content.
  • Caching rendered outputs for faster retrieval.
  • Debugging and testing template rendering by enabling debug output.

Properties

Name Meaning
Endpoint Choose the Presenta API endpoint to use: Render (to generate new output) or Cached (to retrieve cached output).
Template ID The identifier of the Presenta template to use for rendering the document or image.
Payload (JSON) JSON object containing data to populate the template. Supports both simple and complex structured data.
Options Collection of additional options:
- Cache Buster Boolean flag to disable caching on template update, useful for testing changes immediately.
- Custom Endpoint (Full URL) If set, overrides the default API URL with this full request URL.
- Debug Output Boolean flag to include detailed debug information in the output for troubleshooting.
- Export File Format Format of the exported file. Options: PDF, PNG, JPEG, WEBP.
- Export Pure PDF Boolean flag to preserve vector elements in PDF exports.
- Filename Name of the returned document (without extension). Defaults to "document".

Output

The node outputs binary data representing the rendered document or image file. The binary data is stored under the key data.

The JSON output is generally empty unless the "Debug Output" option is enabled. In that case, the JSON contains a debug object with:

  • The final payload sent to the API.
  • The full request details including URL, headers, and method.
  • The response type and length.
  • The raw response encoded in base64.
  • The first 100 bytes of the response in base64 and UTF-8 string form.
  • A generated curl command replicating the request for debugging purposes.

This debug information helps diagnose issues with the API call or payload formatting.

Dependencies

  • Requires an API token credential for authenticating with the Presenta API. This token must be set in the environment variable PRESENTA_API_TOKEN.
  • Uses standard HTTP requests to communicate with the Presenta API endpoints.
  • No other external dependencies are required.

Troubleshooting

  • Payload is not valid JSON: Occurs if the provided payload string cannot be parsed into JSON. Ensure the payload is valid JSON format.
  • Payload must be a JSON object: The payload must be an object, not a primitive or null.
  • No Presenta API token found: The node requires a valid API token set in the environment. Make sure the token is configured correctly.
  • Network or API errors: If the API returns errors or network requests fail, check the API token validity, endpoint URL, and network connectivity.
  • Enabling "Debug Output" can help identify malformed requests or unexpected responses by providing detailed request/response data.

Links and References

Discussion