n8n-nodes-docx2md2html
v0.1.1
Published
n8n community node to convert between DOCX, Markdown, and HTML formats
Readme
n8n-nodes-docx2md
An n8n community node for converting between DOCX, Markdown, and HTML formats — in both directions.
n8n is a fair-code licensed workflow automation platform.
Installation Operations Compatibility Usage Resources Version history
Installation
Follow the installation guide in the n8n community nodes documentation.
Note: This node uses external npm dependencies (
mammoth,marked,html-to-docx) and therefore runs on self-hosted n8n only. It is not compatible with n8n Cloud.
Operations
| Operation | Input | Output |
| ------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| DOCX → Markdown | Binary DOCX file | Markdown text (JSON field) + optional binary .md file |
| DOCX → HTML | Binary DOCX file | HTML text (JSON field) + optional binary .html file |
| Markdown → DOCX | Markdown text (typed, JSON field, or binary .md file) | Binary DOCX file |
| HTML → DOCX | HTML text (typed, JSON field, or binary .html file) | Binary DOCX file |
DOCX → Markdown
Converts a DOCX binary file to Markdown text using mammoth.
| Parameter | Description |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Input Binary Field | Name of the binary field holding the DOCX file (default: data) |
| Output JSON Field | JSON property name to store the Markdown string (default: markdown) |
| Extract Images | When enabled, extracts embedded images; the output field becomes { markdown, images } with  references |
| Output Binary .md File | Also attach the Markdown as a binary .md file |
| Output Markdown Binary Field | Binary field name for the output .md file (default: markdown) |
DOCX → HTML
Converts a DOCX binary file to HTML using mammoth.
| Parameter | Description |
| ------------------------ | ----------------------------------------------------------------------------------------------------------- |
| Input Binary Field | Name of the binary field holding the DOCX file (default: data) |
| Output JSON Field | JSON property name to store the HTML string (default: html) |
| Extract Images | When enabled, extracts embedded images; the output field becomes { html, images } with image_1 src keys |
| Output Binary .html File | Also attach the HTML as a binary .html file |
| Output HTML Binary Field | Binary field name for the output .html file (default: html) |
Markdown → DOCX
Converts Markdown text to a DOCX file using marked + html-to-docx.
| Parameter | Description |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Markdown Source | Where to read Markdown from: Enter Markdown (editor), JSON Text Field, or Binary File |
| Markdown / Markdown Field Name / Input Binary Field | Depends on the chosen source |
| Output DOCX Binary Field | Binary field name for the generated DOCX file (default: data) |
| Output File Name | File name for the DOCX (default: output.docx) |
HTML → DOCX
Converts HTML text to a DOCX file using html-to-docx.
| Parameter | Description |
| ------------------------------------------- | ----------------------------------------------------------------------------------- |
| HTML Source | Where to read HTML from: Enter HTML (editor), JSON Text Field, or Binary File |
| HTML / HTML Field Name / Input Binary Field | Depends on the chosen source |
| Output DOCX Binary Field | Binary field name for the generated DOCX file (default: data) |
| Output File Name | File name for the DOCX (default: output.docx) |
Compatibility
- Requires self-hosted n8n (not compatible with n8n Cloud due to external dependencies)
- Tested with n8n v1.x
Usage
Convert a DOCX attachment to Markdown:
- Add a trigger that receives a DOCX file (e.g. Email trigger or HTTP webhook)
- Add the DOCX ↔ Markdown ↔ HTML node
- Set Operation to
DOCX → Markdown - Set Input Binary Field to the binary field name holding the DOCX
- The output item will contain a
markdownJSON field with the converted text
Generate a DOCX from Markdown:
- Provide Markdown text via any upstream node
- Add the DOCX ↔ Markdown ↔ HTML node
- Set Operation to
Markdown → DOCX - Set Markdown Source to
JSON Text Fieldand enter the field name - The output item will contain a binary DOCX file in the configured output field
Resources
- n8n community nodes documentation
- mammoth.js – DOCX to HTML/Markdown
- marked – Markdown parser
- html-to-docx – HTML to DOCX converter
Version history
0.1.0
Initial release. Supports four operations:
- DOCX → Markdown
- DOCX → HTML
- Markdown → DOCX
- HTML → DOCX
