Search all guides

Reference · Tools

HTML node

Generate HTML from templates with expression placeholders, extract data from HTML using CSS selectors, convert JSON items to an HTML table, and optionally output HTML as a binary file.

Action (binary) Core Nodes v1 Binary data

The HTML node does three related jobs: render HTML from a template with `{{ }}` placeholders, extract values out of HTML with CSS selectors, and turn JSON items into an HTML table — optionally emitting the result as a binary .html file. It needs no credentials. A typical build is rendering a personalised email body per item and handing it straight to an email node.

Works as
Action (binary)
Tool name
html
Parameters
12
Outputs
Output, Error
Credentials
None required

What you can build with HTML

  • Generate an HTML email template with dynamic data.
  • Convert workflow results to a styled HTML table.
  • Extract titles and links from an HTML page using CSS selectors.
  • Create an HTML report as a downloadable .html file.
  • Parse HTML from a binary file and extract structured data.

Overview

The HTML tool provides three operations: (1) generateHtmlTemplate — takes an HTML template with {{ expression }} placeholders, resolves them against the input item data context, and outputs the rendered HTML as JSON or optionally as a binary .html file; (2) extractHtmlContent — parses HTML from a JSON property or binary data field and extracts values using CSS selectors (supports text, html, attribute, and value extraction with array/single return modes); (3) convertToHtmlTable — aggregates all input items into a single HTML table element with configurable styling, headers, captions, and attributes. No external API credentials required.

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool does not require any credentials.

Operations

OperationValueDescription
Generate HTML TemplategenerateHtmlTemplateRender an HTML template with expression placeholders resolved against item data
Extract HTML ContentextractHtmlContentExtract values from HTML using CSS selectors
Convert to HTML TableconvertToHtmlTableAggregate all input items into a single HTML table

Parameters

Generate HTML Template

ParameterTypeRequiredDefaultDescription
HTML TemplatestringNo<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>My HTML document</title> </head> <body> <div class="container"> <h1>This is an H1 heading</h1> <h2>This is an H2 heading</h2> <p>This is a paragraph</p> </div> </body> </html>HTML template with {{ expression }} placeholders. Expressions are evaluated against the current item data context. Use {{ $json.fieldName }} to reference input fields.
Output as BinarybooleanNofalseWhether to output the rendered HTML as a binary .html file instead of a JSON property.
Binary PropertystringNodataName of the binary property to write the HTML file to. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. (shown when Output as Binary is true)
File NamestringNooutput.htmlFile name for the binary HTML output. (shown when Output as Binary is true)

Extract HTML Content

