Skip to main content
This page covers the low-level headless Editor approach. For production AI agent workflows, use the Document Engine AI tools instead — they provide structured tool definitions, provider-ready schemas, and built-in dispatch.
SuperDoc can run headless in Node.js for server-side document processing, AI agent workflows, and batch automation.

Quick example

Content formats

See Import/Export for format details, limitations, and guidance on choosing a format.

AI redlining with track changes

Use suggesting mode so AI edits appear as tracked changes that users can accept or reject:

Programmatic block access

For multi-step workflows — extract block references, send them to an LLM, then apply edits — use the Document API. It returns stable block addresses that work across separate editor sessions:
Block addresses from doc.find() prefer DOCX-native IDs (paraId) for imported blocks. This is the best available cross-session anchor, but no ID is guaranteed to survive all Word round-trips. Don’t read node.attrs.sdBlockId directly — it’s regenerated on every load.

LLM quick reference

Point your AI assistant at these URLs for SuperDoc context:

Next steps

Document API

Stable block addressing, find/replace, and programmatic edits

SuperEditor API

Headless mode, Editor.open(), and programmatic control

Import/Export

Content formats, export options, and round-trip behavior

AI Redlining (Headless)

Node.js script: open DOCX, LLM reviews, export redlined document