HTML Render
HTML is a markup language used to structure styled web pages, emails, reports, and other documents that can be displayed by a browser or processed by a downstream service.
The HTML Render Node combines an HTML template with structured JSON content. Use it to create complete HTML documents, repeat sections from arrays, format values, and split table rows across logical pages without running a browser.
Revision History
0.2.0.15 - Initial release.
0.2.1.1 - Added complete starter, performance report, and paginated table templates.
0.2.1.2 - Fixed structured template defaults for Workflow validation.
0.2.1.6 - Added the standard V2 Render response, fixed rendering safeguards, and updated the built-in templates.
0.3.0.0 - Moved the Node to the Render category.
0.3.0.1 - Returned the completed document directly and added the Validation Starter template.
Setup Notes
This Node does not require a Connection or external service.
- Add the
HTML RenderNode from theRendercategory. - Supply
Contentas a structured JSON object. Property and token names are case-sensitive. - If your content starts as a JSON string or Stream, use JSON Document
ParseAsObjectfirst and map itsObjectReturn toContent. - Use a complete document with
DOCTYPE,html,head, inlinestyle, andbodywhen the output will be viewed or passed to a downstream renderer. - The Node returns HTML text as
Document. It does not open a browser or create a PDF.
Methods
Render
Combines the supplied template and content into one completed HTML document.
Scalar values are HTML-encoded by default. Containers repeat their enclosed markup for each item in a JSON array.
| Parameter | Type | Description |
|---|---|---|
Template |
String | HTML containing supported scalar, formatting, container, height, pagination, and page-number tokens. |
Content |
Object | Structured values and arrays used by the template. |
| Return | Type | Description |
|---|---|---|
Document |
String | The completed HTML document. |
Validate
Checks template syntax and, when Content is supplied, validates content bindings and pagination without returning or logging the rendered document.
Use this method while developing a template or before rendering templates that can change at runtime.
| Parameter | Type | Description |
|---|---|---|
Template |
String | The HTML template to validate. |
Content |
Object | Optional structured content used to validate token bindings and pagination. |
| Return | Type | Description |
|---|---|---|
Validation |
Object | Structured validation results, diagnostics, and discovered token names. |
Validation Properties
| Property | Type | Description |
|---|---|---|
IsValid |
Boolean | Indicates whether the template passed validation. |
Errors |
Array | Blocking diagnostics. |
Warnings |
Array | Non-blocking diagnostics. |
Tokens |
Array | Scalar token names discovered in the template. |
Containers |
Array | Container names discovered in the template. |
Each error or warning includes Code, Message, Line, Column, and Token Properties.
Usage Notes
Choosing a Template
The Render method provides three templates:
Document Starterprovides a complete responsive document shell and scalar replacement examples.StyledPerformanceReportdemonstrates nested repeated sections, metric cards, inline CSS, and numeric formatting.PaginatedTableReportdemonstrates repeated rows, fixed row-count pagination, and current and total page numbers.
When you select a template, the designer loads its complete HTML, structured Content sample, and scalar defaults. Complex objects and arrays are not stored as literal Property Value fields. Map Content from an upstream Step such as JSON Document ParseAsObject to supply your own sections or rows.
The Validate method provides a Validation Starter template. It includes the complete document starter, matching structured Content, and the IsValid, Errors, Warnings, Tokens, and Containers Return Properties.
Basic Example
The following template inserts scalar values and repeats one table row for every item in Rows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{{DocumentTitle}}</title>
</head>
<body>
<h1>{{Heading}}</h1>
<table>
<tbody>
{{Rows container}}
<tr>
<td>{{Description}}</td>
<td>{{Amount format="#,##0.00"}}</td>
</tr>
{{/Rows}}
</tbody>
</table>
</body>
</html>
Use a matching Content object:
{
"DocumentTitle": "Operations Summary",
"Heading": "Completed Work",
"Rows": [
{
"Description": "Discovery workshop",
"Amount": 850
},
{
"Description": "Implementation services",
"Amount": 2450
}
]
}
Template Syntax
| Syntax | Description |
|---|---|
{{Name}} |
Inserts an HTML-encoded scalar value from the current content scope. |
{{Amount format="#,##0.00"}} |
Applies a .NET format string before HTML encoding. |
{{TrustedMarkup raw}} |
Inserts trusted markup without HTML encoding. |
{{Rows container}}...{{/Rows}} |
Repeats the enclosed markup for each item in a JSON array. |
{{Sections container}}{{Metrics container}}...{{/Metrics}}{{/Sections}} |
Repeats nested arrays using the current item as the inner content scope. |
{{Rows container max-rows-count="20" parent="Pages"}} |
Splits rows into fixed-size groups and duplicates the named ancestor container. |
{{Rows container max-height="600px" parent="Pages"}} |
Splits rows when their accumulated height reaches the specified maximum. |
{{Description height="18px"}} |
Assigns a fixed height used by height-based pagination. |
{{Description height="calculated" font-name="Arial" font-size="12px" width="320px"}} |
Estimates wrapped text height for height-based pagination. |
{{_currentPageNo parent="Pages"}} |
Inserts the one-based page number for a duplicated page container. |
{{_totalPageNo parent="Pages"}} |
Inserts the total number of duplicated pages. |
{{.}} |
Inserts the current value while iterating a scalar array. |
Opening and closing container tokens must be balanced and correctly nested. max-rows-count and max-height cannot be used together. In either pagination mode, parent must exactly match the container that directly encloses the paginated container.
A height-paginated container must contain exactly one direct scalar token with a height attribute. Use either a fixed height or all three calculated-height attributes: font-name, font-size, and width.
Pagination Example
The paginated table template uses a Pages array containing an object with a nested Rows array:
{{Pages container}}
<section class="page">
<div>Page {{_currentPageNo parent="Pages"}} of {{_totalPageNo parent="Pages"}}</div>
<table>
<tbody>
{{Rows container max-rows-count="3" parent="Pages"}}
<tr>
<td>{{Description}}</td>
<td>{{Category}}</td>
<td>{{Amount format="#,##0.00"}}</td>
</tr>
{{/Rows}}
</tbody>
</table>
</section>
{{/Pages}}
With 12 rows and max-rows-count="3", the Node creates four page sections and renders page numbers from Page 1 of 4 through Page 4 of 4.
Encoding and Trusted Markup
The Node HTML-encodes scalar values by default. Characters such as <, >, &, and quotes therefore remain text instead of becoming active markup.
The raw attribute disables encoding for one token. Only use raw with trusted HTML controlled by the Workflow author. The built-in templates do not use raw.
The Node does not sanitize the template itself. If a downstream system displays the returned HTML, apply that system's security controls and restrict who can edit templates.
Formatting
Use format with a valid .NET format string. Formatting always uses the invariant culture.
Calculate totals, percentages, comparisons, or other derived values in an earlier Step. HTML Render formats supplied values but does not perform calculations.
Limitations
- The template grammar does not support conditionals or
if/elseblocks. - The Node does not evaluate calculations, comparisons, or general expressions.
- The Node does not load partials, local files, includes, or remote templates.
- The Node does not execute JavaScript or CSS.
- The Node does not fetch remote images, fonts, or stylesheets.
- The Node does not convert HTML to PDF.
- Calculated height is deterministic but remains an estimate of downstream browser or PDF layout.
- Fixed safeguards limit the completed document to
16777216characters, aggregate container expansion to100000items, and template nesting to64levels.