ParameterTypeRequiredDefaultDescription
Source DataoptionsNojsonWhether HTML should be read from binary data or a JSON property.
Options: binary (read HTML from a binary data property), json (read HTML from a JSON property on the item)
Input Binary FieldstringYesdataThe name of the input binary field containing the HTML file to be extracted. (shown when Source Data is binary)
JSON PropertystringYesdataName of the JSON property containing the HTML to extract data from. Supports dot-notation (e.g., “response.body”). Can be a string or array of strings. (shown when Source Data is json)
Extraction ValuesfixedCollectionNo{"values":[{"key":"","cssSelector":"","returnValue":"text","returnArray":false}]}Define one or more extraction rules. Each rule uses a CSS selector to find elements and extracts the specified data.
Options: attribute
— KeystringNo—The key under which the extracted value should be saved in the output JSON.
— CSS SelectorstringNo—The CSS selector to match HTML elements (e.g., “h1”, “.price”, “#main a”, “table tr td:nth-child(2)”).
— Return ValueoptionsNotextWhat kind of data should be returned from matched elements.
Options: attribute (get an attribute value like “class” from an element), html (get the inner HTML the element contains), text (get only the text content of the element), value (get value of an input, select, or textarea element)
— AttributestringNo—The name of the attribute to return the value of (e.g., “href”, “src”, “data-id”). (shown when Return Value is attribute)
— Skip SelectorsstringNo—Comma-separated list of selectors for elements to skip/remove during text extraction. (shown when Return Value is text)
— Return ArraybooleanNofalseWhether to return values as an array. If true, each matched element produces a separate array entry. If false, all matched text is concatenated into a single string.
Options (options)collectionNo{}
— Trim ValuesbooleanNotrueWhether to automatically remove spaces and newlines from the beginning and end of extracted values.
— Clean Up TextbooleanNotrueWhether to remove leading/trailing whitespace, line breaks, and condense multiple consecutive whitespaces into a single space.

Convert to HTML Table

ParameterTypeRequiredDefaultDescription
Options (tableOptions)collectionNo{}
— Capitalize HeadersbooleanNofalseWhether to capitalize header names by splitting on underscores (e.g., “first_name” becomes “First Name”).
— Custom StylingbooleanNofalseWhen true, no default inline styles are applied. When false, applies built-in styles for a clean default appearance.
— CaptionstringNo—Optional caption text for the table.
— Table AttributesstringNo—Raw HTML attributes to add to the element. element. element.
— Header AttributesstringNo—Raw HTML attributes to add to the
— Row AttributesstringNo—Raw HTML attributes to add to each
— Cell AttributesstringNo—Raw HTML attributes to add to each element.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

Generate HTML Template

One output item per input item. The rendered markup is written to html:

{
  "html": "<h1>Hello Ada!</h1><p>Your email is ada@example.com</p>"
}

With Output as Binary off, html is the only field on the item — the rest of the input JSON is dropped. With Output as Binary on, the input JSON is kept, html is added beside it, and the same markup is also written as a text/html binary file on Binary Property under File Name, alongside any binary the item already carried.

Extract HTML Content

One output item per HTML string parsed. The extracted values are added to the input item’s JSON, each under its rule’s Key:

{
  "url": "https://example.com/article",
  "headline": "Quarterly results",
  "links": ["https://example.com/a", "https://example.com/b"],
  "tags": ["finance", "reports"]
}
  • A rule with Return Array on gives an array with one entry per matched element; with it off, a single value.
  • A selector that matches nothing yields an empty array when Return Array is on, and an empty value when it is off — extraction never fails just because the page changed shape.
  • When JSON Property points at an array of HTML strings, the node emits one output item per string, so a page-per-string crawl fans out automatically.
  • Binary data is forwarded unchanged.

Convert to HTML Table

One output item for the whole node run, whatever the input count. The item JSON holds a single field:

{
  "table": "<table ...><thead>…</thead><tbody>…</tbody></table>"
}

The column headers are the union of the keys found on the input items, and nothing from the input JSON is carried onto the output item. No binary is produced — pass the result to Convert to File if you need a downloadable .html.

Example Configuration

Render a simple template from item fields:

{
  "type": "html",
  "parameters": {
    "operation": "generateHtmlTemplate",
    "html": "<h1>Hello {{ $json.name }}!</h1><p>Your email is {{ $json.email }}</p>",
    "maxConcurrency": 10
  }
}

Render a full document and save it as a downloadable file:

{
  "type": "html",
  "parameters": {
    "operation": "generateHtmlTemplate",
    "html": "<!DOCTYPE html><html><head><title>{{ $json.title }}</title></head><body><h1>{{ $json.heading }}</h1><p>{{ $json.content }}</p></body></html>",
    "outputAsBinary": true,
    "binaryPropertyName": "htmlDocument",
    "fileName": "report.html",
    "maxConcurrency": 5
  }
}

Extract a title, every link and the paragraph text from an HTML string on the item:

{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "json",
    "dataPropertyName": "htmlContent",
    "extractionValues": {
      "values": [
        {
          "key": "title",
          "cssSelector": "h1",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "links",
          "cssSelector": "a",
          "returnValue": "attribute",
          "attribute": "href",
          "returnArray": true
        },
        {
          "key": "paragraphs",
          "cssSelector": "p",
          "returnValue": "text",
          "skipSelectors": ".exclude",
          "returnArray": true
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": true
    }
  }
}

Extract from an uploaded HTML file instead:

{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "binary",
    "dataPropertyName": "uploadedFile",
    "extractionValues": {
      "values": [
        {
          "key": "productName",
          "cssSelector": ".product-title",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "price",
          "cssSelector": ".price",
          "returnValue": "text",
          "returnArray": false
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": false
    },
    "maxConcurrency": 3
  }
}

Scrape several fields out of a fetched page body:

{
  "type": "html",
  "parameters": {
    "operation": "extractHtmlContent",
    "sourceData": "json",
    "dataPropertyName": "response.body",
    "extractionValues": {
      "values": [
        {
          "key": "headline",
          "cssSelector": "h1.main-title",
          "returnValue": "text",
          "returnArray": false
        },
        {
          "key": "publishDate",
          "cssSelector": ".publish-date",
          "returnValue": "attribute",
          "attribute": "datetime",
          "returnArray": false
        },
        {
          "key": "tags",
          "cssSelector": ".tag",
          "returnValue": "text",
          "returnArray": true
        },
        {
          "key": "content",
          "cssSelector": ".article-body",
          "returnValue": "html",
          "skipSelectors": ".advertisement, .related-links",
          "returnArray": false
        }
      ]
    },
    "options": {
      "trimValues": true,
      "cleanUpText": true
    }
  }
}

Build a fully styled table from every input item:

{
  "type": "html",
  "parameters": {
    "operation": "convertToHtmlTable",
    "tableOptions": {
      "capitalize": true,
      "customStyling": true,
      "caption": "Sales Report",
      "tableAttributes": "class=\"data-table\" id=\"sales\"",
      "headerAttributes": "class=\"table-header\"",
      "rowAttributes": "class=\"table-row\"",
      "cellAttributes": "class=\"table-cell\""
    },
    "maxConcurrency": 1
  }
}

Build a table with the built-in default styling:

{
  "type": "html",
  "parameters": {
    "operation": "convertToHtmlTable",
    "tableOptions": {
      "capitalize": false,
      "customStyling": false
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

This tool generates HTML from templates, extracts data from HTML using CSS selectors, and converts JSON items into an HTML table. It is ideal when you need to dynamically create HTML content, parse existing HTML for specific information, or present structured data in a tabular HTML format. The tool produces rendered HTML as JSON, extracted data as JSON, or an HTML table as JSON, with an option to output generated HTML as a binary .html file.

Common Patterns

  • Dynamic email templates — render personalised HTML per item with {{ $json.firstName }}-style placeholders, then hand the result to an email node.
  • Web scraping — chain HTTP Request into Extract HTML Content, pointing JSON Property at the response body and defining one extraction rule per field you want.
  • Data reports — feed a query result into Convert to HTML Table with Capitalize Headers on for a presentable report.

Parameter Dependencies

  • Generate HTML Template: Output as Binary, Binary Property and File Name work together for file output.
  • Extract HTML Content: Source Data decides whether Input Binary Field or JSON Property is used; Extraction Values defines what to extract; Options refines whitespace handling.
  • Convert to HTML Table: everything is optional and only affects styling.

Notes

  • HTML Template takes platform expressions only — {{ $json.field }} and the like. Templating-language constructs such as loops or conditionals are not evaluated and will appear literally in the output.
  • text extraction concatenates the text of every matched element unless Return Array is on. When a selector can match more than one element, turn Return Array on to keep the values separate.
  • Skip Selectors removes matching child elements before text is read, which is the cleanest way to drop adverts and navigation from an article body.

Frequently asked questions

How do I build a personalised email body?

Use the template mode with expression placeholders such as `{{ $json.firstName }}`, which are resolved per item, then pass the rendered HTML to an email node.

How do I scrape a page with this?

Chain HTTP Request into the extract mode, point JSON Property at the response body, and define one extraction rule per field you want. Each rule maps a CSS selector to an output key.

Can it turn query results into a table?

Yes — feed items into Convert to HTML Table, and turn on Capitalize Headers if you want the column names tidied for a report.

Does it need credentials?

No. Everything it does is local transformation, so there is nothing to authenticate.

Build with the HTML node

Drop it into a workflow, wire it to an agent, or call it on a schedule.

Open BusyBot

Last reviewed . Spotted something wrong? Tell us.