# Google Drive

## Overview

The Google Drive Connector in DBSync Cloud Workflow provides a secure and scalable way to integrate Google Drive - Google’s cloud file storage and collaboration platform - with your enterprise systems such as CRM, ERP, databases, file services, and SaaS applications.

By incorporating Google Drive into automated workflows, teams can move files between systems, trigger downstream processes based on file events, and maintain synchronized repositories without manual intervention.

## Key Benefits

**For Business Leaders:**

* **Centralized File Automation:** Integrate file storage with business systems for consistent data flow.
* **Improved Collaboration:** Share and deliver files automatically across platforms.
* **Workflow Alignment:** Trigger business processes from Drive file actions.

**For Technical Teams:**

* **Secure OAuth Integration:** Uses Google OAuth 2.0 for controlled and secure access.
* **Event-Driven Scenarios:** Combine with triggers and schedules for powerful automation.

## Prerequisites

Before configuring the Google Drive Connector, the following prerequisites must be met:

1. DBSync Access

* A valid license for this connector and access to the DBSync Cloud Workflow platform.

2. Google Account

* A Google account with API access enabled.

## Connector Configuration

Each Google Drive connector instance represents a connection to a single Google account’s Drive storage. To work across accounts, create separate connectors.

#### Authentication (OAuth 2.0)

The Google Drive Connector uses OAuth 2.0 for secure access.

OAuth ensures that your Google credentials are never stored directly and supports seamless token refresh for ongoing workflows.

## Quick Setup Guide

Follow these steps to configure the Google Drive Connector:

1. **Login to DBSync Cloud Workflow**
   * Use your DBSync credentials to access the platform.
2. **Add the Google Drive Connector**
   * Navigate to the connectors list in the Apps pane and select Google Drive.
3. **Click Login to Google Drive(OAuth)**
   * Click Login to Google Drive(OAuth) to be redirected to Google’s secure OAuth consent screen.
4. **Authorize Access**
   * Log in with your Google credentials and grant Drive permissions to DBSync. DBSync stores access and refresh tokens securely and uses them to authorize API calls.
5. **Verify Connection**
   * Upon successful connection, your Google account email or name will be displayed - indicating the connector is active.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FbiN1P4IPQ9ScsDymr1w4%2Funknown.png?alt=media&#x26;token=9c746943-5c76-48e7-a883-b200a716b231" alt=""><figcaption></figcaption></figure>

Once connected, Google Drive is available as a resource for file operations in workflows.

## Available Operations

### Read File Operation (Download File)

This operation allows users to download files from the connected Google Drive account.

* **Operation**: From the dropdown, choose **Read**.
* **Read From (File/Folder Path)**
  * **Filepath**: Enter a fixed file path.
  * **Data-stream-variable**: Click the **`Fx`** icon to choose a dynamic variable that retrieves the file path from previous actions. For example, a file path returned from a **QUERY** operation in Salesforce.
* **File Content:** The content of downloaded files is stored in a generated variable, which can be renamed as needed. This variable is automatically added to the data stream for further processing.

### Write File Operation (Upload File)

This operation enables users to upload or write files to the selected Google Drive connection.

* **Operation:** From the dropdown, choose **Write**.
* **Write To (File/Folder Path)**
  * **Filepath**: Enter a static file path.
  * **Data-stream-variable:** Use the **`Fx`** icon to select a data stream variable for a dynamic file path.
* **File Name** \[Input Text]
  * Input a filename or drag and drop a variable from the data stream.
  * By default, the variable `$file-name` retains the source filename but can be edited as needed.
* **File Content** \[Input Text]
  * The content of the uploaded files is stored in a generated variable, which can be renamed as needed. This variable is automatically added to the data stream for further processing.

#### Properties for Write File Operation (Upload File)

* **If File Name Exists** \[Dropdown]:
  * *Skip*: Skips the upload if the file name already exists.
  * *Override*: Replaces the existing file with the new one.
* **Batch-size** \[Dropdown]: Choose the batch size for the operation.
  * Options: *10*, *50*, *100*, *1000*.

### Move / Rename File Operation

This operation allows users to move or rename files within the connected Google Drive account.

* **Operation:** Select Move/Rename File.
* **Source File Path** \[Dropdown with editable input text]: Specify the file path to be moved or renamed by choosing a file from the list or by inputting a regular expression for a customized and dynamic pattern.
* **Destination File Path** \[Dropdown with editable input text]: Specify the target path for the file by choosing a file from the list or by inputting a regular expression for a customized and dynamic pattern.

## Error Handling

Implement error handling using the following steps:

1. Add a Conditional Step after this action to handle failed uploads or downloads.
2. Configure custom alerts or retries based on your workflow needs.

## Security Best Practices

* **Restrict Access:** Limit the scope of the Google Drive API to only the permissions necessary.
* **Monitor OAuth Tokens:** Regularly rotate OAuth credentials and monitor for any unusual access.
* **Data Encryption:** Use secure methods for data storage and retrieval.

## Troubleshooting

#### Common Issues

* **Authentication Failure:** Verify that the username and password are correct.
* **File Not Found:** Ensure the File ID or path provided is correct.
* **Access Denied:** Check that the Google Drive API has the necessary permissions.

## Frequently Asked Questions (FAQ)

<details>

<summary>Can I connect multiple Google Drive accounts?</summary>

Yes, create separate connectors for each Google account you need to integrate.

</details>

<details>

<summary>Is authentication secure?</summary>

Yes, it uses Google OAuth 2.0 with secure token storage. Your password is never stored by DBSync.

</details>

<details>

<summary>Can I access shared drives and team drives?</summary>

Yes, as long as the authenticated user has access and the required scopes are granted.

</details>

<details>

<summary>Can the connector handle large files?</summary>

Yes, file transfers support large file sizes within Google Drive API limits.

</details>

<details>

<summary>Can workflows be triggered by file changes in Drive?</summary>

Workflows can be scheduled or designed to poll for file events, real-time push triggers can be implemented through supplemental automations.

</details>

## Summary

The Google Drive Connector in DBSync Cloud Workflow provides a powerful and secure way to include cloud file storage in your enterprise integration patterns. By leveraging Google Drive within workflows, teams can automate file management, synchronize content across systems, and streamline collaboration - all without manual intervention or custom code.

## Useful Links

[Google Drive action](https://docs.mydbsync.com/cloud-workflow/create-your-workflow/actions/storage/google-drive): Use the Google Drive connector with the action to unleash the full potential.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-workflow/2026_connectors_new/google-drive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
