Definition
The Template Node enables advanced text manipulation using either Go Text Template or Python's Jinja2 template language. It serves as a powerful tool for text concatenation, looping, and variable substitution, enhancing the efficiency and flexibility of formatted text output.
This node can act as the "ultimate assembler" for all your text outputs, notification messages, and report generation by converting structured data or AI-generated content into final text formats tailored to the enterprise requirements. By providing flexible template options, it greatly boosts the customizability, readability, and professional presentation of automated workflows.
How to Configure
Input Variables
You can select output variables from previous nodes and assign them names.
Choose grammar
Choose the desired template grammar: Go Text Template and Jinja2, with an attached user guide available for reference.
The following example demonstrates Go Text Template grammar.

Basic grammar Structure:
- Template grammar is contained between {{ and }}. Except for the template grammar enclosed by {{ and }}, other contents are output intact.
- Variable usage format: {{ .variable name }}.
Whitespace and newline handling:
- {{-: Delete whitespace and line breaks on the left.
- -}}: Delete whitespace and line breaks on the right.
- {{- . -}}: Delete all whitespace and line breaks
Input Variables
The processed output is stored in a variable named Output (String).
Common Use Cases
Text templates enable lightweight and flexible data transformation, making them ideal for text processing and format conversion scenarios. Whether you’re generating customized emails, creating real-time reports, or formatting data in specific structures, the Text Template Node offers a flexible and efficient solution, leading to greater workflow automation and optimization.
- Auto-generate email or message content: You can inject data returned from LLM nodes or JSON variable extractors, such as name, order number, or payment amount, into templates to generate personalized notifications or email bodies.
- Combine multiple fields and perform simple conditional logic: Insert different prompt texts or list items based on conditional values, without the need to add additional nodes to handle logic. This simplifies branching and enhances maintainability.
- Output formatted strings: Easily manages and outputs strings in formats like JSON, XML, Markdown, or HTML using the Jinja2 grammar for consistent results.
Simple Case display
Text Concatenation: Concatenate user-provided variables such as account information and issue descriptions into a single, completely formatted text.
