View as Markdown
Google Drive icon

Google Drive ACTION

Update File

Update a file's metadata and/or content. See the documentation for more information
  • Action
  • Writes data
  • Destructive
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Drive account once, then configure and run Update File from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_drive-update-file",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_drive: { authProvisionId: "apn_xxxxxxx" },
    drive: "Drive",
    fileId: "File",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Update File inputs
Property Type Description
drive Drive string
Select a specific drive to search. Defaults to All Drives (My Drive and all Shared Drives you have access to) when no selection is made. To limit to your personal drive or a Shared Drive, select it from this list.
Optional Dynamic
fileId File string
The file to update
Required Dynamic
filePath File Path or URL string
The file content to upload. Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.txt)
Optional
name Name string
The new name of the file
Optional
mimeType Mime Type string
The file's MIME type (e.g., image/jpeg). The value cannot be changed unless a new revision is uploaded.
Optional Dynamic
addParents Add Parents string[]
A list of parent folder IDs to add
Optional Dynamic
removeParents Remove Parents string[]
A list of parent folder IDs to remove
Optional Dynamic
keepRevisionForever Keep Revision Forever boolean
Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.
Optional
ocrLanguage OCR Language string
A language hint for OCR processing during image import (ISO 639-1 code)
Optional
useContentAsIndexableText Use Content As Indexable Text boolean
Whether to use the uploaded content as indexable text
Optional
advanced Additional Options object
Any additional parameters to pass in the request. See the documentation for all available parameters.
Optional
syncDir SyncDir dir
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
google_drive-update-file
Version
2.0.17
App
Google Drive
Authentication
OAuth
Read-only
No
Destructive
Yes
Open world
Yes