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.