Skip to main content

Google Docs Writer

The Google Docs Writer node writes content to Google Docs documents. It can create new documents or update existing ones, with support for writing to specific tabs and accepting both plain text and Markdown input.

Prerequisites

  • A Google account with access to Google Docs
  • Google Docs integration configured in DNG Builder
  • Write access to the documents you want to update (for existing documents)

Inputs

content
string
required
Content to write to the Google Doc. This can be plain text or Markdown, depending on the input type setting. JSON content will be converted to plain text.

Parameters

Integration

integration_id
string
required
The Google Docs integration to use for authentication. Select your connected Google account from the dropdown.

Document Mode

create_new
boolean
Create a new document instead of editing an existing one. Default: false

New Document Settings

When create_new is true:
document_title
string
required
Title for the new Google Doc. You can use a static title or the variable {{documentTitle}} to pass the title dynamically from an upstream node.

Existing Document Settings

When create_new is false:
document_id
string
required
The ID of the Google Docs document to update. Use the document picker to browse and select a document from your Google Drive.
document_name
string
Name of the Google Doc. This field is automatically populated when you select a document using the picker.
tab_id
string
ID of the tab to write to. Leave empty to write to the main document body.
tab_name
string
Name of the tab to write to. This field is automatically populated when you select a tab.
write_mode
select
How to handle existing content:
  • replace - Replace existing content with new content (default)
  • append - Append new content to the end of existing content

Input Configuration

input_type
select
Choose how to interpret the input content:
  • plain_text - Content is treated as plain text (default)
  • markdown - Content is parsed as Markdown and converted to Google Docs formatting

Response

document_info
string
JSON containing the document ID, title, and URL of the created or updated document.

Response Example

{
  "documentId": "1abc123...",
  "title": "My Document",
  "url": "https://docs.google.com/document/d/1abc123.../edit",
  "status": "success"
}

Node Functionality

The Google Docs Writer node:
  • Creates new Google Docs documents
  • Updates existing documents with replace or append modes
  • Writes to specific tabs within a document
  • Accepts plain text or Markdown input
  • Converts Markdown formatting to native Google Docs styles
  • Uses the Google Docs API v1 documents.batchUpdate endpoint

Example Usage

Creating a New Document

  1. Add the Google Docs Writer node to your workflow
  2. Select your Google integration
  3. Enable “Create New Document”
  4. Enter a document title or check “Use variable for document title” to pass it dynamically
  5. Choose your input type (plain text or Markdown)
  6. Connect the content input from an upstream node

Updating an Existing Document

  1. Add the Google Docs Writer node to your workflow
  2. Select your Google integration
  3. Keep “Create New Document” disabled
  4. Use the picker to select the target document
  5. Optionally select a specific tab to write to
  6. Choose write mode: replace or append
  7. Choose your input type (plain text or Markdown)
  8. Connect the content input from an upstream node

Writing Markdown Content

When input type is set to markdown, the following formatting is preserved:
  • Bold and italic text
  • Headers (H1-H6)
  • Lists (ordered and unordered)
  • Links
  • Code blocks

Dynamic Document Creation

For workflows that create multiple documents (e.g., in a loop), use the variable option for document title:
  1. Check “Use variable for document title”
  2. The title field will show {{documentTitle}}
  3. Pass the document title from an upstream node

Notes

  • Document IDs can be found in the Google Docs URL: https://docs.google.com/document/d/{DOCUMENT_ID}/edit
  • When replacing content, all existing content in the target location will be removed
  • When appending, new content is added after existing content
  • The node requires write permissions for existing documents
  • New documents are created in the root of your Google Drive

Version History

VersionChanges
1.0Initial release. Write content to new or existing documents.