office-tools

n8n community node for Office Tools REST API – document management, template rendering, and PDF export

Package Information

Released: 1 mo ago
Downloads: 4 weeklyΒ /Β 85 monthly
Latest Version: 0.1.1

Available Nodes

Documentation generating…

Documentation

@trg-admin/n8n-nodes-office-tools

npm version
License: MIT
n8n Community Node

An n8n community node for the Office Tools REST API β€” empowering automated document generation, AI-powered document creation, template rendering, revisions & tracked changes, full-text search, and asynchronous PDF export jobs.


πŸ“‘ Table of Contents


✨ Features

  • Document Processing & Conversion:
    • Convert HTML into clean DOCX documents.
    • Upload existing binary documents (DOCX, etc.) with metadata.
    • Download documents directly into n8n binary streams.
    • Replace document body content from raw HTML while preserving structure.
  • AI-Powered Document Generation:
    • Generate structured Word documents from JSON data payloads and plain-English prompts.
  • Template Rendering:
    • Dynamic template dropdown loader (loadOptions).
    • Extract template variable schemas and sample payloads.
    • Live render preview across formats (PDF, DOCX, XLSX, PPTX, ODT, ODS, ODP).
    • Synchronous and asynchronous document rendering with custom actor & metadata tagging.
  • Tracked Changes & Revisions:
    • Inspect revision histories and tracked changes.
    • Programmatically accept or reject revisions.
  • Text & Structure Manipulation:
    • Extract text with character offset and length limits.
    • Full-text search inside document bodies.
    • Batch apply text edit actions (insert, replace, delete).
  • Async Job & Artifact Handling:
    • Queue PDF export jobs and poll job status.
    • Download finished artifacts (PDF) directly into workflow binaries.

πŸ“¦ Installation

In n8n Community Nodes (Recommended)

  1. Go to Settings > Community Nodes in your n8n instance.
  2. Select Install a community node.
  3. Enter @trg-admin/n8n-nodes-office-tools.
  4. Accept the risk warning and click Install.

Manual / Docker Installation

Install the package inside your custom n8n Docker image or local node module directory:

npm install @trg-admin/n8n-nodes-office-tools

πŸ” Credentials & Setup

  1. In n8n, navigate to Credentials > New Credential.
  2. Search for and select Office Tools API (officeToolsApi).
  3. Fill in the required fields:
    • API Base URL: The base URL of your Office Tools server (e.g. http://localhost:18081 or https://office-tools.internal.yourdomain.com).
    • API Token: Bearer authentication token used to authorize requests.
    • Ignore SSL Issues: Toggle on if using self-signed certificates or internal staging environments.
  4. Save and test the connection.

πŸš€ Resources & Operations

1. Document

Manage documents, convert formats, inspect text, and apply tracked changes.

Operation Description Inputs / Parameters
List List all accessible documents in the system β€”
Get Fetch document metadata Document ID
Download Download document binary (DOCX) Document ID (Outputs binary property data)
Get Text Extract plaintext from document Document ID, Offset, Max Characters
Search Search for substring occurrences in document Document ID, Query, Max Results
Upload Upload binary file as a new document Binary Property, Department ID (optional), Metadata JSON (optional)
Create From HTML Convert HTML content to a new DOCX document HTML, Filename (optional), Metadata JSON (optional)
Generate Generate document using AI instructions and data Data (JSON), Instructions, Filename
Apply Actions Apply batch text modifications (insert, replace, delete) Document ID, Actions (JSON), Actor (JSON) (optional)
Replace HTML Replace document body content with HTML Document ID, HTML
List Revisions Retrieve revision history & tracked changes Document ID
Revisions Decide Accept or reject tracked changes Document ID, Decision (accept / reject)
Export to PDF Queue an asynchronous PDF conversion job Document ID (Returns job metadata)

Example: Apply Actions JSON

[
  {
    "type": "replace",
    "search": "{{CUSTOMER_NAME}}",
    "value": "Acme Corp",
    "position": "after"
  },
  {
    "type": "insert",
    "search": "Signature:",
    "value": " Signed electronically on 2026-09-15",
    "position": "after"
  }
]

2. Template

Work with predefined templates, extract variables, preview outputs, and render final documents.

Operation Description Inputs / Parameters
Get Fetch template metadata Template (dropdown)
Download Download raw template binary file Template (dropdown)
Get Variables Extract dynamic variables defined in the template Template (dropdown)
Sample Payload Generate an example JSON data payload for the template Template (dropdown)
Preview Render quick visual binary preview Template, Data (JSON), Output Format (PDF, DOCX, XLSX, PPTX, ODT, ODS, ODP)
Render to Document Render template into a new document Template, Data (JSON), Output Format (DOCX, PDF, XLSX, PPTX), Filename, Metadata (JSON), Actor (JSON), Async (boolean)

3. Job

Track and retrieve asynchronous export/rendering jobs.

Operation Description Inputs / Parameters
Get Status Check execution state and progress of an async job Job ID
Download Artifact Download completed job artifact (PDF) binary Job ID (Outputs binary property data)

πŸ’‘ Workflow Examples

Example 1: Generate a Document from HTML & Export to PDF

  1. Webhook / Trigger: Receive customer contract details.
  2. Office Tools (Document > Create From HTML): Convert formatted HTML template with customer variables into a DOCX document.
  3. Office Tools (Document > Export to PDF): Trigger PDF generation job.
  4. Office Tools (Job > Download Artifact): Fetch generated PDF artifact.
  5. Email / Slack Node: Send final PDF to customer.

Example 2: Populate a Template & Send Preview

  1. Office Tools (Template > Preview): Select template from dynamic dropdown and supply data JSON payload (outputFormat: pdf).
  2. Google Drive / WorkDrive / S3 Node: Upload binary output directly.

πŸ› οΈ Development & Building

# Navigate to package directory
cd office-tools

# Typecheck TypeScript definitions
npm run typecheck

# Build and package assets
npm run build

πŸ“¦ Publishing

To publish this package to the npm registry:

cd office-tools && npm publish --access public

πŸ“„ License

MIT

Discussion