
Template Node Configuration Interface
Jinja2 Templating
Template nodes use Jinja2 templating syntax to create dynamic content that adapts based on workflow data. This provides programming-like capabilities including loops, conditionals, and filters for sophisticated text generation.Variable Substitution
Reference workflow variables using double curly braces:{{ variable_name }}. You can access nested object properties and array elements using dot notation and bracket syntax.
Conditional Logic
Show different content based on data values using if-else statements:Loops and Iteration
Process arrays and objects with for loops to generate repetitive content:
Template Processing Knowledge Retrieval Results
Data Formatting
Filters
Jinja2 filters transform data during template rendering:Error Handling
Handle missing or invalid data gracefully using default values and conditional checks:Interactive Forms
Templates can generate interactive HTML forms for structured data collection in Chatflows. On submit, the form values are sent to the chat as the end user’s next message. The format depends on the<form>’s data-format attribute:
data-format="json": values are serialized as a JSON object. A downstream Code node or Parameter Extractor canJSON.parseit (or pattern-match it) to pull out each field.- Unset (or any other value): values are sent as plain text, one
name: valueper line. Easier for an LLM to read.

Supported Tags
Do not leave blank lines between tags inside
<form>. A blank line ends the HTML block during markdown parsing, and any tags after the break will fail to render as form fields.Supported Input Types
-
Any other
typevalue renders an “Unsupported tag” fallback in place of the field. -
HTML5 validation attributes such as
required,min,max, andpatternare not enforced. -
Browsers may autofill
<input type="password">and<input type="email">with saved credentials for the current site; use<input type="text">for fields that should not be prefilled.
Quick-Reply Buttons
A standalone<button> placed outside any <form> renders as a clickable button in the chat. Use these to offer canned responses or external links inline with the assistant’s message. For example:

If both are set,
data-link takes precedence. A button with neither renders but performs no action when clicked.
Apply data-variant and data-size for styling, using the same values listed for form buttons above.
Unlike form buttons, standalone buttons pass
data-variant and data-size through to the underlying component without validation. An unrecognized value can leave the button rendered as plain text rather than a styled button.Use only the values listed above.