Markdown to Google Docs icon

Markdown to Google Docs

Transform Markdown content into Google Docs API requests

Export Google Doc

AI-generated

Summary

Export a specified Google Docs document to a selectable format (Markdown, PDF, or plain text) and optionally save the exported file to a chosen Google Drive folder.

Inputs

  • Document (required) — The Google Docs document to export, specified by selecting from a list, entering a URL, or providing the document ID.
  • Export Format (required) — The desired export format: Markdown (.md), PDF (.pdf), or plain text (.txt).
  • Output File Name — Optional custom filename for the exported file; if empty, the document title is used.
  • Output Options — Optional settings including saving the exported file to a specific Google Drive folder.

Output shape

a single record (JSON) with export result metadata and optionally the file content (binary for PDF, text content otherwise) or saved file info on Google Drive.

The output includes properties such as documentId, documentTitle, exportFormat, fileName, mimeType, fileSizeBytes, outputMode, and message. If saved to Google Drive, the saved file ID and URL are included. For PDF exports, the file content is binary and accessible in the node's binary output; for other formats, content is provided as text in JSON. The node handles errors for missing documents, access permissions, and invalid export formats, throwing descriptive errors.

Examples

Example 1: Export a Google Doc as Markdown and get the file content in the workflow

Set Document to the target Google Docs document, Export Format to Markdown, and leave Output Options unset to receive the Markdown content in JSON output.

Example 2: Export a Google Doc as PDF and save to a Google Drive folder

Set Document to select the Google Doc, Export Format to PDF, provide an optional Output File Name, and specify a Google Drive Folder to save the PDF file. The binary file data and saved file info (ID, URL) will be available on output.

Links

Discussion