Universal Templater

Generate DOCX, XLSX, Markdown, and TXT files from templates using JSON data

Universal Templater

AI-generated

Summary

Render a document by injecting JSON data into a template, supporting DOCX, XLSX, Markdown, and TXT output formats from various template sources including binary input, server file path, URL, or inline text (for Markdown and TXT only).

Inputs

  • format (required) — Specify the output document format: DOCX, XLSX, Markdown, or TXT.
  • templateSource (required) — Choose where to load the template from: binary data from previous node, server file path, URL, or inline text (Markdown/TXT only).
  • binaryPropertyName (required) — When using binary input, the binary property name containing the template file.
  • filePath (required) — Absolute path on the n8n server for the template file (used if template source is filePath).
  • templateUrl (required) — URL to download the template from; supports HTTP headers, redirects, and timeout (used if template source is URL).
  • httpMethod (required) — HTTP method to fetch the template when the source is URL (GET or POST).
  • httpHeaders — Optional HTTP headers to include in the URL request (e.g., authorization tokens).
  • httpTimeout — Timeout in milliseconds for the URL request when fetching the template.
  • inlineTemplate (required) — Directly provide the template text (Markdown or TXT only) when using inline template source.
  • jsonData (required) — JSON object containing keys and values used to populate template placeholders.
  • outputFileName — Base name for the generated output file; file extension is added automatically.
  • outputBinaryPropertyName — Name of the binary property where the rendered file's binary data will be stored in the output item.

Output shape

a list of items each containing the rendered file in binary under the specified output binary property and metadata in JSON

Each output item retains the input JSON with added metadata: fileName, fileExtension, mimeType, and fileSize. The rendered binary content is base64-encoded and attached under the configured output binary property name. Supports processing multiple input items independently with error handling according to node settings.

Links

Discussion