Documentero icon

Documentero

Generate Word, Excel or PDF Document based on Document Template. Get API Key from Documentero APP

Overview

This node integrates with the Documentero service to generate documents such as Word, Excel, or PDF files based on predefined document templates. It allows users to dynamically populate these templates with JSON data either entered directly in the node or passed from previous workflow steps. Additionally, it supports sending the generated document as an email attachment.

Common scenarios where this node is beneficial include:

  • Automating report generation by filling templates with dynamic data.
  • Creating invoices, contracts, or certificates programmatically.
  • Sending personalized documents via email automatically after generation.

For example, a user can select a sales report template, provide sales data in JSON format, and generate a PDF report. Alternatively, the user can generate a contract document and immediately send it to a client’s email address.

Properties

Name Meaning
Document Template Name or ID Select a document template from your Documentero account or specify its ID. Templates are managed in the Documentero App under Collections.
Data Source Choose how to provide the data for populating the template:
- JSON Editor: Enter JSON data manually in the node.
- From Input Item JSON: Use JSON data from the incoming input item.
Data (JSON) The JSON data used to fill the selected template when "JSON Editor" is chosen as the data source. You can copy the initial JSON structure from the Documentero App's Template Overview > API/JSON section.

Output

The node outputs one item per input item processed, each containing:

  • A json field with the response data from Documentero API.
  • If the generated document includes file content, a binary field will be present containing the document file encoded properly for n8n workflows. This binary data includes:
    • The file content decoded from base64.
    • The original filename (if provided).
    • The MIME content type (e.g., application/pdf).

The json.data.fileContent property is removed from the output JSON once the binary data is prepared to avoid duplication.

Dependencies

  • Requires an API key credential for authenticating with the Documentero API.
  • Needs network access to https://app.documentero.com/api endpoints.
  • The node uses HTTP requests authenticated via the configured API key credential.
  • No additional environment variables are required beyond the API key setup.

Troubleshooting

  • Failed to load templates: Occurs if the node cannot fetch available templates from Documentero. Check API key validity and network connectivity.
  • Document generation failed: Happens if the API call to generate the document fails. Possible reasons include invalid template ID, malformed JSON data, or server errors. Review the error message returned and verify inputs.
  • If the node is set to continue on failure, errors for individual items will be included in the output JSON under an error property.
  • Common fixes:
    • Ensure the template ID or name is correct and accessible.
    • Validate JSON data syntax and structure matches the template requirements.
    • Confirm the API key has sufficient permissions.
    • Check that the Documentero service is operational.

Links and References

Discussion