Type ID: googleDocs · Kind: Action · Trace: TOOL
Create and update documents using the Google Docs API.
Credentials
Google Docs
Resources & operations
- Document (
document)
- Create (
create) — Create a document
- Get (
get) — Fetch a document
- Replace Text (
replaceText) — Replace all matching text in a document
- Append Text (
appendText) — Append text to the end of a document
Properties
Common
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|
| Resource | resource | options | No | document | Document (document) | — |
| Operation | operation | options | No | create | Create (create), Get (get), Replace Text (replaceText), Append Text (appendText) | resource = document |
Document → Create
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|
| Title | title | string | Yes | '' | Title for the new Google document | resource = document, operation = create |
Document → Get
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = get |
| Include Tabs Content | includeTabsContent | boolean | No | true | true / false | resource = document, operation = get |
| Fields | fields | string | No | '' | Optional response field mask (e.g. title,revisionId,body.content) | resource = document, operation = get |
Document → Replace Text
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = replaceText |
| Search Text | searchText | string | Yes | '' | Exact placeholder or text to replace | resource = document, operation = replaceText |
| Replacement Text | replacementText | string | No | '' | Text to replace every matching occurrence with | resource = document, operation = replaceText |
| Additional Fields | additionalFields | object | No | {} | Collection (see below) | resource = document, operation = replaceText |
additionalFields collection options (Replace Text):
| Property | Key | Type | Required | Default | Possible values |
|---|
| Match Case | matchCase | boolean | No | true | true / false |
| Required Revision ID | requiredRevisionId | string | No | '' | Fail if the document revision does not match this revision id |
| Target Revision ID | targetRevisionId | string | No | '' | Apply the change against this target revision id when possible |
Document → Append Text
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = appendText |
| Text | text | string | Yes | '' | Text to append at the end of the document | resource = document, operation = appendText |
| Additional Fields | additionalFields | object | No | {} | Collection (see below) | resource = document, operation = appendText |
additionalFields collection options (Append Text):
| Property | Key | Type | Required | Default | Possible values |
|---|
| Required Revision ID | requiredRevisionId | string | No | '' | Fail if the document revision does not match this revision id |
| Target Revision ID | targetRevisionId | string | No | '' | Apply the change against this target revision id when possible |
Notes
- Requires a Google Docs credential; the credential ID is read from
credentials.id and resolved to an OAuth bearer token. A missing token raises Workflow error, credentials missing.
- All requests go to
https://docs.googleapis.com/v1 with Authorization: Bearer <token>. Errors throw Google Docs API request failed (<status>): <message>.
- Create posts
{ title } to /documents. Output: { success: true, documentId, title, revisionId, document }.
- Get calls
GET /documents/{documentId} with includeTabsContent and an optional fields mask query param. Output: { success: true, documentId, title, revisionId, document }.
- Replace Text posts a
replaceAllText request to /documents/{documentId}:batchUpdate using containsText.{text, matchCase} and replaceText. A writeControl is added when requiredRevisionId or targetRevisionId is set (required takes precedence). It sums occurrencesChanged across replies. Output: { success: true, documentId, occurrencesChanged, replies, response }.
- Append Text posts an
insertText request to /documents/{documentId}:batchUpdate with endOfSegmentLocation: {} and the given text; same writeControl handling as Replace Text. Output: { success: true, documentId, replies, response }.