Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Google Docs

connector.google_docs · productivity, documents

Create documents, read them as structured JSON or plain text, and edit them with batch updates.

Vendor API documentation: https://developers.google.com/workspace/docs/api/reference/rest

Authentication

MethodCredential kindAuth kindFieldsTest request
Google account (OAuth2)google_docs/oauth2oauth2_auth_codeclient_id, client_secret (secret)yes
Google service accountgoogle_docs/service_accountjwt_service_accountclient_email, private_key (secret), subjectyes

Actions

Node type connector.google_docs. Choose a resource and an operation; each operation has its own parameters.

Document

OperationIDEffectPaginatedCassette tests
Create a documentdocument.createwrites2
Get a documentdocument.getreads2
Get document textdocument.get_textreads1
Update a documentdocument.updatewrites4

Create a document

Operation document.create. Creates a document, optionally inside a Drive folder and with initial text.

NameTypeDefaultRequiredShown whenDescription
titlestringyes
folderresource_locator"root"Drive folder (or shared drive folder) to create the document in. Values from lookup folders.
contentstringInitial text. Text inserted into the new document body.

Get a document

Operation document.get. Returns the full document structure.

NameTypeDefaultRequiredShown whenDescription
documentresource_locatoryesDocument ID, or a docs.google.com document URL. Values from lookup documents.
include_tabsbooleanfalseInclude all tabs.
suggestions_view_modeoptionsOne of DEFAULT_FOR_CURRENT_ACCESS, SUGGESTIONS_INLINE, PREVIEW_SUGGESTIONS_ACCEPTED, PREVIEW_WITHOUT_SUGGESTIONS.

Get document text

Operation document.get_text. Returns the title and the body as plain text (table cells separated by tabs).

NameTypeDefaultRequiredShown whenDescription
documentresource_locatoryesDocument ID, or a docs.google.com document URL. Values from lookup documents.

Update a document

Operation document.update. Applies a list of edits: insert text, a page break or a table (at the end or at an index), replace all occurrences of a text, or delete a content range. Each edit is sent as its own batch update in order. Pass raw Docs API requests to send one atomic batch instead.

NameTypeDefaultRequiredShown whenDescription
documentresource_locatoryesDocument ID, or a docs.google.com document URL. Values from lookup documents.
actionsfixed_collectionEdits applied in order. Indexes are UTF-16 offsets as reported by Get a document.
actions.actionoptions"insert"One of insert, replaceAll, delete.
actions.objectoptions"text"One of text, pageBreak, table, contentRange.
actions.textstringText to insert, or the text to find for Replace all.
actions.replaceTextstringReplace with.
actions.matchCasebooleanfalseMatch case.
actions.searchByRegexbooleanfalseUse regular expression.
actions.locationChoiceoptions"endOfSegmentLocation"Insert at. One of endOfSegmentLocation, location.
actions.indexnumber
actions.startIndexnumber
actions.endIndexnumber
actions.rowsnumber
actions.columnsnumber
actions.segmentIdstringHeader/footer/footnote ID.
actions.tabIdstringTab ID.
requestsjsonRaw requests. Array of Docs API Request objects sent as one batch. Used instead of the edits list.
write_controloptionsOne of requiredRevisionId, targetRevisionId.
revision_idstring

Lookups

Lookups fill dropdowns and resource pickers in the editor from the vendor API.

LookupDepends onSearchDescription
documentsclient-side{{ item.modifiedTime }}
foldersclient-side

Import

Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.

Source typeVersion rangeStatusFixtures
n8n-nodes-base.googleDocs>=1 <3unverified

Provenance

Written from the vendor’s documentation: