Connect
Establishes a connection to Google Drive using either user credentials or service account credentials.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Options
- Credentials - The Google Drive API credentials used to authenticate with the service. Can be either user credentials or service account credentials.
Output
- drive_id - The identifier for the connected Google Drive service, which can be used in subsequent Google Drive operations.
How It Works
The Connect node establishes a connection to Google Drive using the provided credentials. When executed, the node:
- Retrieves the credential information from the vault
- Determines the authentication type (user or service account) based on the credential content
- For user credentials:
- If a refresh token exists, it uses it to create an authenticated client
- If no refresh token exists, it initiates the OAuth flow to obtain new tokens
- Updates the credential in the vault with the new tokens after OAuth flow
- For service account credentials:
- Uses the service account JSON directly to authenticate
- Creates a Google Drive service client
- Stores the service client for use by other Google Drive nodes
- Returns a drive_id that can be used to reference this connection in subsequent nodes
Requirements
- Valid Google Drive API credentials (either user credentials or service account credentials)
- Proper OAuth configuration for user credentials (client ID, client secret, etc.)
- Google Drive API enabled in the Google Cloud Console
Error Handling
The node will return specific errors in the following cases:
- Invalid or missing credential content
- OAuth flow failures
- Invalid refresh token
- Google Drive API authentication errors
- Internal errors during credential processing
Usage Notes
- The first time using user credentials, you'll need to complete the OAuth flow which opens a browser window
- After the initial OAuth flow, the refresh token is stored and used for subsequent connections
- Service account credentials don't require OAuth flow and can be used directly
- The drive_id output should be passed to other Google Drive nodes to perform operations on the connected drive
- Make sure your credentials have the necessary permissions for the operations you plan to perform