// FIELD NOTES — AI & AUTOMATION
The n8n HTML node, used as a templating layer.
JSON is a transport, not a presentation layer. Drop the HTML node between data-shaping and delivery; treat it like a view. Same workflow, ten lines of template, one platform-appropriate output.
// CONTEXT
The output looked like garbage every time it left the platform.
I've been running n8n in production for a year now — for editorial automation, internal ops, and the AI-assisted content pipelines I build for clients. About six months in, I hit the same problem on three different workflows: the output looked like garbage every time it left the platform.
JSON with literal \nsequences. Markdown that got mangled in Notion. Plain-text descriptions where every "smart quote" turned into ’. The fix turned out to be simpler than I expected.
// READ THIS IF
You've shipped at least one n8n workflowand you've noticed your output goes weird the moment it leaves the platform. If you haven't shipped one yet — start with the basics first.
// THE FIX
JSON is a transport.
HTML is a presentation layer.
The HTML node is usually framed as "scrape a page." But it's also a Handlebars-flavoured template renderer. Pipe any upstream JSON into it; get formatted output the next node can consume.
// 1. Set node output mode to "HTML" // 2. Paste this template: {{#each items}} <h3>{{title}}</h3> <p>{{description}}</p> <a href="{{url}}">Read more →</a> {{/each}} // 3. Next node receives rendered string.
The mental shift is treating the HTML node like a view in MVC. Upstream nodes do the work. The HTML node does the presentation. Downstream nodes do the delivery.
// PATTERN
Four destinations.
One template each.
YouTube descriptions
YouTube strips tags but respects line breaks. Use the HTML node to render structured chapters, then YouTube's API stores plain text with real newlines — not literal \n characters. Pair with the YouTube node and you can ship descriptions straight from your transcript workflow.
Branch the same HTML output into all four. No transforms per destination. No code-node sprawl.
// DESTINATIONS
Where it earns its keep.
| // DESTINATION | NATIVE FORMAT | HTML NODE FIT ★ | NOTES |
|---|---|---|---|
| YouTube | Plain text | STRONG | Line breaks survive |
| Gmail | HTML email | NATIVE | Pipes straight in |
| Notion | Markdown | SKIP | Use Markdown instead |
| Slack | Block Kit | SKIP | Block Kit is structured |
| WordPress | HTML | NATIVE | Drop into post body |
// THE COMMANDMENTS
Do this.
Not that.
{{#if}} three levels deep, refactor.// SKIP THIS WHEN
Your template would be larger than your data. Three fields? Use String.template in a Code node.
// FAQ
Quick reference.
Q.01Does this work in self-hosted n8n and n8n Cloud?
Yes — the HTML node is a core node, available in both. No plugin or community node required.
Q.02Can I use it for emails with inline CSS?
Absolutely. Drop your inline-CSS email template in directly. Pair it with the Gmail or SMTP node and you've got a workflow-driven newsletter.
Q.03What about more complex logic — conditionals, loops?
Handlebars syntax handles {{#if}}, {{#each}}, and helpers. For anything beyond that, do the data work in a Code node first and keep the template dumb.
Q.04What's the latency cost?
Negligible — the HTML node is in-process template rendering. Single-digit milliseconds for any sane template size.
// END OF FILE
Try this on your next workflow.
// GROWTH SIGNAL · WEEKLY
More workflow tricks, every Tuesday.
SEO, AI automation, and the playbooks I actually run for clients. One email a week, no fluff.