What agents can do
Tools that change a document (
create_document, insert_text, replace_text, batch_update_document) act in the connected account and run straight away, like other tools that change data (see Tool approvals). The exception is a batch_update_document call that can remove content: it runs straight away only when every request adds or restyles content (inserting text, tables or images, changing styles), or replaces literal text with something non-empty. Any other request, such as deleteContentRange, replaceNamedRangeContent, accepting or rejecting a suggestion, or a replacement with empty text, makes the agent ask first, because it can’t be undone. In the Enterprise Edition, an admin can make any of these tools ask first.
Tabs. get_document labels each tab’s text with its title and tab_id. Without a tab_id, insert_text writes into the first tab and replace_text changes every tab; give a tab_id to work in one tab.
If create_document creates the document but can’t add its starting text, it says so and gives the new document’s id: the agent then adds the text with insert_text instead of creating a second document.
A tool finds a document by its id: the part of the link after /document/d/. To work with a document you only know by name, also add the Drive action so the agent can search for it.
Permissions it asks for
Docs has its own sign-in, separate from Drive, Gmail and Calendar, so connecting it never asks those actions to sign in again.
Set up
An admin sets the action up once; then each person who wants agents to use it signs in with their own Google account.1
Enable the Google Docs API
In Google Cloud Console, open your project, go to APIs & Services > Library, search for Google Docs API and click Enable.
2
Add the scope
Add
https://www.googleapis.com/auth/documents to your OAuth app’s scopes. In the newer console layout that is Google Auth Platform > Data Access > Add or Remove Scopes; in the older one, APIs & Services > OAuth consent screen > Scopes.3
Start the setup in PipesHub
Go to Workspace settings > Actions, find Docs and click Set up. The Action configuration panel shows the Redirect URI; copy it.
4
Create an OAuth client
In APIs & Services > Credentials (or Google Auth Platform > Clients), create an OAuth client of type Web application, paste the redirect URI under Authorized redirect URIs, and create it. Copy the Client ID and Client secret.
5
Finish the action configuration
Back in the Action configuration panel, enter an Instance name, an OAuth app name, the Client ID and the Client Secret, then click Create.
6
Each person signs in
Each user opens Your actions, finds the Docs action and clicks Authenticate, signs in to Google and allows access. The action then shows Authenticated.
Errors you may see
FAQ
How is this different from the Google Docs connector?
How is this different from the Google Docs connector?
The connector indexes documents so they appear in search and chat answers. The action lets an agent act on documents: create them and change them. Use both if agents should find documents and also edit them.
Can an agent read a document it found through search?
Can an agent read a document it found through search?
Yes. Search results link to the document, and
get_document reads it by the id in that link, as long as the connected account can open it.