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
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the download operation from Google Drive. | - |
| Source | Data | External file source selection. Configure via the node's UI panel to select the Google Drive connection and specific file to download. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the file has been successfully downloaded to the library. |
| Output | Data | The 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:
- Connection Validation: Verifies that a valid Google Drive connection exists and has the necessary permissions to access the requested file.
- File Download: Downloads the selected file from Google Drive to a temporary location in the project's library storage.
- Metadata Creation: Creates a library file entry with the appropriate MIME type and metadata.
- Cleanup: Removes any temporary local files after successful upload to library storage.
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.
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:
- A Google Drive connection from your project's connections
- 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
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the file upload operation. | - |
| Data | Data | The 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 Name | Data | The name of the file to create in Google Drive (without extension). | - |
| File Type | Enum | The type of file to create: txt (Text File), csv (CSV Table), or docx (Word Document). | txt |
| Connection | Connection | The Google Drive connection to use for authentication. | - |
| Connection Data | Data | Object containing the destination folder ID. Automatically set when selecting a folder in the UI. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the upload operation completes, regardless of success or failure. |
| Output | Data | Boolean 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 astext/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 astext/csv. - Word Documents (
docx): Converts the data to a string, then transforms markdown content into a DOCX format before uploading asapplication/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
- Add a Google Drive: Upload File node to your workflow.
- 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
docxto create a Word document. - Enter a File Name like "Quarterly Report" (the extension is added automatically).
- Connect an AI Write node's output to the Data input to provide the document content.
- Connect a Start node or trigger event to the Run input.
- 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
trueon success, which you can use with an If node to handle success/failure cases.