Text - Template
Type identifier:
text:templateCategory: Text Operations
Description
Renders a rich-content template with variable substitution. Insert variables through the template editor, then connect each generated input handle to the value it should render. It generates dynamic content such as messages, emails, or prompts.
Input Handles
Handle | Data Type | Required | Description |
|---|---|---|---|
| Varies | Varies | Dynamic handles for each variable |
Input Handle Details
Variable Handles
Input handles are dynamically generated based on the variables configuration:
- Handle ID: The variable name from the
variablesarray - Type: Any (such as strings, numbers, and content)
Notes:
- Media URLs in content values are signed while the node renders
- All variable values are serialised into the template
Output Handles
Handle | Data Type | Description |
|---|---|---|
|
| The rendered template |
|
| Triggered on rendering error |
Output Handle Details
result
- Type:
string Notes:
- Variables are substituted into the template
- Content format is serialised to string
Configuration Options
Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
| Yes |
| Display label for the node |
|
| Yes |
| Variable names to substitute |
|
| Yes | Empty paragraph | The rich-content template |
Configuration Details
variables
- Type:
string[] Notes:
- Each variable name creates an input handle
- Insert the corresponding variable into the template with the editor
- Case-sensitive matching
template
- Type:
Content Notes:
- Variables are embedded as variable nodes in the content structure
- Images, files, and other content media are signed while rendering
Behaviour
Execution Flow
- Resolves all variable values from input handles
- Signs any file URLs in the template or content-valued variables while rendering
- Serialises the template with variables substituted
- Returns rendered string
Variable Substitution
Variable Type | Behaviour |
|---|---|
String | Inserted directly |
Date string | Formatted using the variable's format or field default |
Number | Formatted using the variable's format or field default |
Content | Serialised to text, files pre-signed |
Object | JSON serialised |
Array | JSON serialised |
Date Variable Formatting
When a variable value is a parseable date/datetime string (ISO 8601 or Temporal ZonedDateTime format), it is automatically formatted using the format cascade:
- Variable-level format — if the variable reference in the template content specifies a format
- Field-level
defaultFormat— from the Schema field's configuration (when Schema context is available) - ISO fallback — raw string value if no format is configured
The viewer's timezone preference is used when timezoneDisplay is set to "viewer" on the Schema field.
Number Variable Formatting
Number values use the same cascade:
- Variable-level format — if the variable reference in the template content specifies a number format
- Field-level
defaultFormat— from the Schema field's configuration (when Schema context is available) - Unformatted — the number converted to a string if no format is configured
Formatting uses the viewer's locale preference when one is available. See Schema Field Types Reference — number for format presets and custom options.
Content Handling
- Media nodes (images, audio, video) have URLs pre-signed
- Content structure is serialised to plain text
- Nested content is flattened
Error Handling
Scenario | Behaviour |
|---|---|
A file URL cannot be signed or accessed | Triggers |
Rendering fails | Triggers |
Examples
Greeting Template
{
"type": "text:template",
"data": {
"label": "Greeting Message",
"variables": ["name", "company"],
"template": [
{
"type": "paragraph",
"children": [
{ "text": "Hello " },
{ "type": "variable", "variable": "name", "children": [{ "text": "" }] },
{ "text": ", welcome to " },
{ "type": "variable", "variable": "company", "children": [{ "text": "" }] },
{ "text": "!" }
]
}
]
}
}Email Template
{
"type": "text:template",
"data": {
"label": "Order Confirmation",
"variables": ["customerName", "orderId", "total"],
"template": [
{
"type": "paragraph",
"children": [
{ "text": "Dear " },
{ "type": "variable", "variable": "customerName", "children": [{ "text": "" }] },
{ "text": ", your order #" },
{ "type": "variable", "variable": "orderId", "children": [{ "text": "" }] },
{ "text": " has been confirmed. Total: $" },
{ "type": "variable", "variable": "total", "children": [{ "text": "" }] }
]
}
]
}
}Rich Content Template
{
"type": "text:template",
"data": {
"label": "Report Summary",
"variables": ["title", "content"],
"template": [
{
"type": "heading",
"level": 1,
"children": [{ "type": "variable", "variable": "title", "children": [{ "text": "" }] }]
},
{
"type": "paragraph",
"children": [{ "type": "variable", "variable": "content", "children": [{ "text": "" }] }]
}
]
}
}LLM Prompt Template
{
"type": "text:template",
"data": {
"label": "Analysis Prompt",
"variables": ["document", "question"],
"template": [
{ "type": "paragraph", "children": [{ "text": "Based on the following document:" }] },
{
"type": "paragraph",
"children": [{ "type": "variable", "variable": "document", "children": [{ "text": "" }] }]
},
{ "type": "paragraph", "children": [{ "text": "Please answer this question:" }] },
{
"type": "paragraph",
"children": [{ "type": "variable", "variable": "question", "children": [{ "text": "" }] }]
}
]
}
}