Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Split PDF By Barcode
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Split PDF By Swiss QR
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
The node provides a "Generate Document Single" operation that creates a single document based on a provided template and data. It supports multiple ways to input the template file (binary data, base64 string, raw HTML code, or URL) and various template file types such as Word (Docx), HTML, or PDF. The document data can be supplied as JSON or XML in different formats (text, binary data, base64 string, or URL). This flexibility allows users to generate customized documents dynamically by merging templates with structured data.
Common scenarios include:
- Generating personalized reports, invoices, or letters by filling templates with user-specific data.
- Creating contracts or forms where the content is dynamically populated from JSON or XML sources.
- Automating document creation workflows where templates are stored in different formats or locations.
Practical example:
- A workflow receives customer order data in JSON format and uses a Word template stored as binary data from a previous node to generate an invoice document for each order.
Properties
| Name | Meaning |
|---|---|
| Template File Input Type | How the template file is provided. Options: Binary Data (from previous node), Base64 String, HTML Code (manual raw HTML, only for HTML template type), URL (link to template file). |
| Template Binary Property | Name of the binary property containing the template file (used when Template File Input Type is Binary Data). |
| Template File Name | Name of the template file including extension (used when Template File Input Type is Binary Data or Base64/String/URL/HTML). |
| Template Base64 Content | Base64 encoded content of the template file (used when Template File Input Type is Base64 String). |
| Template File URL | URL pointing to the template file (used when Template File Input Type is URL). |
| HTML Code | Raw HTML code for the template (used when Template File Input Type is HTML Code and Template File Type is HTML). |
| Template File Type | Type of the template file. Options: Word (Docx), HTML, PDF. Determines how the template is processed. |
| Document Data Input Type | How the document data is provided. Options: Text (manual JSON or XML), Binary Data (from previous node), Base64 String, URL. |
| Document Data Type | Format of the document data. Options: JSON or XML. |
| Document Data Text | Manual entry of JSON or XML data as text (required if Document Data Input Type is Text). |
| Document Binary Property | Name of the binary property containing the data file (used when Document Data Input Type is Binary Data). |
| Document Data File Name | Name of the data file including extension (used when Document Data Input Type is Binary Data or Base64/String/URL). |
| Document Data File URL | URL pointing to the data file (used when Document Data Input Type is URL). |
| Document Base64 Content | Base64 encoded content of the data file (used when Document Data Input Type is Base64 String). |
| Binary Data Output Name | Custom name for the binary data output property in n8n after document generation. Defaults to "data". |
Output
The node outputs the generated document as binary data under a custom-named binary property (default "data"). The output contains the fully merged document created by applying the provided data to the specified template. The binary data represents the generated file in the format corresponding to the template type (e.g., DOCX, PDF, or HTML).
No additional JSON structure details are explicitly defined, but typically the output includes metadata about the generated file alongside the binary content.
Dependencies
- Requires access to the template file and data either via binary inputs, base64 strings, or URLs.
- No explicit external API keys or services are mentioned in the provided source code snippet for this operation.
- The node depends on internal action implementations for document generation (not detailed here).
- Proper configuration of input properties is necessary to ensure correct file and data retrieval.
Troubleshooting
- Common issues:
- Incorrect or missing template file input leading to failure in document generation.
- Malformed JSON or XML data causing parsing errors.
- Mismatch between template file type and provided template content (e.g., providing HTML code for a non-HTML template).
- Invalid URLs or inaccessible files when using URL input types.
- Error messages:
- Errors related to missing required parameters (e.g., template file name or data content).
- Parsing errors for JSON/XML data.
- File read or download failures for URL inputs.
- Resolutions:
- Verify all required fields are correctly filled according to the selected input types.
- Validate JSON or XML data syntax before running the node.
- Ensure URLs are accessible and point directly to the correct files.
- Use binary data inputs from previous nodes carefully, confirming the binary property names.