For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Docs

Procedures and concepts for the Google Docs integration.

The following documentation is for Google Docs v2.10.1 (BDK).

Overview

Google Docs provides collaborative document creation and editing with real-time synchronization across teams. This integration enables automated document generation, content management, and collaborative writing workflows. Enhance documentation processes and improve team collaboration on shared documents.

Prerequisites

1. Required Books

The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:

  • Google Docs

How to Add the Book(s)

  1. Go to Books → All Books.

  2. Search for the name of the book and click on it.

  3. Click on Install or Add Connection to add the book to your agent.

  4. If adding a connection, you'll be prompted for connectivity details.

Connectivity

This section outlines the available methods for connecting to the Book, along with the required configuration details for each.

Connect using Client Email, Token URI and Private Key

Gets the credentials from the service account keys.

Label
Description
Type

Client Email

The client email of the service account registered in the Google Cloud Console.

text

Token URI

The token URI of the Google Cloud Console.

text

Private Key

The private key of the service account registered in the Google Cloud Console.

sensitive

Procedures

to add a paragraph to a (document)

Add a new paragraph to the end of a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The file to add the paragraph to.

google drive file reference

Yes

(no default)

text

The new paragraph text.

text

Yes

(no default)

style

Optional. The new paragraph's style.

enum[HEADING_1, HEADING_2, HEADING_3, NORMAL_TEXT, SUBTITLE, TITLE]

No

(no default)

Output Concepts

Concept
Description
Type

The document's file reference.

google drive file reference

Examples

Add a heading to a document

to batch update document

Apply raw Google Docs batch update requests to a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to update.

google drive file reference

Yes

(no default)

requests json

A JSON array of Google Docs batchUpdate requests.

text

Yes

(no default)

write control json

Optional. A JSON object with Google Docs writeControl settings.

text

No

(no default)

Output Concepts

Concept
Description
Type

The updated document reference.

google drive file reference

Examples

Apply a raw batch update request

to create a google document in a (folder)

Creates a new Google Docs document.

Input Concepts

Concept
Description
Type
Required
Default Value

name

The name for the new Google Docs document.

text

Yes

(no default)

The folder to create the Google Docs document in.

google drive folder reference

No

(no default)

Output Concepts

Concept
Description
Type

the new document's file reference.

google drive file reference

Examples

Create a Google Docs document called "Hello World" in a folder

to find a (document text range) in a document

Find the index range of exact text in a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to inspect.

google drive file reference

Yes

(no default)

text

The exact text to find.

text

Yes

(no default)

occurrence index

Optional. The zero-based occurrence to return when the text appears multiple times.

number

No

0

match case

Optional. Whether the match should be case sensitive.

boolean

No

True

Output Concepts

Concept
Description
Type

The index range where the text was found.

google docs range

Examples

Find text in a document

to get a (document paragraph) from a document

Resolve the paragraph containing a document index.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to inspect.

google drive file reference

Yes

(no default)

index

The document index contained in the paragraph.

number

Yes

(no default)

Output Concepts

Concept
Description
Type

The paragraph containing that index.

google docs paragraph

Examples

Get the paragraph containing an index

to get a (document) from docs

Get the full Google Docs document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to retrieve.

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

The full normalized document.

google docs document

Examples

Get the full document

to get some (document comments) from a document

Get comments and replies for a Google Docs document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document whose comments should be retrieved.

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

The document comments.

google docs comment

Examples

Get the document comments

to get some (document tables) from a document

Extract the table structures and cell text from a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to inspect.

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

The tables found in the document.

google docs table

Examples

Get the document tables

to get some (document text blocks) from a document

Get the document paragraph text with document indexes.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to inspect.

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

The document text blocks with start and end indexes.

google docs text block

Examples

Get the document text blocks

to insert a heading in a document

Insert a heading at the end of a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to update.

google drive file reference

Yes

(no default)

text

The heading text.

text

Yes

(no default)

style

Optional. The heading style to apply.

enum[HEADING_1, HEADING_2, HEADING_3, NORMAL_TEXT, SUBTITLE, TITLE]

No

{'class_name': 'ParagraphStyle', 'name': 'HEADING_1', 'value': 'HEADING_1'}

Output Concepts

Concept
Description
Type

The updated document reference.

google drive file reference

Examples

Insert a heading in a document

to overwrite a document

Replace the main body content of a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to overwrite.

google drive file reference

Yes

(no default)

content

The new document body text.

text

Yes

(no default)

Output Concepts

Concept
Description
Type

The updated document reference.

google drive file reference

Examples

Overwrite a document

to replace text in a document

Replace exact text everywhere it appears in a document.

Input Concepts

Concept
Description
Type
Required
Default Value

The Google Docs document to update.

google drive file reference

Yes

(no default)

old text

The exact text to replace.

text

Yes

(no default)

replacement text

The text that should replace the old text.

text

Yes

(no default)

Output Concepts

Concept
Description
Type

The updated document reference.

google drive file reference

Examples

Replace placeholder text in a document

Concepts

Google drive file reference

Contains all information required to identify a file in Google Drive.

Field Name
Description
Type

id

The id of the file

text

file_name

The name of the file

text

The ids of the parent folders

list of text

Google drive folder reference

Contains all information required to identify a folder in Google Drive.

Field Name
Description
Type

id

The id of the folder

text

folder_name

The name of the folder

text

The ids of the parent folders

list of text

Google docs range

A range inside a Google document.

Field Name
Description
Type

start_index

The inclusive start index in the document.

number

end_index

The exclusive end index in the document.

number

text

Optional text contained in the range.

optional[text]

Google docs document

A normalized Google document.

Field Name
Description
Type

id

The document identifier.

text

title

The document title.

text

revision_id

Optional document revision identifier.

optional[text]

text

The flattened document text.

optional[text]

The document paragraphs.

optional[list of google docs paragraph]

The document tables.

optional[list of google docs table]

Google docs paragraph

A paragraph extracted from a Google document.

Field Name
Description
Type

text

The paragraph text.

text

start_index

The inclusive start index in the document.

number

end_index

The exclusive end index in the document.

number

paragraph_style

Optional paragraph style name.

optional[text]

Google docs table

A table extracted from a Google document.

Field Name
Description
Type

start_index

The table start index.

number

end_index

The table end index.

number

The table rows.

optional[list of google docs table row]

Google docs comment

A Google document comment.

Field Name
Description
Type

id

The comment identifier.

text

author

The display name of the comment author.

optional[text]

content

The comment content.

optional[text]

created_time

When the comment was created.

optional[text]

modified_time

When the comment was last modified.

optional[text]

resolved

Whether the comment is resolved.

optional[boolean]

The replies to the comment.

optional[list of google docs comment reply]

Google docs comment reply

A reply to a Google document comment.

Field Name
Description
Type

id

The reply identifier.

text

author

The display name of the reply author.

optional[text]

content

The reply content.

optional[text]

created_time

When the reply was created.

optional[text]

modified_time

When the reply was last modified.

optional[text]

Google docs text block

A text block extracted from a Google document.

Field Name
Description
Type

text

The text content.

text

start_index

The inclusive start index in the document.

number

end_index

The exclusive end index in the document.

number

paragraph_style

Optional paragraph style name.

optional[text]

Last updated

Was this helpful?