Json2Doc icon

Json2Doc

Interact with Json2Doc API for document generation

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

  1. Generating a personalized contract by filling a DOCX template with client-specific data provided as JSON variables.
  2. 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 template
  • status - Current status of the job (e.g., PENDING, COMPLETED, FAILED)
  • outputFileId - Identifier of the generated output file
  • errorMessage - Error message if the job failed or was cancelled
  • variables - Variables used to fill the template
  • output
    • filename - Filename of the generated document
    • type - 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

Discussion