Overview

Purpose

This guide walks you through obtaining and configuring Google Workspace credentials for Google Drive Tools. By following these steps, you’ll enable your bots or workflows to seamlessly read, write, and organize files in Google Drive, leveraging a secure service account.

Steps

1

Enable Google APIs

Activate Google Drive, Sheets, or Docs APIs within your Google Cloud project.

2

Service Account Creation

Generate a new service account with a JSON key file for secure API access.

3

Shared Folder Configuration

Share a Google Drive folder with your service account to store or retrieve files.

4

Workflow Testing

Validate your configuration by listing files or performing read/write operations.

Step-by-Step Setup

Step 1: Access the Google Cloud Platform (GCP)

  1. Open GCP Console: Go to https://console.cloud.google.com/

  2. Sign Up or Log In: Use your Google account credentials.

  3. Create / Select a Project:

    • If you don’t have a project, click New Project

    • Example name: "Genesis_Google_Integration"

Step 2: Enable Google APIs

Within your GCP project:

  1. Go to APIs & Services > Library

  2. Enable the following:

    • Google Drive API

    • Google Sheets API (if you need spreadsheet operations)

    • (Optional) Google Docs API (for document editing)

  3. Confirm that these APIs are now active in your project.

Step 3: Create a Service Account

  1. IAM & Admin > Service Accounts in the GCP Console

  2. Create Service Account:

    • Provide a name (e.g., "GenesisBot_ServiceAccount") and description

    • Click Create and Continue

  3. Assign Roles:

    • Editor for full read/write (or Viewer if you need limited privileges)

    • Click Done once selected

Step 4: Generate Service Account Credentials (Key File)

  1. In Service Accounts, locate your new account. Click Actions (…) > Manage Keys

  2. Add Key > Create New Key

  3. Choose JSON and download the file

    Important: Store this file securely. It grants API access with your private key information.

Step 5: Set Up Shared Folder for File Access

  1. Create a Folder in Google Drive (e.g., "Genesis_Shared_Folder")

  2. Share the folder with your service account email:

    • Example: service-account-id@genesis_gcp_project.iam.gserviceaccount.com

    • Grant Editor role for writing or editing files

  3. Copy the Folder ID: This is the alphanumeric string in the folder URL:

    • E.g., https://drive.google.com/drive/folders/<Folder-ID>

Step 6: Fill in the API Parameters

In the Genesis Bots configuration interface (or similar):

  • Project ID: Found in your GCP project settings or JSON key file

  • Client ID: From the key file or OAuth consent screen

  • Client Email: Copied from the service account details

  • Private Key:

    • Open the JSON file

    • Copy the "private_key" value, including the lines: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"

  • Private Key ID: Found within the JSON ("private_key_id")

  • Shared Folder ID: The ID from Step 5

Step 7: Save and Apply Configuration

  • After inputting your credentials, click “Add Google Worksheet API parameters to access Google Worksheet account from Genesis.”

Step 8: Test the Google Drive Tools Integration

  1. Perform a Basic Test:

    • Example: List files in your shared Drive folder using the tool

    • Or read data from a Google Sheet (if configured)

  2. Check for any errors such as unauthorized or invalid credentials

Additional Tips

  • API Key Security: Keep the JSON file private. Revoking and regenerating keys periodically is good practice

  • Quota Monitoring: GCP imposes usage limits; regularly check your console for errors or exceeded quotas

  • Troubleshooting: If unsuccessful:

    • Confirm your service account email has folder access

    • Ensure private_key lines are intact and properly formatted

Integration Relevance

  • File Management: Automated workflows can upload, download, or manage Google Drive items under the service account

  • ETL & Reporting: Pair with database_tools or process_scheduler_tools to store processed datasets or logs

  • Collaboration: Combine with Slack or email integrations to share Drive file links among teams

Configuration Details

  • Role Assignments: If read-only is sufficient, use Viewer role for extra security

  • Parent Folders: Keep the folder structure in mind—child folders must inherit or be granted the same sharing settings

  • Key Rotation: If compromised or outdated, generate a new service account key, remove the old one

Example

After setting these parameters, try a sample call to list files in "Genesis_Shared_Folder". If you see the correct file list, your bot is ready to read or write in Google Drive under the configured service account.