View as Markdown
Google Docs icon

Google Docs ACTION

Export Document

Export a Google Doc to a file in PDF, DOCX, TXT, HTML, or ODT format. Use when asked to export, download, convert, or 'save as' a doc in one of those formats. Use Find Document to resolve a document's name to its ID. Returns {filePath, filename, mimeType}, where filePath is the exported file in the workflow's temporary storage - it is a local path, not a shareable download link. See the documentation
  • Action
  • Read only
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Docs account once, then configure and run Export Document 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_docs-export-document",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_docs: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    format: "Format",
  },
})

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.

Export Document inputs
Property Type Description
documentId Document ID string
The ID of the Google Doc. This is the long string in the document's URL: https://docs.google.com/document/d/{DOCUMENT_ID}/edit. Use Find Document to resolve a document's name to its ID.
Required
format Format string
The format to export the document as.
Required
syncDir SyncDir dir
Required

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_docs-export-document
Version
0.0.10
App
Google Docs
Authentication
OAuth
Read-only
Yes
Destructive
No
Open world
Yes