<!-- BusyBot node reference — https://busybot.net/tools/google-docs/ -->

> Node: Google Docs (`google_docs`) · Action · v1
> Category: Productivity · Credentials: Google Docs OAuth2 (`googleDocsOAuth2Api`), Google API (Service Account) (`googleApi`)
> Updated: 2026-08-16

# Google Docs

> Create, retrieve, and update Google Docs documents with full batchUpdate support.

## Overview

Google Docs tool provides access to the Google Docs API (v1) and Google Drive API (v3). Three operations on the "document" resource: create (POST Drive API /files with mimeType=application/vnd.google-apps.document, optional folderId and driveId); get (GET Docs API /documents/{id}, with simple=true extracting plain text from body.content paragraphs, or simple=false returning raw JSON); update (POST Docs API /documents/{id}:batchUpdate with a fixedCollection of actions that build requests for text/insert, text/replaceAll, header/create, header/delete, footer/create, footer/delete, namedRange/create, namedRange/delete, pageBreak/insert, paragraphBullets/create, paragraphBullets/delete, positionedObject/delete, table/insert, tableColumn/insert, tableColumn/delete, tableRow/insert, tableRow/delete, with optional writeControl targetRevisionId or requiredRevisionId). Authentication via OAuth2 (googleDocsOAuth2Api) or Service Account (googleApi). Document ID can be extracted from a full Google Docs URL or passed directly as a raw ID.

**Category:** Productivity  
**Tool Name:** `google_docs`  
**Version:** 1

