Update Headers and Footers in Word in n8n
What this node does
PDF4me - Update Headers Footers in Word Document adds or replaces headers and footers in any DOCX file inside your n8n workflow. Supply HTML or plain text content for all pages, the first page, or separate odd/even pages. Use built-in tokens like PAGE and NUMPAGES to insert automatic page numbers. The node returns an updated DOCX with the new headers and footers applied - body content is completely preserved. Route the output to cloud storage, email, or any further document step.
Authenticating Your API Request
Every PDF4me node in n8n requires valid Credentials. Create or select credentials that hold your PDF4me API key so the node can authenticate document formatting requests securely.
Important Facts You Should Not Miss
PAGE and NUMPAGES anywhere in your header or footer content. Word replaces them with the actual page number and total page count when the document is opened. So Page PAGE of NUMPAGES renders as Page 3 of 12 on page three of a twelve-page document - no manual updating needed.
Set the input source, enter HTML or plain text in the header and footer fields, use PAGE/NUMPAGES tokens for page numbers, and execute. The updated DOCX is available in the binary output.
Parameters
Required: Input Data Type, the document source field matching that type (Input Binary Field, Base64 Word Content, or Word Document URL), and Word Document Name. All header and footer content fields are optional - fill only the ones you need.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Input Data Type | Yes | Format of the source DOCX. Binary Data maps the file from a prior node; Base64 String accepts encoded content; URL fetches from a public address. | Binary Data |
| Input Binary Field | Yes (Binary) | Binary property name from the prior node holding the DOCX. | data |
| Base64 Word Content | Yes (Base64) | Base64-encoded DOCX string to process. | UEsDBBQABgAI... |
| Word Document URL | Yes (URL) | Publicly accessible URL to the source DOCX. | https://example.com/report.docx |
| Word Document Name | Yes | Filename of the input DOCX including .docx extension. Used for format detection. | report.docx |
| All Pages Header | No | Header content applied to every page. Accepts HTML with inline styles or plain text. Supports PAGE, NUMPAGES, SECTION, SECTIONPAGES tokens. | <div style='text-align:center'>Acme Corp</div> |
| All Pages Footer | No | Footer content applied to every page. Accepts HTML or plain text with the same token support. | Page PAGE of NUMPAGES |
| First Page Header | No | Header used only on the first page - useful for title pages and cover sheets. Leave All Pages Header empty when using this for a unique first-page look. | <div style='text-align:center'>Confidential</div> |
| First Page Footer | No | Footer used only on the first page. | Draft - Not for Distribution |
| Even Pages Header | No | Header on even-numbered pages. Use with Odd Pages Header for two-sided print layouts. | <div style='text-align:right'>Chapter Title</div> |
| Even Pages Footer | No | Footer on even-numbered pages. | <div style='text-align:center'>Page PAGE</div> |
| Odd Pages Header | No | Header on odd-numbered pages. | <div style='text-align:left'>Report Title</div> |
| Odd Pages Footer | No | Footer on odd-numbered pages. | <div style='text-align:center'>Page PAGE</div> |
| Culture Name | No | Culture/locale code for date and number formatting inside headers. Defaults to null. | en-US |
Quick Setup
- Add a PDF4me node and select Update Headers Footers in Word Document.
- Choose or create Credentials with your PDF4me API key.
- Set Input Data Type and map the DOCX from the prior node.
- Enter Word Document Name with
.docxextension. - Fill All Pages Header and/or All Pages Footer with HTML or plain text content. Use
PAGEandNUMPAGESfor page numbers. - Click Execute Node. The output binary contains the updated DOCX.
Workflow Examples
Workflow ExamplesCommon n8n workflow patterns using Update Headers Footers in Word.
- A scheduled trigger generates a monthly performance report DOCX from a template.
- Update Headers Footers in Word Document adds a centered company logo placeholder and name in the header, and a footer with the report date and "Page PAGE of NUMPAGES."
- The branded DOCX is uploaded to SharePoint in the monthly reports library.
- Teams notifies the management channel that the branded report is ready.
- Airtable triggers when a contract record status changes to "Ready to Send."
- Google Drive downloads the contract DOCX.
- Update Headers Footers applies a footer with "CONFIDENTIAL - Page PAGE of NUMPAGES" to every page and a unique first-page header with the client name pulled from Airtable.
- Gmail sends the branded contract as an attachment to the client.
- A webhook receives a new chapter DOCX from the writing tool.
- Update Headers Footers sets left-aligned Odd Pages Header with the chapter title and right-aligned Even Pages Header with the book title.
- Both even and odd footers show the page number centered for mirrored two-sided printing.
- The formatted chapter is saved to Dropbox and a Slack message alerts the editorial team.