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-track-changes

v0.2.1

Published

n8n community node for extracting revisions (track changes) and comments from Microsoft Word (.docx) documents

Readme

n8n-nodes-docx-track-changes

n8n.io - Workflow Automation npm License

This is an n8n community node that extracts revisions (track changes) and comments from Microsoft Word (.docx) documents.

Perfect for automating document review workflows, contract management, and approval processes.

n8n is a fair-code licensed workflow automation platform.

Features

  • Extract Revisions - Get all tracked changes (insertions and deletions) with author, timestamp, and unique ID
  • Extract Comments - Get all comments with replies, resolution status, and target text
  • Accept Revisions - Accept specific revisions by ID or accept all at once
  • Reject Revisions - Reject specific revisions by ID or reject all at once
  • Get Stats - Get combined revision and comment statistics with optional author breakdown
  • Context Support - Include surrounding text for each revision
  • Summary Statistics - Get counts by type, author, and status
  • AI Agent Compatible - Use as a tool in AI workflows (usableAsTool: true)

Compatibility

| Requirement | Version | |-------------|---------| | n8n | 1.0.0+ (tested on 2.2.0) | | Node.js | 18.17.0+ |

Note: This node uses external dependencies (jszip, fast-xml-parser) and is designed for self-hosted n8n. For n8n Cloud, only verified community nodes are supported.

Installation

Option 1: GUI Install (Recommended)

The easiest way to install on self-hosted n8n:

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-docx-track-changes
  4. Check "I understand the risks of installing unverified code from a public source"
  5. Select Install

Only Owner and Admin users can install community nodes.

Option 2: Manual Install (npm)

For n8n instances running in queue mode or when installing private packages:

# Access your n8n container
docker exec -it n8n sh

# Create nodes directory and install
mkdir -p ~/.n8n/nodes
cd ~/.n8n/nodes
npm install n8n-nodes-docx-track-changes

# Restart n8n to load the node

Option 3: Docker (Dockerfile)

For persistent installation in Docker deployments, create a custom Dockerfile:

FROM n8nio/n8n:latest

USER root
RUN cd /usr/local/lib/node_modules/n8n && \
    npm install n8n-nodes-docx-track-changes
USER node

Then update your docker-compose.yml:

services:
  n8n:
    build:
      context: .
      dockerfile: Dockerfile
    # ... rest of your configuration

Rebuild and restart:

docker compose down
docker compose up -d --build

Enabling AI Agent Tool Usage

To use this node as an AI Agent tool, set the environment variable:

N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

Operations

Extract Revisions

Extracts tracked changes (insertions and deletions) from a DOCX file.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Input Binary Field | string | data | Binary property containing the DOCX file | | Include Context | boolean | false | Include surrounding text for each revision | | Context Length | number | 50 | Characters to include before/after | | Include Summary | boolean | true | Include revision statistics |

Note: Set "Input Binary Field" to match the binary output property name from the previous node:

  • Read Binary File → default is data
  • HTTP Request → default is data
  • Form Trigger → use the fieldName you configured

Output Example:

{
  "revisions": [
    {
      "id": "123456789",
      "type": "insert",
      "text": "新しい条項",
      "author": "田中 太郎",
      "date": "2025-01-15T10:30:00Z",
      "paragraphIndex": 5,
      "context": {
        "before": "契約書の",
        "after": "について"
      }
    },
    {
      "id": "123456790",
      "type": "delete",
      "text": "旧条項",
      "author": "田中 太郎",
      "date": "2025-01-15T10:31:00Z",
      "paragraphIndex": 5,
      "context": null
    }
  ],
  "summary": {
    "totalRevisions": 15,
    "insertions": 12,
    "deletions": 3,
    "authors": ["田中 太郎", "鈴木 花子"]
  }
}

Extract Comments

Extracts comments and replies from a DOCX file.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Input Binary Field | string | data | Binary property containing the DOCX file | | Include Resolved | boolean | true | Include resolved comments | | Include Summary | boolean | true | Include comment statistics |

