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.

Payload arrives--▶Markdown converts--▶Downstream receives

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.

textExample
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.

textExample
Input:  <h1>Hello World</h1><p>This is <strong>bold</strong>.</p>
Output: # Hello World\n\nThis is **bold**.

Configuration

FieldTypeDefaultDescription
namestringDisplay name for the node
modeenummd-to-htmlmd-to-html or html-to-md
sourceFieldstringbodyField path in the payload to convert. Supports {{payload.field}} syntax — you can copy the path directly from the Input Section schema view
outputFieldstringconvertedField name for the converted output
sanitizebooleantrueSanitize HTML output to prevent XSS (recommended for md-to-html)
gfmbooleantrueEnable GitHub Flavored Markdown: tables, checkboxes, strikethrough, autolinks
The 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.

jsonSingle string output
{
  "_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.

jsonArray output
{
  "_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.

textPipeline
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.

textPipeline
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.

textPipeline
Webhook (URL) --> HTTP Action (GET page) --> Markdown (HTML->MD) --> MongoDB (store)

Documentation Generation

Convert Markdown documentation to HTML and push to a content API.

textPipeline
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.

Only disable sanitization if you fully trust the source content and need to preserve custom HTML elements or inline styles.

API Reference

Create

bashCreate a Markdown node
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

bashTest execution
curl -X POST /api/markdown-nodes/:id/test \
  -H "Authorization: Bearer hwk_..." \
  -d '{ "payload": { "body": "# Hello\n\nWorld" } }'