Markdown Node
Bidirectional conversion between Markdown and HTML inside your pipelines. Convert webhook content to rich HTML for emails, or strip HTML to clean Markdown for Slack, databases, or documentation. Supports GitHub Flavored Markdown (tables, checkboxes, strikethrough) and automatic XSS sanitization.
Overview
The Markdown node is a processing node that transforms content between Markdown and HTML formats. It reads a field from the incoming payload, converts it, and outputs the result for downstream nodes. The node appears on the canvas with an indigo color.
Modes
Markdown to HTML
Converts Markdown content to HTML. Uses the marked parser with optional GFM extensions (tables, checkboxes, strikethrough). Output is sanitized by default to prevent XSS attacks — safe for rendering in emails, dashboards, or web pages.
Input: # Hello World\n\nThis is **bold** and *italic*.\n\n- Item 1\n- Item 2
Output: <h1>Hello World</h1>\n<p>This is <strong>bold</strong> and <em>italic</em>.</p>\n<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n</ul>HTML to Markdown
Converts HTML content to clean Markdown. Strips non-content elements (scripts, styles, navigation) before conversion. Uses the turndown library with ATX-style headings and fenced code blocks. Great for storing CMS content as Markdown, sending to Slack, or generating documentation.
Input: <h1>Hello World</h1><p>This is <strong>bold</strong>.</p>
Output: # Hello World\n\nThis is **bold**.Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| name | string | — | Display name for the node |
| mode | enum | md-to-html | md-to-html or html-to-md |
| sourceField | string | body | Field path in the payload to convert. Supports {{payload.field}} syntax — you can copy the path directly from the Input Section schema view |
| outputField | string | converted | Field name for the converted output |
| sanitize | boolean | true | Sanitize HTML output to prevent XSS (recommended for md-to-html) |
| gfm | boolean | true | Enable GitHub Flavored Markdown: tables, checkboxes, strikethrough, autolinks |
sourceField accepts template syntax. If the upstream node outputs {{ payload.content }}, set sourceField to content or {{payload.content}} — both work.Output Payload
Single String Input
When sourceField points to a string, the output contains the converted content.
{
"_meta": { "iterable": false, "count": 1 },
"converted": "<h1>Hello</h1>\n<p>World</p>",
"mode": "md-to-html",
"sourceField": "body"
}Array Input
When sourceField points to an array of strings, each item is converted individually. The output is marked as iterable so downstream nodes process each result separately.
{
"_meta": { "iterable": true, "iterateField": "results", "count": 3 },
"results": [
{ "converted": "<h1>Page 1</h1>", "mode": "md-to-html" },
{ "converted": "<h1>Page 2</h1>", "mode": "md-to-html" },
{ "converted": "<h1>Page 3</h1>", "mode": "md-to-html" }
]
}Use Cases
Rich HTML Emails
Convert Markdown content from a webhook (GitHub PR body, CMS update) to HTML for beautiful email notifications.
Webhook (GitHub PR) --> Markdown (body MD->HTML) --> Email Action (send HTML email)Clean Slack Messages
Strip HTML from CMS or form submissions to clean Markdown for Slack notifications.
Webhook (CMS webhook) --> Markdown (content HTML->MD) --> Notification (Slack)Web Scraping to Markdown
Convert raw HTML from an HTTP Action or Firecrawl scrape into clean Markdown for storage or further processing.
Webhook (URL) --> HTTP Action (GET page) --> Markdown (HTML->MD) --> MongoDB (store)Documentation Generation
Convert Markdown documentation to HTML and push to a content API.
Scheduled Workflow --> HTTP Action (fetch .md) --> Markdown (MD->HTML) --> HTTP Action (POST to CMS)HTML Sanitization
When sanitize is enabled (default), the HTML output is cleaned to prevent XSS attacks. Allowed tags include standard content tags (headings, paragraphs, lists, tables, images, links) plus input for GFM checkboxes. Scripts, iframes, event handlers, and other potentially dangerous content is stripped.
API Reference
Create
curl -X POST /api/markdown-nodes \
-H "Authorization: Bearer hwk_..." \
-d '{
"name": "Convert to HTML",
"mode": "md-to-html",
"sourceField": "body",
"outputField": "converted",
"sanitize": true,
"gfm": true
}'Test
curl -X POST /api/markdown-nodes/:id/test \
-H "Authorization: Bearer hwk_..." \
-d '{ "payload": { "body": "# Hello\n\nWorld" } }'