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 taken from incoming workflow items. Additionally, it supports sending the generated document as an email attachment with customizable email fields.
Common scenarios for this node include:
- Automating report generation by filling templates with dynamic data.
- Creating invoices, contracts, or certificates automatically.
- Generating personalized documents and emailing them directly to recipients.
For example, a user can select a template for an invoice, provide customer and order details as JSON, generate the invoice PDF, and optionally send it via email to the customer—all within an automated workflow.
Properties
| Name | Meaning |
|---|---|
| Document Template Name or ID | Select a document template from Documentero App or specify its ID. Templates are managed in the Documentero admin interface. |
| 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 workflow item. |
| Data (JSON) | 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. |
Note: The above properties correspond to the "Default" resource and operation.
Output
The node outputs one item per input item processed, containing:
- A
jsonfield with the response data from Documentero API, including metadata about the generated document. - If the generated document includes file content, the node adds a
binaryproperty containing the document file encoded as binary data. This binary data includes:- The file content decoded from base64.
- The original filename.
- The MIME content type (e.g., application/pdf).
The fileContent field is removed from the JSON output once converted to binary.
If the operation fails and "Continue On Fail" is enabled, the output item will contain an error message under json.error.
Dependencies
- Requires an API key credential for authenticating with the Documentero API.
- The node makes HTTP requests to
https://app.documentero.com/api/templatesto load available templates and tohttps://app.documentero.com/apito generate documents. - No additional environment variables are required beyond the API key credential configuration.
Troubleshooting
- Failed to load templates: Occurs if the node cannot fetch templates from Documentero. Check API key validity and network connectivity.
- Document generation failed: Happens if the API call to generate the document fails. Verify that the template ID is correct and the provided JSON data matches the template requirements.
- Invalid JSON data: If using the JSON editor, ensure the JSON is well-formed. Malformed JSON will cause parsing errors.
- Email sending issues (only for the "Generate Document and Send as Email Attachment" operation): Ensure all required email fields are correctly filled and that the Documentero account has email sending configured properly.
To resolve errors, verify credentials, template IDs, and data formats. Enable "Continue On Fail" to handle errors gracefully in workflows.
Links and References
- Documentero App - Manage Templates
- n8n Expressions Documentation
- Documentero API documentation (accessible via the app for template JSON structures)