Skip to main content

Add Header

Adds a header to a Google Docs document.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Document Id - The ID of the Google Docs document to add a header to.
  • Text - The text content for the header.
  • Font Size - The font size for the header text.
  • Font Name - The font family for the header text. Default is "Times New Roman".

Options

  • Overwrite If Exists - Whether to overwrite an existing header if one already exists. Default is false.
  • Align - The alignment of the header text. Options are:
    • Left (START)
    • Center (CENTER)
    • Right (END)
    • Justify (JUSTIFIED)
  • Bold - Whether to make the header text bold. Default is false.
  • Italic - Whether to make the header text italic. Default is false.
  • Underline - Whether to underline the header text. Default is false.

How It Works

The Add Header node integrates with Google Docs to add a header to a document. When executed, the node:

  1. Validates the provided inputs (Document Id, Text, Font Size, Font Name)
  2. Connects to the specified Google Docs document
  3. Optionally deletes any existing header if Overwrite If Exists is enabled
  4. Creates a new header section in the document
  5. Inserts the specified text into the header
  6. Applies the specified formatting options (font, size, alignment, styling)

Requirements

  • A valid Google Docs document ID
  • Valid Google Docs credentials
  • Text content for the header
  • Valid font size value
  • Valid Google Docs permissions to modify the document

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Document Id
  • Empty or invalid Text content
  • Empty or invalid Font Size
  • Google Docs service errors
  • Insufficient permissions to modify the document

Usage Notes

  • The Document Id can be found in the URL of the Google Docs document
  • If Overwrite If Exists is disabled and a header already exists, the node may fail
  • The Font Name should be a valid Google Docs font family
  • The Align option controls how the header text is positioned within the header
  • Styling options (Bold, Italic, Underline) can be combined
  • The header will be added to the top of each page in the document