Documentation

Google Drive Connectors

Google Drive connectors enable seamless integration with Google's document storage and management service, allowing your workflows to access, search, and retrieve files stored in Google Drive.

1.1 Google Drive Search

The Google Drive Search connector allows you to search for files and folders within Google Drive using various search parameters. It enables targeted retrieval of documents based on criteria like file name, content, type, and ownership.

Google Drive Search Interface

Google Drive Search Interface

Use Cases

  • Finding specific documents in shared team drives
  • Locating files containing specific content or keywords
  • Retrieving files of particular types (PDFs, spreadsheets, etc.)
  • Collecting documents modified within a date range
  • Creating document catalogs from organized drives

Inputs

  • Token String: OAuth token for Google Drive API authentication (required)

    Example: ya29.a0AfB_byC...

  • Query Item: Type of query to perform (required)

    Example: Select a query item (name, owner, contains text, etc.)

  • Valid Operator: Comparison operator for the query (required)

    Example: equals, contains, starts with

  • Search Term: The value to search for (required)

    Example: "quarterly report"

  • Query String: Additional query parameters (optional)

    Example: "mimeType='application/pdf' and modifiedTime > '2023-01-01'"

Outputs

Search results containing file metadata such as ID, name, type, and URLs.

Example Output:

[
  {
    "id": "1Abc123XyZ_file_id_string",
    "name": "Q1 2023 Financial Report.pdf",
    "mimeType": "application/pdf",
    "webViewLink": "https://drive.google.com/file/d/1Abc123XyZ_file_id_string/view",
    "createdTime": "2023-01-15T09:31:42.000Z",
    "modifiedTime": "2023-02-02T14:23:18.000Z",
    "owners": [{"displayName": "Jane Smith", "emailAddress": "jane@example.com"}]
  },
  {
    "id": "2Def456Uvw_file_id_string",
    "name": "Q1 2023 Marketing Report.pdf",
    "mimeType": "application/pdf",
    "webViewLink": "https://drive.google.com/file/d/2Def456Uvw_file_id_string/view",
    "createdTime": "2023-01-20T11:15:30.000Z",
    "modifiedTime": "2023-01-30T16:42:11.000Z",
    "owners": [{"displayName": "John Doe", "emailAddress": "john@example.com"}]
  }
]

Implementation Notes

  • Use specific search criteria to limit results and improve performance
  • For complex queries, refer to Google Drive API search parameter documentation
  • Structure queries to respect Google Drive API's rate limits
  • Consider using folder IDs to restrict searches to specific directories

1.2 Google Drive Loader

The Google Drive Loader connector downloads and extracts content from specific documents in Google Drive. It allows your workflow to access the actual content of documents for processing, analysis, or integration with other services.

Google Drive Loader Interface

Google Drive Loader Interface

Use Cases

  • Extracting text from documents for analysis or summarization
  • Retrieving data from spreadsheets for processing
  • Loading presentation content for knowledge base creation
  • Processing shared team documents in automated workflows
  • Converting Google Docs to other formats for downstream systems

Inputs

  • JSON String of the Service Account Token: OAuth token for authentication (required)

    Example: ya29.a0AfB_byC...

  • Document ID: Google Drive file ID to retrieve (required)

    Example: 1Abc123XyZ_file_id_string

Outputs

The content of the requested document in an appropriate format, typically text for documents and structured data for spreadsheets.

Example Output for a text document:

{
  "content": "# Q1 2023 Financial Report

Prepared by: Financial Department
Date: January 15, 2023

## Executive Summary

The company has exceeded revenue targets by 12% this quarter...",
  "mimeType": "application/vnd.google-apps.document",
  "fileName": "Q1 2023 Financial Report.gdoc"
}

Implementation Notes

  • Different document types require different processing approaches
  • Consider export formats carefully (PDF, plain text, HTML) based on your needs
  • For large files, implement streaming or chunking to handle content efficiently
  • Ensure proper permissions on files you're accessing through service accounts

1.3 GCS File Loader

The GCS File Loader connects to Google Cloud Storage to retrieve individual files. It enables direct access to files stored in GCS buckets, allowing your workflow to process documents, images, data files, and more.

GCS File Loader Interface

GCS File Loader Interface

Use Cases

  • Loading documents for natural language processing
  • Retrieving media files for content analysis
  • Processing log files stored in cloud storage
  • Accessing configuration or data files for workflows
  • Integrating with GCS-based data lakes or archives

Inputs

  • Service Account Key File: Path to service account key file (required)

    Example: Upload a file...

  • GCP Project Name: Google Cloud project ID (required)

    Example: my-project-name

  • Bucket Name: GCS bucket name (required)

    Example: my-bucket

  • Blob Name: Path to the file within the bucket (required)

    Example: path/to/docs/

Outputs

The content of the requested file, with format depending on the file type.

For text-based files, the raw content will be provided. For binary files, appropriate handling will be applied based on the file type.

Implementation Notes

  • Ensure proper IAM permissions are set up for the service account
  • For large files, consider streaming or chunking approaches
  • Set up appropriate error handling for missing files or access issues
  • Use signed URLs for temporary access to sensitive files when appropriate

Authentication & Security

  • Use service accounts with the principle of least privilege
  • Manage OAuth tokens securely and refresh them as needed
  • Store credentials in secure environment variables or secret managers
  • Consider using Google's Workload Identity for GKE or Cloud Run deployments

Best Practices

  • Cache frequently accessed files to reduce API usage and improve performance
  • Implement retry logic for transient failures in Google API calls
  • Use file metadata to check for changes before downloading large files
  • Set up monitoring for API quotas and usage limits
  • Implement proper error handling for common failure scenarios