Google Drive (Service Account) icon

Google Drive (Service Account)

Access Google Drive API using Service Account

Overview

This node allows exporting a Google Workspace file from Google Drive using a service account for authentication. It supports exporting files in various formats such as PDF, Microsoft Word, HTML, images, and more. This is useful for automating the conversion and retrieval of Google Drive files in different formats for further processing or storage.

Use Case Examples

  1. Export a Google Docs document as a PDF to archive it.
  2. Convert a Google Sheets spreadsheet to Microsoft Excel format for sharing with users who do not use Google Workspace.
  3. Export a Google Slides presentation as a PNG image for use in reports or presentations.

Properties

Name Meaning
Authentication Choose the authentication method: use saved credentials or enter service account details manually.
Service Account Email The email address of the service account used for authentication (required if manual authentication is selected).
Private Key The private key from the service account JSON used for authentication (required if manual authentication is selected).
Impersonate Email (Optional) Email of the user to impersonate, requires domain-wide delegation (optional, manual authentication only).
File ID The ID of the Google Drive file to export.
Export Format The format to export the file to, such as PDF, DOCX, HTML, PNG, etc.

Output

JSON

  • fileId - The ID of the exported file.
  • fileName - The original name of the file before export.
  • originalMimeType - The original MIME type of the file before export.
  • exportFormat - The MIME type format the file was exported to.
  • content - The exported file content as text.

Dependencies

  • Google Drive API accessed via a service account using JWT authentication.

Troubleshooting

  • Ensure the service account has the necessary permissions to access and export the specified file.
  • If using manual authentication, verify the private key is correctly formatted with proper newline characters.
  • Check that the file ID is correct and the file exists in Google Drive.
  • If impersonation is used, ensure domain-wide delegation is properly configured for the service account.

Links

Discussion