Actions12
- File Actions
- Template Actions
- Job Actions
Overview
This node interacts with the Json2Doc API to fill a document template with specified variables and generate a document in DOCX or PDF format. It supports providing template variables either as a JSON object or through a user interface with different variable types such as text, image, table, and list. The node can optionally wait for the job to complete and download the generated document automatically. This is useful for automating document generation workflows, such as creating personalized reports, contracts, or certificates based on predefined templates.
Use Case Examples
- Generating a personalized contract by filling a DOCX template with client-specific data provided as JSON variables.
- Creating a PDF report by defining variables through the UI, including images and tables, and automatically downloading the completed document.
Properties
| Name | Meaning |
|---|---|
| Template ID | The ID of the template to fill, identifying which document template to use. |
| Variables Input Mode | How to provide the template variables, either as a JSON object or defined via the UI with different variable types. |
| Template Variables (JSON) | JSON object containing variables to fill in the template, used when Variables Input Mode is JSON. |
| Variables | Template variables defined via the UI, supporting multiple variable types such as text, image, table, and list. |
| Output Filename | Filename for the generated document without the file extension. |
| Output Type | Output file format, either DOCX or PDF. |
| Wait for Completion | Whether to wait for the job to complete and automatically download the generated document. |
| Download Binary Property | Name of the binary property to store the downloaded file when waiting for completion. |
Output
Binary
Contains the generated document file when 'Wait for Completion' is true, stored under the specified binary property name.
JSON
jobId- Identifier of the created job for filling the templatestatus- Current status of the job (e.g., PENDING, COMPLETED, FAILED)outputFileId- Identifier of the generated output fileerrorMessage- Error message if the job failed or was cancelledvariables- Variables used to fill the templateoutputfilename- Filename of the generated documenttype- File format of the generated document (docx or pdf)
Dependencies
- Json2Doc API with API key authentication
Troubleshooting
- Job timeout if the document generation takes too long; increase wait time or check API status.
- Job failure or cancellation with error messages returned from the API; verify template ID and variable data correctness.
- Invalid JSON format in template variables when using JSON input mode; ensure valid JSON structure.
- Missing required parameters such as Template ID or Output Filename; ensure all required fields are provided.
Links
- Json2Doc API Documentation - Official API documentation for Json2Doc, detailing endpoints and usage.