Template
Description
The Template node constructs a text string by combining a fixed template with dynamic content received from its input anchors. It replaces placeholder variables ({{input0}}, {{input1}}, etc.) in the template with the actual text received on the corresponding input anchors.
It is the primary tool for formatting, assembling, or injecting data into prompts. For example, you can build a structured prompt for an Agent by combining a system instruction template with data coming from a File Read, a Memory Read, or another Agent.
A unique feature of this node: when Input Count is set to 0, it has no input anchors and behaves as a source node, emitting the fixed template text as-is at the start of the workflow.
Configuration Properties
📝 Template Section
Text Area
The template text containing placeholder variables. Variables follow the format {{inputN}} where N is the zero-based index of the input anchor:
{{input0}}→ replaced by the content received on the first input anchor (top anchor).{{input1}}→ replaced by the content received on the second input anchor.{{input2}}→ replaced by the content received on the third input anchor.- ...and so on up to
{{input9}}(maximum 10 inputs).
Any text in the template that is not a variable placeholder is preserved as-is. You can mix static text, formatting, and variables freely.
💡 Tip: Use the template to build structured prompts for AI agents. For example:
Summarize the following article:\n\n{{input0}}\n\nFocus on the key points about {{input1}}.
🔢 Input Count Section
NumericUpDown (default: 2, range: 0 to 10)
Defines the number of input anchors on the node. Each anchor corresponds to one variable ({{input0}} through {{inputN-1}}).
Special behavior at 0: When set to 0, the node has no input anchors and becomes a source node. It emits the template text as-is at the start of the workflow, without waiting for any input. This is useful for injecting fixed text blocks (e.g., a system prompt, a constant header) into a workflow.
⚠️ Warning: If you set Input Count to
2but only connect data to the first anchor,{{input1}}will remain unreplaced in the output (it will appear literally as{{input1}}). Always ensure all referenced variables have a connected input.
Usage Example
"Build a translation prompt":
- A File Read node loads an article (connected to anchor 0).
- A Memory Read node retrieves the target language (connected to anchor 1).
- A Template node with:
- Input Count:
2 - Template:
Translate the following text to {{input1}}:\n\n{{input0}}\n\nPreserve the original formatting.
- Input Count:
- An Agent node receives the formatted prompt and performs the translation.
"Inject a fixed system prompt":
- A Template node with:
- Input Count:
0 - Template:
You are a helpful assistant. You provide short, concise answers.
- Input Count:
- The node emits the fixed text at workflow start, feeding it into an Agent's system prompt chain.
Pitfalls to Avoid
⚠️ Unmatched variables: If your template contains {{input3}} but Input Count is only 2, the variable will never be replaced (there is no anchor 3). The output will contain the literal string {{input3}}. Always match your variable indices to the Input Count.
⚠️ Index starts at 0: The first anchor is {{input0}}, not {{input1}}. This is a common off-by-one mistake. Remember: anchor index = variable index = position in the list (starting from 0).
⚠️ Empty inputs produce empty replacements: If an anchor receives an empty string (or no data), the corresponding variable is replaced with an empty string. This can produce malformed output (e.g., Translate the following text to :\n\n if the language input is empty). Validate inputs upstream with a Switch or Filter node if needed.
⚠️ Source mode (Input Count = 0) executes immediately: When Input Count is 0, the node is a source and runs at the very start of the workflow, in parallel with other sources. If you need it to run after another node (e.g., to use data that was just computed), you must set Input Count to at least 1 and connect a trigger input.
⚠️ No nested variables: The template engine does a simple string replacement. It does not support nested variables (e.g., {{input{{input0}}}} will not work) or conditional logic. For complex text generation, use a Code node or an Agent node instead.
⚠️ Variable syntax is strict: The placeholders must be exactly {{inputN}} with double curly braces and no spaces inside. {{ input0 }}, {input0}, or {{input 0}} will not be recognized and will appear literally in the output.
⚠️ Maximum 10 inputs: The Input Count is clamped to a maximum of 10. If you need to combine more than 10 pieces of data, chain multiple Template nodes or use a Code node with custom concatenation logic.