**Appearance:** Icon: `lucide-FileText` | Color: `#4285F4`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool supports two authentication methods — **Google Docs OAuth2** and **Google API (Service Account)**. Configure **one** of them and select the matching value in the **Authentication** parameter.
See the [Credentials Guide](https://busybot.net/credentials/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| Document | `document` |

### Operations

| Operation | Value | Description |
|-----------|-------|-------------|
| Create | `create` | Create a new Google Docs document. |
| Get | `get` | Get a document by ID or URL. |
| Update | `update` | Update a document using batchUpdate with one or more actions. |

### Parameters

#### Document: Create (`create`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Title | `string` | Yes | — | The title of the document to create. Supports expressions like {{ $json.title }}. |
| Folder ID | `string` | No | — | ID of the Google Drive folder in which to create the document. Leave empty to create in the root of My Drive. |
| Drive ID | `string` | No | — | ID of a Shared Drive. If provided, supportsAllDrives=true is added to the request to support shared drives. |

#### Document: Get (`get`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Document URL or ID | `string` | Yes | — | The full Google Docs URL or just the document ID. The ID is extracted from the URL pattern /d/{DOCUMENT_ID}/. Supports expressions. |
| Simplify | `boolean` | No | `true` | For get: return extracted plain text ({ documentId, content }) instead of raw JSON. For update: return the first non-empty reply from replies[] instead of the full batchUpdate response. |

#### Document: Update (`update`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Document URL or ID | `string` | Yes | — | The full Google Docs URL or just the document ID. The ID is extracted from the URL pattern /d/{DOCUMENT_ID}/. Supports expressions. |
| Simplify | `boolean` | No | `true` | For get: return extracted plain text ({ documentId, content }) instead of raw JSON. For update: return the first non-empty reply from replies[] instead of the full batchUpdate response. |
| Actions | `fixedCollection` | No | `{"actionFields":[{"object":"text","action":"insert","locationChoice":"endOfSegmentLocation","insertSegment":"body","index":0,"text":""}]}` | Actions to apply to update the document. Each action corresponds to one Docs API batchUpdate request. Add as many actions as you need — they are applied in order in a single batch. |
| — Object | `options` | No | `text` | The document object type to act upon. |
| | | | | Options: `footer`, `header`, `namedRange`, `pageBreak`, `paragraphBullets`, `positionedObject`, `table`, `tableColumn`, `tableRow`, `text` |
| — Action | `options` | No | `insert` | The action to perform on text. _(shown when Object is `text`)_ |
| | | | | Options: `replaceAll` (find and replace text), `insert` |
| — Action | `options` | No | `create` | The action to perform. _(shown when Object is `footer`, `header`, `namedRange`, `paragraphBullets`)_ |
| | | | | Options: `create`, `delete` |
| — Action | `options` | No | `insert` | The action to perform. _(shown when Object is `tableColumn`, `tableRow`)_ |
| | | | | Options: `delete`, `insert` |
| — Action | `options` | No | `insert` | The action to perform. _(shown when Object is `pageBreak`, `table`)_ |
| | | | | Options: `insert` |
| — Action | `options` | No | `delete` | The action to perform. _(shown when Object is `positionedObject`)_ |
| | | | | Options: `delete` |
| — Insert Segment | `options` | No | `body` | The document segment (body, header, or footer) where the object will be created. _(shown when Object is `footer`, `header`, `paragraphBullets`, `namedRange` and Action is `create`)_ |
| | | | | Options: `body`, `footer`, `header` |
| — Segment ID | `string` | No | — | The ID of the header, footer, or footnote segment. Retrieve from document/get (simple=false). _(shown when Object is `footer`, `header`, `paragraphBullets`, `namedRange` and Action is `create`; hidden when Insert Segment is `body`)_ |
| — Index | `number` | No | `0` | The zero-based index within the segment at the section break location. _(shown when Object is `footer`, `header` and Action is `create`)_ |
| — Name (`name`) | `string` | No | — | The name of the Named Range. Names do not need to be unique. _(shown when Object is `namedRange` and Action is `create`)_ |
| — Start Index | `number` | No | `0` | The zero-based start index of this range. _(shown when Object is `namedRange` and Action is `create`)_ |
| — End Index | `number` | No | `0` | The zero-based end index of this range. _(shown when Object is `namedRange` and Action is `create`)_ |
| — Style | `options` | No | `BULLET_DISC_CIRCLE_SQUARE` | The preset bullet/numbering style. _(shown when Object is `paragraphBullets` and Action is `create`)_ |
| | | | | Options: `BULLET_DISC_CIRCLE_SQUARE` (DISC, CIRCLE, SQUARE glyphs for the first 3 nesting levels), `BULLET_CHECKBOX` (checkbox glyphs for all nesting levels), `NUMBERED_DECIMAL_NESTED` (decimal glyphs with period separators; nested numbering) |
| — Footer ID | `string` | No | — | The ID of the footer to delete. Retrieve from document/get (simple=false) under the "footers" key. _(shown when Object is `footer` and Action is `delete`)_ |
| — Header ID | `string` | No | — | The ID of the header to delete. Retrieve from document/get (simple=false) under the "headers" key. _(shown when Object is `header` and Action is `delete`)_ |
| — Specify Range By | `options` | No | `namedRangeId` | Whether to delete the named range by its ID or by name. _(shown when Object is `namedRange` and Action is `delete`)_ |
| | | | | Options: `namedRangeId`, `name` |
| — ID | `string` | No | — | The ID of the named range to delete. _(shown when Object is `namedRange`, Action is `delete` and Specify Range By is `namedRangeId`)_ |
| — Name (`value`) | `string` | No | — | The name of the named range to delete. _(shown when Object is `namedRange`, Action is `delete` and Specify Range By is `name`)_ |
| — Object ID | `string` | No | — | The ID of the positioned object to delete. _(shown when Object is `positionedObject` and Action is `delete`)_ |
| — Insert Segment | `options` | No | `body` | The document segment (body, header, or footer) in which to insert. _(shown when Object is `pageBreak`, `table`, `tableColumn`, `tableRow`, `text` and Action is `insert`)_ |
| | | | | Options: `body`, `footer`, `header` |
| — Segment ID | `string` | No | — | The ID of the header, footer, or footnote segment. Retrieve from document/get (simple=false). _(shown when Object is `pageBreak`, `table`, `tableColumn`, `tableRow`, `text` and Action is `insert`; hidden when Insert Segment is `body`)_ |
| — Insert Location | `options` | No | `endOfSegmentLocation` | Where in the segment to insert the page break. _(shown when Object is `pageBreak` and Action is `insert`)_ |
| | | | | Options: `endOfSegmentLocation` (at end of segment), `location` (at index) |
| — Index | `number` | No | `1` | The zero-based index within the segment at which to insert the page break. Minimum 1. _(shown when Insert Location is `location`, Object is `pageBreak` and Action is `insert`)_ |
| — Insert Location | `options` | No | `endOfSegmentLocation` | Where in the segment to insert the table. _(shown when Object is `table` and Action is `insert`)_ |
| | | | | Options: `endOfSegmentLocation` (at end of segment), `location` (at index) |
| — Index | `number` | No | `1` | The zero-based index within the segment at which to insert the table (use index + 1 to refer to a table). Minimum 1. _(shown when Insert Location is `location`, Object is `table` and Action is `insert`)_ |
| — Rows | `number` | No | `0` | The number of rows in the table. _(shown when Object is `table` and Action is `insert`)_ |
| — Columns | `number` | No | `0` | The number of columns in the table. _(shown when Object is `table` and Action is `insert`)_ |
| — Insert Location | `options` | No | `endOfSegmentLocation` | Where in the segment to insert the text. _(shown when Object is `text` and Action is `insert`)_ |
| | | | | Options: `endOfSegmentLocation` (at end of segment), `location` (at index) |
| — Index | `number` | No | `1` | The zero-based index within the segment at which to insert the text. Minimum 1. _(shown when Insert Location is `location`, Object is `text` and Action is `insert`)_ |
| — Text | `string` | No | — | The text to insert at the specified location. Supports expressions like {{ $json.body }}. _(shown when Object is `text` and Action is `insert`)_ |
| — Old Text | `string` | No | — | The text to search for in the document. _(shown when Object is `text` and Action is `replaceAll`)_ |
| — New Text | `string` | No | — | The replacement text. Supports expressions. _(shown when Object is `text` and Action is `replaceAll`)_ |
| — Match Case | `boolean` | No | `false` | Whether the text search is case-sensitive. _(shown when Object is `text` and Action is `replaceAll`)_ |
| — Insert Segment | `options` | No | `body` | The document segment in which the object to delete resides. _(shown when Object is `paragraphBullets`, `tableColumn`, `tableRow` and Action is `delete`)_ |
| | | | | Options: `body`, `footer`, `header` |
| — Segment ID | `string` | No | — | The ID of the header, footer, or footnote segment. _(shown when Object is `paragraphBullets`, `tableColumn`, `tableRow` and Action is `delete`; hidden when Insert Segment is `body`)_ |
| — Start Index | `number` | No | `0` | The zero-based start index of the range for paragraph bullets. _(shown when Object is `paragraphBullets`)_ |
| — End Index | `number` | No | `0` | The zero-based end index of the range for paragraph bullets. _(shown when Object is `paragraphBullets`)_ |
| — Insert Position | `options` | No | `true` | Whether to insert the new column/row before or after the reference cell. _(shown when Object is `tableColumn`, `tableRow` and Action is `insert`)_ |
| | | | | Options: `true` (after the content at the index), `false` (before the content at the index) |
| — Index | `number` | No | `1` | The zero-based index of the table start location within the segment (use index + 1 to refer to a table). Minimum 1. _(shown when Object is `tableColumn`, `tableRow`)_ |
| — Row Index | `number` | No | `0` | The zero-based row index of the reference table cell. _(shown when Object is `tableColumn`, `tableRow`)_ |
| — Column Index | `number` | No | `0` | The zero-based column index of the reference table cell. _(shown when Object is `tableColumn`, `tableRow`)_ |
| Revision Control | `options` | No | `none` | Optional concurrency control. Use "none" to apply to the latest revision without checking. |
| | | | | Options: `none` (apply the update to the latest revision), `targetRevisionId` (apply if the revision matches; fail otherwise), `requiredRevisionId` (apply on top of the given revision, incorporating other collaborators' changes) |
| Revision ID | `string` | No | — | The revision ID to use with the selected revision control mode. _(shown when Revision Control is `targetRevisionId`, `requiredRevisionId`)_ |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Authentication | `options` | No | `oAuth2` | Authentication method to use. |
| | | | | Options: `oAuth2` (OAuth2, recommended), `serviceAccount` (Service Account) |
| Google Account | `credential` | No | — | Connect or select your Google account. _(shown when Authentication is `oAuth2`)_ |
| Service Account Email | `string` | Yes | — | The email address of the Google service account, for example `my-service-account@project.iam.gserviceaccount.com`. _(shown when Authentication is `serviceAccount`)_ |
| Private Key | `string` | Yes | — | The private key from the service account JSON key file. Paste the full PEM block, including the BEGIN and END lines. _(shown when Authentication is `serviceAccount`)_ |
| Max Concurrency | `number` | No | `5` | Maximum number of items to process concurrently. Between 1 and 20. |

## Output Data

Exactly one output item per input item — no operation fans out. The API response is merged into the item JSON, so the incoming fields pass through except where a response field uses the same name, and binary data on the input item is forwarded unchanged.

What lands on the item depends on the operation:

| Operation | Result on the output item |
|-----------|---------------------------|
| `create` | The Drive file record returned for the new document. |
| `get`, Simplify on | `documentId` and `content` — the document's paragraph text extracted to a single plain-text string. |
| `get`, Simplify off | The raw Docs API document JSON. |
| `update`, Simplify on | The first non-empty entry from the batch replies, plus `documentId`. An update whose actions produce no replies returns `documentId` alone. |
| `update`, Simplify off | The full batchUpdate response, plus `documentId`. |

Reference the result downstream by expression, e.g. `{{ $json.content }}` or `{{ $json.documentId }}`.

## Usage Examples

- Create a new blank Google Doc in a specific Drive folder
- Get the full raw JSON of a Google Doc
- Get just the plain text content from a Google Doc
- Insert text at the end of a Google Doc
- Replace all occurrences of a placeholder text in a document
- Add a header or footer to a document
- Insert a table into a document
- Create a named range across a range of characters
- Delete paragraph bullets from a range
- Insert a page break at a specific index

## Example Configuration

Create a new document inside a Drive folder:

```json
{
  "type": "google_docs",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "create",
    "title": "{{ $json.title }}",
    "folderId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
  }
}
```

Read a document's plain text so downstream nodes can process it:

```json
{
  "type": "google_docs",
  "parameters": {
    "resource": "document",
    "operation": "get",
    "documentURL": "{{ $json.docUrl }}",
    "simple": true
  }
}
```

Append text to the end of the document body:

```json
{
  "type": "google_docs",
  "parameters": {
    "resource": "document",
    "operation": "update",
    "documentURL": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
    "actionsUi": {
      "actionFields": [
        {
          "object": "text",
          "action": "insert",
          "insertSegment": "body",
          "locationChoice": "endOfSegmentLocation",
          "text": "{{ $json.summary }}\n"
        }
      ]
    },
    "simple": true
  }
}
```

Fill a template by replacing a placeholder, then append a 3x2 table. Use a non-mustache placeholder such as `[[CUSTOMER_NAME]]` in the template — `{{ … }}` is reserved for workflow expressions and would be evaluated before the request is sent:

```json
{
  "type": "google_docs",
  "parameters": {
    "resource": "document",
    "operation": "update",
    "documentURL": "{{ $json.documentId }}",
    "actionsUi": {
      "actionFields": [
        {
          "object": "text",
          "action": "replaceAll",
          "text": "[[CUSTOMER_NAME]]",
          "replaceText": "{{ $json.customerName }}",
          "matchCase": false
        },
        {
          "object": "table",
          "action": "insert",
          "insertSegment": "body",
          "locationChoice": "endOfSegmentLocation",
          "rows": 3,
          "columns": 2
        }
      ]
    },
    "writeControlType": "none"
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Create, get, and update Google Docs documents using the Google Docs and Drive APIs.