# GoogleDrive

Category: Storage
|
Runtime: 0.9+
|
Available: Free

# Overview

Google Drive node is the client to connect with Google Drive. The node helps in upload and download of a file from a folder within google drive.

# Setup

# Prerequisites

For GoogleDrive node to work properly, you need to have a Google cloud account (opens new window) and Service account credential file from Google cloud console. For more details refer service account keys (opens new window).

# Installation

To install the node from designer:

  1. Go to Add more nodes option on the palette section.
  2. Check for the GoogleDrive node and click install.
  3. Once installed, the designer is required to be restarted.

To install the node from CLI:

  1. Go to your project workspace where you can see your package.json file.
  2. Run the below give npm command.
    npm i @kumologica/kumologica-contrib-googledrive

# Technical Details

Properties

  • Folder Id (Required)
    Unique Id of the folder in the drive. if https://drive.google.com/drive/folders/1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g, then the Folder ID would be 1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g.
  • File Name (Required)
    Name of the file to upload or to download. The filename must have the extension.
  • Content (Required)
    Content of the file to be uploaded.
  • Content Type (Required)
    MIME type associated with content of the file.
  • Credential File (Required)
    Service Account credential file generated from Google cloud console. This can be JSON or a PEM file.
  • Request Timeout (Required)
    Timeout associated with client in milliseconds. Default timeout is 15000 milliseconds.

Note
512 mb is the minimum memory requirement for your AWS lambda deployment when using GoogleDrive node. The node currently supports service account based authentication only. The credential JSON file related to service account can be generated from google cloud console.

Supported Operations

  • upload
    Upload operation helps in uploading a document to a given folder in google drive.
  • download
    Download operation helps in downloading a document from a given folder in google drive.

Throws

GoogleDrive node throws the following exception.

  • GoogleDrive Client Failed

Returns

Payload will be overwritten by this node when using download operation. The output of the download operation is a buffer object. In order to access the downloaded content on the subsequent node you can use the following expression msg.payload. None of the variables will be overwritten or enriched by this node.