Update Table of Contents using n8n action
PDF4me Update Table of Contents enables updating or creating Table of Contents in Word documents through n8n automation workflows with comprehensive formatting options and professional styling capabilities. This powerful TOC management feature supports automatic detection of existing TOC fields, customizable heading levels, hyperlink support, tab leader control, text case options, and culture localization with full control over TOC appearance and functionality, perfect for document navigation, professional formatting, and automated TOC generation.
Setup
Add the PDF4me "Update Table of Contents" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites:
- PDF4me API credentials
- n8n workflow access
Configuration:
- Add PDF4me node to workflow
- Select "Update Table of Contents" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Update Table of Contents action. Configure these parameters to control TOC generation and formatting.
Important: Parameters marked with an asterisk (***) are required. Advanced parameters provide fine-grained control over TOC formatting and appearance.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Word Document Input Format Selection • Choose the format of your Word document data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field*** | Binary | Binary Word File Input (Required if Binary Data) • Reference Word file (.docx, .doc) from previous n8n node or file upload • PDF4me processes binary Word files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Word Content*** | String | Base64 Encoded Word Input (Required if Base64 String) • Provide Word content (.docx, .doc) as base64 encoded string for secure transmission • PDF4me automatically decodes and processes the Word content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| Word Document URL*** | String | Public Word Document URL Input (Required if URL) • Provide a public/open permission URL to the Word file (.docx, .doc) to be processed • PDF4me downloads and processes the Word file from the provided URL • Required when Input Data Type is "URL" | https://abc.com/document.docx |
| Word Document Name*** | String | Word Document Input Filename • Specify the name of the input Word file with proper extension (.docx, .doc) • PDF4me uses this for format detection and processing optimization | document.docx |
| Heading Levels | String | Heading Levels to Include in TOC • Range format: "1-3" (includes heading levels 1, 2, and 3) • Single level: "1" (includes only heading level 1) • Multiple ranges: "1-2,4-6" (includes levels 1-2 and 4-6) • Default: "1-3" • Controls which heading levels appear in the TOC | "1-3" |
| Use Hyperlinks | Boolean | Include Hyperlinks in Table of Contents • Yes - TOC entries are clickable links to headings • No - TOC entries are plain text • Default: Yes | Yes |
| Hide Tab Leader | Boolean | Hide Tab Leader Dots • Yes - No dots between text and page numbers • No - Dots between text and page numbers • Default: Yes | Yes |
| Use Uppercase | Boolean | Use Uppercase for TOC Entries • Yes - TOC entries displayed in uppercase • No - TOC entries in original case • Default: Yes | Yes |
| Culture Name | String | Document Culture/Locale • Culture code for document processing (e.g., "en-US", "de-DE", "fr-FR") • Default: null (no culture-specific processing) • Affects document language and formatting | en-US |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Updated document filename - The name of the output Word document with updated table of contents | document_toc_updated.docx |
| fileSize | Number | File size in bytes - The size of the updated Word document in bytes | 13965 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the TOC update operation. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Word document filename - The name of the input Word document file | document.docx |
| headingLevels | Number | Heading levels included - The number of heading levels that were included in the table of contents | 3 |
| includePageNumbers | Boolean | Page numbers included - Whether page numbers were included in the table of contents | true |
| tabLeader | String | Tab leader style - The style of tab leader used in the table of contents (e.g., "Dots", "None", "Underscore") | Dots |
| cultureName | String | Document culture/locale - The culture code used for document processing (e.g., "en-US", "de-DE", "fr-FR") | en-US |
| message | String | Operation message - Descriptive message indicating the result of the TOC update operation | Table of Contents updated successfully |
N8N Action Response
The PDF4me Update Table of Contents API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"fileName": "document_toc_updated.docx",
"fileSize": 13965,
"success": true,
"originalFileName": "document.docx",
"headingLevels": 3,
"includePageNumbers": true,
"tabLeader": "Dots",
"cultureName": "en-US",
"message": "Table of Contents updated successfully"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | document_toc_updated.docx |
| fileSize | 13965 |
| success | true |
| originalFileName | document.docx |
| headingLevels | 3 |
| includePageNumbers | true |
| tabLeader | Dots |
| cultureName | en-US |
| message | Table of Contents updated successfully |
Schema View
The data structure and types of the response:
1 item
fileName: T document_toc_updated.docx
fileSize: # 13965
success: ☑ true
originalFileName: T document.docx
headingLevels: # 3
includePageNumbers: ☑ true
tabLeader: T Dots
cultureName: T en-US
message: T Table of Contents updated successfully
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Word document file data and metadata:
data
─────────────────────────────
File Name: document_toc_updated.docx
File Extension: docx
Mime Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
File Size: 13.6 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Enterprise Document Automation
- Document Navigation: Create navigable documents for easy access
- Professional Formatting: Apply consistent TOC formatting to all documents
- Academic Standards: Meet academic and professional document requirements
- Document Distribution: Send well-structured documents to stakeholders
AI-Powered Document Processing
- Multi-Format Support: Process Word documents in .docx and .doc formats
- Multi-Language Processing: Support for different languages and regions
- Intelligent Field Recognition: Automatically detect and update existing TOC fields
Business Intelligence and Analytics
- Document Management: Organize documents with proper navigation structure
- Compliance Monitoring: Ensure documents meet formatting requirements
- Performance Metrics: Track processing accuracy and efficiency