n8n community node for extracting revisions (track changes) and comments from Microsoft Word (.docx) documents
npm install 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.
- 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)
| 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.
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.
For n8n instances running in queue mode or when installing private packages:
``bashAccess your n8n container
docker exec -it n8n sh
$3
For persistent installation in Docker deployments, create a custom Dockerfile:
`dockerfile
FROM n8nio/n8n:latestUSER root
RUN cd /usr/local/lib/node_modules/n8n && \
npm install n8n-nodes-docx-track-changes
USER node
`Then update your
docker-compose.yml:`yaml
services:
n8n:
build:
context: .
dockerfile: Dockerfile
# ... rest of your configuration
`Rebuild and restart:
`bash
docker compose down
docker compose up -d --build
`$3
To use this node as an AI Agent tool, set the environment variable:
`bash
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
`Operations
$3
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 configuredOutput Example:
`json
{
"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": ["田中 太郎", "鈴木 花子"]
}
}
`$3
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:
`json
{
"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": ["田中 太郎", "鈴木 花子"]
}
}
`$3
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:
`json
{
"acceptedCount": 3,
"acceptedIds": ["123456789", "123456790", "123456791"],
"warningIds": []
}
`The modified DOCX file is available in the specified binary output field.
$3
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:
`json
{
"rejectedCount": 2,
"rejectedIds": ["123456792", "123456793"],
"warningIds": ["999999999"]
}
`> Note:
warningIds contains IDs that were not found in the document.$3
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:
`json
{
"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
$3
`
[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
$3
`
[Webhook] → [DOCX Revisions (Extract Revisions)] → [Code] → [Google Sheets]
`Track all contract changes in a spreadsheet for audit purposes.
$3
`
[Google Drive Trigger] → [DOCX Revisions (Extract Comments)] → [Filter] → [Notion]
`Automatically collect unresolved comments from shared documents.
$3
`
[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
`bash
Install dependencies
pnpm installStart development server
pnpm devRun tests
pnpm testBuild for production
pnpm buildLint code
pnpm lint
``- n8n Community Nodes Documentation
- Creating n8n Nodes
- OpenXML Track Changes Specification
ryoooo
---
Made with ❤️ for the n8n community