Output Example:

{
  "comments": [
    {
      "id": "1",
      "author": "田中 太郎",
      "date": "2025-01-15T10:30:00Z",
      "text": "この部分を確認してください",
      "targetText": "契約期間は1年間とする",
      "resolved": false,
      "replies": [
        {
          "id": "2",
          "author": "鈴木 花子",
          "date": "2025-01-15T11:00:00Z",
          "text": "確認しました。問題ありません。"
        }
      ]
    }
  ],
  "summary": {
    "totalComments": 5,
    "totalReplies": 3,
    "resolved": 2,
    "unresolved": 3,
    "authors": ["田中 太郎", "鈴木 花子"]
  }
}

Accept Revisions

Accepts tracked changes by ID or accepts all revisions at once. Outputs a modified DOCX file.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Input Binary Field | string | data | Binary property containing the DOCX file | | Accept All | boolean | false | Accept all revisions instead of specific IDs | | Revision IDs | string[] | [] | IDs of revisions to accept (from Extract Revisions) | | Output Binary Field | string | data | Binary property for the modified DOCX |

Output Example:

{
  "acceptedCount": 3,
  "acceptedIds": ["123456789", "123456790", "123456791"],
  "warningIds": []
}

The modified DOCX file is available in the specified binary output field.

Reject Revisions

Rejects tracked changes by ID or rejects all revisions at once. Outputs a modified DOCX file.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Input Binary Field | string | data | Binary property containing the DOCX file | | Reject All | boolean | false | Reject all revisions instead of specific IDs | | Revision IDs | string[] | [] | IDs of revisions to reject (from Extract Revisions) | | Output Binary Field | string | data | Binary property for the modified DOCX |

Output Example:

{
  "rejectedCount": 2,
  "rejectedIds": ["123456792", "123456793"],
  "warningIds": ["999999999"]
}

Note: warningIds contains IDs that were not found in the document.

Get Stats

Gets combined revision and comment statistics from a DOCX file.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Input Binary Field | string | data | Binary property containing the DOCX file | | Include Author Breakdown | boolean | false | Include per-author statistics |

Output Example:

{
  "revisions": {
    "total": 15,
    "insertions": 12,
    "deletions": 3,
    "authors": ["田中 太郎", "鈴木 花子"]
  },
  "comments": {
    "total": 5,
    "replies": 3,
    "resolved": 2,
    "unresolved": 3,
    "authors": ["田中 太郎", "鈴木 花子"]
  },
  "authorBreakdown": [
    {
      "author": "田中 太郎",
      "insertions": 8,
      "deletions": 2,
      "comments": 3
    },
    {
      "author": "鈴木 花子",
      "insertions": 4,
      "deletions": 1,
      "comments": 5
    }
  ]
}

Usage Examples

Basic Workflow

[Read Binary File] → [DOCX Revisions] → [IF] → [Slack/Email]
  1. Read Binary File - Load the DOCX file
  2. DOCX Revisions - Extract revisions or comments
  3. IF - Check if there are unresolved items
  4. Slack/Email - Notify reviewers

Contract Review Automation

[Webhook] → [DOCX Revisions (Extract Revisions)] → [Code] → [Google Sheets]

Track all contract changes in a spreadsheet for audit purposes.

Comment Aggregation

[Google Drive Trigger] → [DOCX Revisions (Extract Comments)] → [Filter] → [Notion]

Automatically collect unresolved comments from shared documents.

Automated Revision Approval

[Webhook] → [DOCX Revisions (Extract Revisions)] → [Code (Filter by author)] → [DOCX Revisions (Accept Revisions)] → [Google Drive]

Automatically accept revisions from trusted authors and save the cleaned document.

Development

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Run tests
pnpm test

# Build for production
pnpm build

# Lint code
pnpm lint

Resources

License

MIT

Author

ryoooo


Made with ❤️ for the n8n community