Google Drive Integration
Want your agents to work with cloud documents? Connect Google Drive to SmythOS and give your agents the power to upload, fetch, and manage files—automatically.
List of Google Drive Components
Component | Action | What it Does | Inputs | Key Outputs | Use Case |
---|---|---|---|---|---|
Upload File | Write | Uploads a file to a Google Drive folder. | file , folderId , fileName , mimeType | driveFile , response | Save a generated report or PDF to Drive. |
List Files | Read | Retrieves a list of files within a folder. | folderId | files , response | List recent uploads for user access or logic branching. |
Get File Metadata | Read | Fetches metadata (name, size, mimeType) for a given file ID. | fileId | driveFile , response | Display file info before download or share. |
Prerequisites
You’ll need:
- A SmythOS account (sign up here)
- A Google account with access to Drive
- Appropriate access to the target files and folders
Connect Google Drive to SmythOS
The integration requires a simple one-time authorization.
Step 1: Add a Drive Component
From the SmythOS Integrations panel, drag in any Google Drive component like "Upload File".
Step 2: Authenticate
You can connect your Google account in two ways:
Option A: Click the Authenticate Button
Option B: Use Component Settings
Open any Drive component → Settings tab → Find the OAuth
section → Click Authenticate
.
You’ll be prompted to:
- Choose your Google account
- Grant permission for file access
- Return to SmythOS—authentication complete 🎉
Component Details
Upload File — Send Files to Google Drive
Upload a file from your agent’s workflow to a specific Google Drive folder.
Inputs
Field | Required | Notes |
---|---|---|
file | required | File object to upload (e.g., from previous component like HTML-to-PDF). |
folderId | required | Target folder’s Drive ID. |
fileName | required | Desired name of the file in Drive (e.g., summary.pdf ). |
mimeType | required | MIME type (e.g., application/pdf , text/plain ). |
Outputs
Field | Description |
---|---|
driveFile | Object with uploaded file’s metadata: name, id, mimeType, webViewLink. |
response | Full API response from Google Drive. |
headers | HTTP headers from Drive API response. |
List Files — Get Files in a Folder
Retrieves all visible files inside a specified folder.
Inputs
Field | Required | Notes |
---|---|---|
folderId | required | ID of the folder to list contents from. |
Outputs
Field | Description |
---|---|
files | Array of file objects with IDs, names, mimeTypes. |
response | Raw API response from Drive. |
headers | HTTP metadata headers. |
Get File Metadata — Inspect a Drive File
Fetch information about a Drive file using its fileId
.
Inputs
Field | Required | Notes |
---|---|---|
fileId | required | Unique ID of the file you want to inspect. |
Outputs
Field | Description |
---|---|
driveFile | Metadata including name, mimeType, modifiedTime, size. |
response | Raw response from Drive API. |
headers | HTTP headers. |
Best Practices
- Use
fileId
andfolderId
dynamically from previous steps to avoid hardcoding - Only request scopes you need (e.g., Drive file access vs full Drive control)
- Store sensitive folder IDs in SmythOS Vault for reusability
- Clean up stale or temporary files by chaining a [Delete File] component (coming soon)
Troubleshooting Tips
404 Errors?
→ Double-check fileId
or folderId
and ensure the file is shared with your connected account.
Permission Denied?
→ Re-authenticate and confirm that consent was granted to view/edit files.
Wrong file format?
→ Be sure to set mimeType
correctly (e.g., application/json
, text/csv
).
What's Next?
You’ve successfully integrated Google Drive with SmythOS!
Now try building an agent that:
- Uploads a file after parsing web content
- Lists files, filters them by name, and downloads specific reports
- Uses
driveFile.webViewLink
to send the user a view-only version of the file - Combine this with Google Sheets Integration