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 (Word, Excel, or PDF) based on predefined document templates. It supports two main operations:

  • Generate Document: Creates a document from a selected template and dynamic data.
  • Generate Document and Send as Email Attachment: Generates the document and sends it as an email attachment with customizable email fields.

This node is useful in scenarios where automated document generation is needed, such as creating invoices, contracts, reports, or personalized letters, and optionally emailing them directly to recipients. For example, you can automate sending monthly billing statements by generating PDFs from templates and emailing them to customers.

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.
Data Source Choose how to provide dynamic data for the template:
- JSON Editor: Enter JSON data manually.
- From Input Item JSON: Use JSON data from the incoming input item.
Data (JSON) JSON data used to fill the template placeholders when "JSON Editor" is selected as the data source. You can copy the initial JSON structure from the Documentero App's template overview.
Email Recipient email address (used only when operation is "Generate Document and Send as Email Attachment").
Email Subject Subject line of the email to send with the generated document attached.
Email Message Body message of the email. Supports multiline text.
Email Footer Footer text appended to the email message.
Email Sender Email address shown as the sender of the email.
Email CC Comma-separated list of email addresses to be added as CC recipients.
Email BCC Comma-separated list of email addresses to be added as BCC recipients.

Output

The node outputs one item per input item processed. Each output item contains:

  • json: The response from Documentero API, including metadata about the generated document.
  • binary (optional): If the document content is returned, it is provided as binary data under a key named data. This binary data represents the generated document file, ready for further processing or saving.

The binary data includes:

  • The file content decoded from base64.
  • The original filename (if available).
  • The MIME content type (e.g., application/pdf).

If the operation includes sending an email, the output still contains the generated document data but does not include email delivery status explicitly.

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.
  • No additional environment variables are required beyond the API key credential setup.

Troubleshooting

  • Common Issues:

    • Invalid or missing API key will cause authentication failures.
    • Incorrect template ID or name may result in "Document generation failed" errors.
    • Malformed JSON data for the template placeholders can cause parsing or generation errors.
    • Email sending failures if recipient email addresses are invalid or SMTP/email service issues occur on Documentero side.
  • Error Messages:

    • "Document generation failed: <details>": Indicates failure during document creation or email sending. Check template existence, data correctness, and API key validity.
    • HTTP request errors with status codes may appear; verify network connectivity and API endpoint availability.
  • Resolutions:

    • Verify API key credentials are correctly set up in n8n.
    • Confirm the template exists and is accessible.
    • Validate JSON data syntax before running the node.
    • Ensure email addresses are valid and properly formatted.
    • Enable "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion