npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-docx-ooxml

v0.1.2

Published

n8n community node for creating DOCX/OOXML documents using docx.js

Downloads

23

Readme

n8n-nodes-docx-ooxml

This is an n8n community node that lets you create DOCX/OOXML documents using the powerful docx.js library in your n8n workflows.

Generate professional Word documents from your workflow data with high-level support for paragraphs, headings, tables, text formatting, and more.

n8n is a fair-code licensed workflow automation platform.

Installation | Operations | Usage | Examples | Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Community Node Name: n8n-nodes-docx-ooxml

Operations

Create Document

Create a new DOCX document from structured data with the following features:

  • Document metadata: Set title and creator
  • Content sources: Use input data or provide custom JSON
  • Output formats: Binary DOCX file, Raw OOXML (XML), Base64, or Buffer
  • Rich formatting: Headings, alignment, bold, italic, underline, colors
  • Tables: Create structured tables with custom widths
  • Paragraphs: Multiple text runs with different styles

Credentials

No credentials required. This node works entirely locally within your n8n instance.

Compatibility

  • Minimum n8n version: 1.0.0
  • Tested with: n8n 1.x
  • Dependencies: docx.js v9.5.1+

Usage

Basic Usage

  1. Add the DOCX OOXML node to your workflow
  2. Select Create Document operation
  3. Choose your content source (Input Data or Custom JSON)
  4. Configure output format (Binary DOCX, OOXML, Base64, or Buffer)
  5. Execute the workflow

Content Structure

The node accepts structured JSON data to define document content:

{
  "sections": [
    {
      "paragraphs": [
        {
          "text": "Hello World",
          "heading": "Heading1",
          "alignment": "center"
        },
        {
          "children": [
            {
              "text": "Bold text",
              "bold": true
            },
            {
              "text": " and ",
              "italics": true
            },
            {
              "text": "colored text",
              "color": "FF0000"
            }
          ]
        }
      ],
      "tables": [
        {
          "rows": [
            {
              "cells": ["Header 1", "Header 2", "Header 3"]
            },
            {
              "cells": ["Row 1 Col 1", "Row 1 Col 2", "Row 1 Col 3"]
            }
          ]
        }
      ]
    }
  ]
}

Supported Properties

Paragraph Properties

  • text: String or array of text runs
  • heading: "Heading1" through "Heading6"
  • alignment: "left", "center", "right", "justified"
  • pageBreak: Boolean for page break before paragraph

Text Run Properties

  • text: The text content
  • bold: Boolean
  • italics: Boolean
  • underline: Boolean
  • color: Hex color code (e.g., "FF0000")
  • size: Font size
  • font: Font family name

Table Properties

  • rows: Array of row objects
  • cells: Array of cell content (strings or objects)
  • width: Cell width percentage

Examples

Example 1: Simple Document from Input Data

Input data:

{
  "title": "Report",
  "content": "This is a simple report."
}

The node will automatically convert this to a document with key-value pairs.

Example 2: Structured Document with Custom JSON

{
  "sections": [
    {
      "paragraphs": [
        {
          "text": "Sales Report Q4 2024",
          "heading": "Heading1",
          "alignment": "center"
        },
        {
          "text": "Executive Summary",
          "heading": "Heading2"
        },
        {
          "children": [
            {
              "text": "Total Revenue: ",
              "bold": true
            },
            {
              "text": "$1,234,567",
              "color": "00FF00"
            }
          ]
        }
      ],
      "tables": [
        {
          "rows": [
            {
              "cells": ["Product", "Units Sold", "Revenue"]
            },
            {
              "cells": ["Product A", "1,000", "$50,000"]
            },
            {
              "cells": ["Product B", "2,500", "$125,000"]
            }
          ]
        }
      ]
    }
  ]
}

Example 3: Output as Binary File

Set Output Format to "Binary (DOCX)" and Binary Property Name to "data". The document will be available as a downloadable file in subsequent nodes.

Example 4: Output as Raw OOXML (XML)

Set Output Format to "OOXML (Raw XML)" to extract the raw XML content from the DOCX package. The output will include:

{
  "ooxml": {
    "word/document.xml": "<w:document xmlns:w=\"...\">...</w:document>",
    "word/styles.xml": "...",
    "[Content_Types].xml": "...",
    "_rels/.rels": "..."
  },
  "mainDocument": "<w:document xmlns:w=\"...\">...</w:document>",
  "files": ["word/document.xml", "word/styles.xml", ...]
}

Key OOXML files extracted:

  • word/document.xml - Main document content (also available in mainDocument field)
  • word/styles.xml - Document styles
  • word/numbering.xml - Numbering definitions
  • word/settings.xml - Document settings
  • word/_rels/document.xml.rels - Relationships
  • [Content_Types].xml - Content types
  • _rels/.rels - Package relationships

This is useful for:

  • Office.js Integration: Use with insertOoxml() to insert content into Word documents
  • Inspecting the raw OOXML structure
  • Processing XML content with other tools
  • Understanding document structure
  • Debugging document generation

Office.js Example:

// Insert OOXML into Word using Office.js
await Word.run(async (context) => {
    const range = context.document.getSelection();
    range.insertOoxml(data.mainDocument, Word.InsertLocation.replace);
    await context.sync();
});

See examples/officejs-integration.md for complete integration guide.

Resources

Version History

0.1.0 (Initial Release)

  • Create DOCX documents from structured data
  • Support for paragraphs, headings, and tables
  • Rich text formatting (bold, italic, underline, colors)
  • Multiple output formats (Binary DOCX, Raw OOXML/XML, Base64, Buffer)
  • Extract raw OOXML XML content from generated documents
  • Based on docx.js v9.5.1 and jszip