Skip to main content

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.