Feature Request: Built-in HTML DOM Manipulation Support in n8n (beyond extraction, no regex)

The idea is:

Provide built-in support for safe and reliable HTML manipulation (DOM updates) in n8n workflows — beyond just HTML extraction. Specifically a way for Code/Function nodes to manipulate HTML without resorting to fragile regex, using proper DOM APIs or wrappers (e.g., Cheerio or equivalent) that are officially supported and configurable.

My use case:

I need to update parts of an HTML document (change styles, modify element structure, etc.) as part of a workflow. Using regex for HTML transforms is brittle and error-prone, so I want to use real DOM manipulation libraries. While it’s possible to install external libraries like cheerio in self-hosted setups, configuring them is confusing, inconsistent, and often fails because of module resolution and environment variable requirements (e.g., NODE_FUNCTION_ALLOW_EXTERNAL=cheerio doesn’t always work as expected in Code nodes).

I think it would be beneficial to add this because:

n8n today supports HTML extraction via its HTML/HTML Extract nodes and string manipulation via Code nodes, but there is no standard way to do structured HTML editing inside workflows.
Developers end up writing regex hacks or struggling with ad-hoc library installs. A built-in or officially supported pattern for DOM manipulation (similar to how extraction with selectors is supported) would reduce bugs and empower more advanced use cases like template transformations, inline editing of scraped content, HTML clean-up, and more. This also aligns with a broader ecosystem need for data transformation utilities in workflows.

Any resources to support this?

Here are relevant community threads showing the current limitations with trying to use DOM libraries like cheerio inside Code nodes:

  • “Can’t use cheerio inside code node” — users struggle to import modules due to env config limitations. Can't use cheerio inside code node
  • “Cannot find module ‘cheerio’ in Code Node on Self-Hosted Docker instance” — even with attempted env config, the Code node fails to locate the module. And the docs show that Code nodes can accept external modules on self-hosted setups, but it’s not straightforward and not documented well for real HTML manipulation workflows. Cannot find module 'cheerio' in Code Node on Self-Hosted Docker Instance

Are you willing to work on this?

Yes — I am open to contributing toward docs, example nodes, or feature implementation guidance to make this a first-class workflow capability.