Skip to main content

Google Drive


Google Drive:Download File

Controlled node

Overview

Downloads a file from a connected Google Drive account and saves it as a temporary file in the project's library. This node requires a Google Drive connection to be configured in the project settings.

The node handles the authentication and download process automatically, returning a file object that can be used with other nodes such as Read PDF, Read Image, or Read Document.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the download operation from Google Drive.-
SourceDataExternal file source selection. Configure via the node's UI panel to select the Google Drive connection and specific file to download.-

Outputs

OutputTypeDescription
DoneEventFires when the file has been successfully downloaded to the library.
OutputDataThe downloaded file object containing id, name, mimeType, size, and dir (directory) properties. Returns null if no file was selected or the download failed.

Runtime Behavior and Defaults

When triggered, the node performs the following operations:

  1. Connection Validation: Verifies that a valid Google Drive connection exists and has the necessary permissions to access the requested file.
  2. File Download: Downloads the selected file from Google Drive to a temporary location in the project's library storage.
  3. Metadata Creation: Creates a library file entry with the appropriate MIME type and metadata.
  4. Cleanup: Removes any temporary local files after successful upload to library storage.
File Size Limits

Large files may take longer to download and process. The node handles the download asynchronously and will fire the Done event once the file is fully available in the library.

Connection Requirements

Ensure your Google Drive connection has the necessary scopes to read files. If the file is not accessible or the connection is invalid, the Output will return null or an error object.

Example Usage

Basic File Download

Connect a Start node or any trigger event to the Run input. Configure the Source input by selecting:

  1. A Google Drive connection from your project's connections
  2. The specific file you want to download from the file picker

Once triggered, the node will download the file and output the file object on the Output socket, which can be connected to document processing nodes.

[Start] --(run)--> [Google Drive: Download File] --(output)--> [Read PDF] --(text)--> [Show]
|
(done)
|
[Next Node]

Processing Downloaded Files

The output file object can be used with various reader nodes:

  • Connect to Read PDF to extract text from PDF documents
  • Connect to Read Image to process image files
  • Connect to Read Document to handle DOCX or other document formats
  • Connect to Write To Library to move the temporary file to a permanent location

The file object returned has the following structure:

{
"id": "file-uuid",
"name": "document.pdf",
"mimeType": "application/pdf",
"size": 1024000,
"dir": "temporary"
}

Google Drive:Upload File

Controlled node

Overview

Uploads files to Google Drive from your workflow. This node supports creating text files, CSV tables, and Word documents (.docx) directly in your Google Drive account. You must configure a Google Drive connection and select a destination folder before uploading.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the file upload operation.-
DataDataThe content to upload. For text files, provide a string. For CSV, provide a string or an array of objects/arrays. For DOCX, provide text content (markdown supported).-
File NameDataThe name of the file to create in Google Drive (without extension).-
File TypeEnumThe type of file to create: txt (Text File), csv (CSV Table), or docx (Word Document).txt
ConnectionConnectionThe Google Drive connection to use for authentication.-
Connection DataDataObject containing the destination folder ID. Automatically set when selecting a folder in the UI.-

Outputs

OutputTypeDescription
DoneEventFires when the upload operation completes, regardless of success or failure.
OutputDataBoolean indicating whether the upload was successful (true) or failed (false).

Runtime Behavior and Defaults

When triggered by the Run event, the node processes the input data based on the selected File Type:

  • Text Files (txt): Converts the data input to a string and uploads as text/plain.
  • CSV Files (csv): If the data is a string, uploads it directly. If the data is an array or object, converts it to CSV format using standard CSV encoding before uploading as text/csv.
  • Word Documents (docx): Converts the data to a string, then transforms markdown content into a DOCX format before uploading as application/vnd.openxmlformats-officedocument.wordprocessingml.document.

The node requires a valid Google Drive connection with appropriate permissions. If no destination folder is specified in Connection Data, the file will be uploaded to the first permitted folder available in the connection settings.

The Output returns true only if the file is successfully created in Google Drive. If the connection is invalid, permissions are insufficient, or the upload fails, the output will be false.

Example

Uploading a Generated Report to Google Drive

  1. Add a Google Drive: Upload File node to your workflow.
  2. Configure the node:
    • Select your Connection from the dropdown (requires a pre-configured Google Drive connection).
    • Select a destination Folder using the folder picker.
    • Set File Type to docx to create a Word document.
    • Enter a File Name like "Quarterly Report" (the extension is added automatically).
  3. Connect an AI Write node's output to the Data input to provide the document content.
  4. Connect a Start node or trigger event to the Run input.
  5. When the workflow runs, the AI-generated content will be converted to a Word document and uploaded to the selected Google Drive folder. The Output will return true on success, which you can use with an If node to handle success/failure cases.