Google Drive
Connect Google Drive to make files available to StackAI or work with files in a workflow. Choose the path that matches your task:
Answer questions using a selected set of documents: create a knowledge base and add the files you want to index.
Search the connected service when a question is asked: use Federated Search.
Read, create, move, or update a file in a workflow: choose an action from the reference below.
Connectors
Choose the connector that matches your authentication method. The options below use the names shown in StackAI.
Google Drive
OAuth sign-in
Google Drive
Connect to Google Drive to access your documents, spreadsheets, and files. Supports reading, writing, and searching files.
Set up in Google Drive
Sign in with your Google account when the Google window opens.
Set up in StackAI
Open Settings → Connections, add a connection, and select Google Drive.
Select Connect, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
StackAI obtains the OAuth credentials during sign-in. You do not need to paste an access token or refresh token.
Provider documentation: Setup reference.
Verify the connection
Check that the connection is healthy, then verify access with a read operation:
Add Get File and select the saved Google Drive connection.
In File, select a file that the connected Google account can read. Leave Parse Content enabled for a supported text document.
Run the action. Confirm the file's identity in File Metadata and inspect Parsed Text Content. Reading one file does not establish access to other files or shared drives.
A successful connection check confirms authentication. It does not guarantee permission for every action.
If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.
Use an action
Add the required Google Drive action to the workflow.
Select a connection when the action requests one.
Complete the required fields. Use the reference picker when a value comes from another workflow step.
Run the workflow and inspect the action’s output. Check the result before using it in a later step.
Actions
Get File
Get a file's metadata, content, or parsed text from Google Drive
Inputs
File
file_picker
Yes
Browse your Google Drive to select a file, or enter a file ID manually.
Parse Content
boolean
No
Whether to parse the file content into text using DocumentFactory. Default: true.
Use OCR
boolean
No
Whether to use OCR for processing images and scanned documents. Default: false.
Chunk Length
integer
No
Length of text chunks when parsing documents (default: 1500). Default: 1500.
Alt
string
No
Query param: alt (e.g. 'media' to download file content).
Acknowledge Abuse
boolean
No
Query param: acknowledgeAbuse (set true to acknowledge risk).
Revision ID
string
No
Query param: revisionId (specifies revision to download).
Supports All Drives
boolean
No
Query param: supportsAllDrives. Default: true.
Outputs
Result Message
string
A message indicating the result of the file get operation.
File Metadata
object
Metadata of the file.
File Content (base64)
string
Base64-encoded file content (if not parsed).
Parsed Text Content
string
Parsed text content from the file (if parse_content=True).
Document Pages
string
Structured document pages with text and metadata (if parse_content=True).
Download URL
string
The download URL of the file uploaded to storage.
Create File
Create a file in Google Drive from a URL or base64 content, optionally converting it to a native Google Docs/Sheets/Slides document.
Inputs
File Name
string
Yes
Name of the file to create.
File Type
select (string)
No
The file's format. Leave on Auto-detect to work it out from the file itself. Available values: Auto-detect, PDF, Plain Text, CSV, JSON, Word Document, Word Document (DOCX), Excel Spreadsheet, Excel Spreadsheet (XLSX), PowerPoint Presentation, PowerPoint Presentation (PPTX), JPEG Image, PNG Image, GIF Image, ZIP Archive, MP4 Video, MP3 Audio. Default: auto.
Convert to Google Format
select (string)
No
Turn the upload into an editable Google file. Auto converts when it can: Excel and CSV become Google Sheets, Word becomes Docs, PowerPoint becomes Slides. Everything else uploads unchanged. Pick Keep original to never convert, or name a format to force it. Available values: Keep original, Auto, Google Docs, Google Sheets, Google Slides. Default: keep.
Parent Folder IDs
string_array
No
List of parent folder IDs (optional).
File Content (base64)
string
No
Base64-encoded file content (optional). If omitted, creates metadata-only file.
File URL
string
No
URL of the file to upload (optional). If omitted, creates metadata-only file.
Description
string
No
Description of the file (optional).
Starred
boolean
No
Would you like to star the file? (optional, default: false).
Outputs
Result Message
string
A message indicating the result of the file create operation.
File Metadata
object
Metadata of the created file.
Delete File
Delete a file from Google Drive (move to trash or permanently delete)
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File to Delete
select (string)
Yes
Choose the file you want to remove. Options load from the selected connection.
Delete Permanently
boolean
No
Skip trash and delete forever (cannot be undone). Default: false.
Outputs
Result Message
string
A message indicating the result of the delete operation.
Deleted File ID
string
The ID of the deleted file.
Permanently Deleted
boolean
Whether the file was permanently deleted or moved to trash.
Move File
Move a file to a different folder in Google Drive
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File to Move
select (string)
Yes
Choose the file you want to relocate. Options load from the selected connection.
Move To
select (string)
Yes
Choose the folder where the file will be moved. Options load from the selected connection.
Outputs
Result Message
string
A message indicating the result of the move operation.
File Metadata
object
Updated metadata of the moved file.
Update File
Update a file's metadata or replace its content in Google Drive. Falls back to creating a new file on permission errors.
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File to Update
select (string)
Yes
Choose the file you want to modify. Options load from the selected connection.
New Name
string
No
Enter a new name, or leave empty to keep current.
Description
string
No
Add a description to help identify this file.
Add to Starred
boolean
No
Mark this file as a favorite for quick access.
File URL
string
No
URL to download replacement content from.
Outputs
Result Message
string
A message indicating the result of the update operation.
File Metadata
object
Updated metadata of the file.
Method
string
Whether the file was 'updated' or 'created' (fallback).
Share File or Folder
Share a file or folder with users, groups, domains, or make it public
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File or Folder
select (string)
Yes
Select the file or folder to share. Options load from the selected connection.
Share With
select (string)
Yes
Who to share the file with. Available values: Person or group, Everyone in my organization, Anyone with link.
Access Level
select (string)
No
What the recipient can do with the file. Available values: Viewer (read-only), Commenter, Editor (can edit). Default: reader.
Email Addresses
string
No
Email addresses to share with (comma-separated for multiple).
Domain
string
No
Your organization's domain name.
Send Notification Email
boolean
No
Send an email to let them know you've shared.
Message
string
No
Add a personal message to the notification.
Outputs
Result Message
string
A message indicating the result of the share operation.
Permission ID
string
ID(s) of the created permission(s).
Shareable Link
string
Link to access the shared file or folder.
Create Shareable Link
Create a link that anyone can use to access a file or folder
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File or Folder
select (string)
Yes
Choose what you want to create a shareable link for. Options load from the selected connection.
Link Permissions
select (string)
No
What anyone with the link can do. Available values: Viewer (read-only), Commenter, Editor (can edit). Default: reader.
Outputs
Result Message
string
A message indicating the result of the operation.
Shareable Link
string
Link that anyone can use to access the file or folder.
Name
string
Name of the file or folder.
Access Level
string
What people with the link can do.
Get Download Link
Get a download URL for a file in Google Drive
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
File to Download
select (string)
Yes
Choose the file you want to download. Options load from the selected connection.
Outputs
Result Message
string
A message indicating the result of the download operation.
Download URL
string
API download URL for the file. Note: This URL requires authentication (OAuth token) to access.
File Metadata
object
Metadata of the file.
Search Files
Search for files in Google Drive by name, type, or custom query
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
Search by Name
string
No
Find files containing this text in their name.
Search In
select (string)
No
Limit search to a specific folder, or leave empty to search entire drive. Options load from the selected connection.
File Type
select (string)
No
Filter by file type. Available values: All Files, Documents (Google Docs), Spreadsheets (Google Sheets), Presentations (Google Slides), PDFs, Images, Videos, Audio. Default: all.
Custom Query (Advanced)
string
No
For power users: write custom search queries.
Outputs
Result Message
string
A message indicating the result of the search operation.
Files
dict_array
List of files matching the search criteria.
Total Count
number
Number of files found.
Create Folder
Create a new folder in Google Drive
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
Destination Folder
select (string)
No
Leave empty to create at root of the drive. Options load from the selected connection.
Folder Name
string
Yes
Name for the new folder.
Skip if Name Exists
boolean
No
Returns the existing folder if one with the same name already exists. Default: false.
Outputs
Result Message
string
A message indicating the result of the create operation.
Folder Metadata
object
Metadata of the created folder.
Already Existed
boolean
Whether the folder already existed (when create_if_unique is enabled).
Search Folders
Search for folders in Google Drive by name
Inputs
Drive
select (string)
No
Select a Shared Drive, or leave as My Drive. Options load from the selected connection. Default: my-drive.
Search by Name
string
Yes
Search for folders containing this text.
Search In
select (string)
No
Limit search to a specific folder, or leave empty to search entire drive. Options load from the selected connection.
Outputs
Result Message
string
A message indicating the result of the search operation.
Folders
dict_array
List of folders matching the search criteria.
Total Count
number
Number of folders found.
Triggers
A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.
On Drive Change
Trigger a workflow execution when any changes occur in Google Drive.
Configuration
Trigger when...
select (string)
No
What type of file change should trigger this workflow. Available values: Any file activity, A new file is added, A file is modified, A file is deleted. Default: all.
Source Drive
select (string)
No
Select My Drive or a Shared Drive to monitor. Options load from the selected connection. Default: my-drive.
Folder to Monitor
select (string)
No
Monitor changes in a specific folder, or leave empty for entire drive. Options load from the selected connection.
Specific File
select (string)
No
Monitor a single file only, or leave empty to watch all files. Options load from the selected connection.
Event inputs
Resource State
string
Yes
The state change that occurred (e.g., 'change', 'sync'). Default: None.
Changed Resource ID
string
Yes
The ID of the changed resource. Default: None.
Changed Resource Name
string
Yes
The name of the changed resource. Default: NaN.
Change Type
string
No
The type of change (new_file, updated, deleted). Default: unknown.
MIME Type
string
No
The MIME type of the changed file.
Parent Folder ID
string
No
The ID of the parent folder containing the changed file.
Modified Time
string
No
The last modification timestamp of the file.
Outputs
Resource State
string
The type of change that occurred.
Changed Resource ID
string
The ID of the changed resource.
Changed Resource Name
string
The name of the changed resource.
Change Type
string
The type of change (new_file, updated, deleted).
MIME Type
string
The MIME type of the changed file.
Parent Folder ID
string
The ID of the parent folder containing the changed file.
Modified Time
string
The last modification timestamp of the file.
Important behavior
If an operation is denied, check the connection’s granted permissions and the account’s access in the provider. Reauthorize the connection when it needs additional permissions.
Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.
The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.
Last updated
Was this helpful?

