View as Markdown
Google Drive icon

Google Drive ACTION

Upload File

Upload a file to Google Drive. See the documentation for more information
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Drive account once, then configure and run Upload 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-upload-file",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_drive: { authProvisionId: "apn_xxxxxxx" },
    drive: "Drive",
    parentId: "Folder",
  },
})

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.

Upload 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
parentId Folder string
The folder you want to upload the file to. If not specified, the file will be placed directly in the drive's top-level folder.
Optional Dynamic
filePath File Path or URL string
Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.pdf).
Required
name Name string
The name of the new file (e.g. /myFile.csv). By default, the name is the same as the source file's.
Optional
mimeType Mime Type string
The file's MIME type (e.g., image/jpeg). Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided.
Optional Dynamic
uploadType Upload Type string
The type of upload request to the /upload URI. Required if you are uploading data, but not if are creating a metadata-only file. See the documentation for more information.
Optional
fileId File to replace string
ID of the file to replace. Leave it empty to upload a new file.
Optional Dynamic
metadata Metadata object
Additional metadata to supply in the upload. See the documentation for information on available fields. Values will be parsed as JSON where applicable. Example: { "description": "my file description" }
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-upload-file
Version
2.0.17
App
Google Drive
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes