loading...
No Results
  • Get Started
    • Welcome to GoInsight.AI
    • Quick Start
  • Knowledge 101
    • Key Concepts
    • Knowledge Base
    • LLM Selection Guide
    • Tool
    • Service
    • Data Security
  • Quick Chatbot
    • Build a Quick Bot
  • InsightFlow
    • InsightFlow Introduction
    • Types of InsightFlow
    • Node
      • Start
      • LLM
      • Knowledge Base Retrieval
      • Answer
      • Document Writing
      • Document Reading
      • HTTP Request
      • IF/ELSE
      • Question Classifier
      • Branch Aggregator
      • Multi branch Selector
      • Iteration
      • Auto-Continue
      • Template
      • Code
      • JSON Variable Extractor
      • Variable Assigner
      • Variable Extractor
      • KnowledgeFocus LLM
      • Agent
      • End
    • Publishing
      • Publishing an Interactive Flow
      • Publishing a Service Flow
      • Create Your First Workflow
  • Control & Management
    • Access Control
Home > Documentation > InsightFlow > Node

Template Node

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.

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.
Jinja2 Official Documentation Link: [https://jinja.palletsprojects.com]. This site offers comprehensive information and examples on Jinja usage, including template grammar and filters.
Go Text Template Official Documentation Link: [https://pkg.go.dev/text/template]. Here, you can explore complete guides and code examples on grammar structure, function calls, variable handling, and template composition for Go text templates.

Simple Case display

Text Concatenation: Concatenate user-provided variables such as account information and issue descriptions into a single, completely formatted text.

Template node case
Updated on: Jun 26, 2025
Prev Auto-Continue
Next Code
On this page
  • Definition
  • How to configure
    • Input variables
    • Choose grammar
    • Output variable
  • Common Use Cases
  • Simple Case display
loading...
No Results