Google Drive Node
Overview
The Google Drive Node is a file synchronization and management component that automates fetching and synchronizing files from Google Drive and supports action-based operations for creating, editing, and managing docs and folders. As a Batch Trigger, it supports various file types including Google Docs, Slides, Word Documents, PDFs, and text files for vectorization and indexing in RAG flows. As an Action node, it lets you create Google Docs, edit files, create folders, list files, move files, and get file metadata.
Node Type Information
| Type | Description | Status |
|---|---|---|
| Batch Trigger | Starts the flow on a schedule or batch event. Ideal for periodic data processing. | ✅ True |
| Event Trigger | Starts the flow based on external events (e.g., webhook, user interaction). | ❌ False |
| Action | Executes a task or logic as part of the flow (e.g., API call, transformation). | ✅ True |
This node is a Batch Trigger node that automates file fetching and synchronization from Google Drive, and an Action node for creating, editing, and managing docs and folders.
This node is a Batch Trigger node that streamlines file collection from Google Drive and prepares files for vectorization and indexing to enhance RAG flows. It also supports Action mode for direct operations on Google Drive (create doc, edit file, create folder, list files, move file, get file metadata).
To use the Google Drive node, you need to create a separate flow to Implement RAG. You can integrate it into this distinct flow.
Features
Key Functionalities
- Batch Trigger: Automates file fetching and synchronization on a schedule using Cron expressions for regular execution.
- Action Operations: Create Google Docs, edit files (Markdown → DOCX), create folders, list files, move files, and get file metadata.
- File Type Support: Handles multiple file formats including Google Docs, Slides, Word Documents, PDFs, and text files.
- Synchronization Modes: Supports both incremental (process new/updated files only) and full-refresh (reprocess all files) modes.
- Folder-based Processing: Processes files from specified Google Drive folders with configurable access permissions.
Benefits
- Streamlined File Collection: Automates the process of collecting files from Google Drive, reducing manual effort and ensuring consistency.
- RAG Flow Preparation: Prepares files for vectorization and indexing to enhance Retrieval-Augmented Generation workflows.
- Scheduled Synchronization: Enables regular file updates through configurable scheduling, keeping data current.
- Flexible Processing: Supports both incremental and full synchronization modes to optimize processing efficiency.
- Direct Drive Operations: Create and edit Google Docs from Markdown, manage folders, list/move files, and fetch metadata from within flows.
Prerequisites
Before using Google Drive Node, ensure the following:
- Google Drive Credentials: Valid Google authentication details for accessing the desired folder.
- Target Folder URL: The specific Google Drive folder URL from which files will be fetched.
- Cron Expression Knowledge: Understanding of Cron expressions for scheduling flows.
- RAG Flow Setup: A separate flow configured for implementing Retrieval-Augmented Generation.
Setup
Step 1: Set Up Google Drive Access
-
Create Google Drive Credentials:
- Set up Google OAuth credentials for Drive API access
- Ensure proper permissions for the target folder
- Test folder accessibility and file permissions
-
Identify Target Folder:
- Copy the Google Drive folder URL
- Verify folder contains supported file types
- Ensure folder is accessible with provided credentials
Step 2: Configure Google Drive Credentials
Use the following format to set up your credentials:
| Key Name | Description | Example Value |
|---|---|---|
| Credential Name | Name to identify this set of credentials | my-google-drive-creds |
| Google OAuth | Google authentication details for Drive access | Google Drive OAuth |
Step 3: Set Up Lamatic Flow
-
For Batch Trigger: Create a custom flow for Google Drive:
- Configure the Google Drive node as trigger
- Set up scheduling parameters
- Define synchronization preferences
-
For Action Node: Add the Google Drive node as an action in your flow:
- Set up Google Drive credentials
- Select the desired action (Create Google Doc, Edit File, Create Folder, List files, Move File, Get File Metadata)
- Configure action-specific parameters
-
Use Pre-built Usecases from the Lamatic Studio
Configuration Reference
Batch Trigger Configuration
| Parameter | Description | Required | Example |
|---|---|---|---|
| Name | Display name for the node | ✅ | Google Drive |
| Credentials | Google authentication details required to connect to the Drive folder | ✅ | my-google-drive-credentials |
| Folder | The folder from which files will be fetched | ✅ | https://drive.google.com/drive/folders/{folder-id} |
| Sync Mode | Specify either incremental (process new/updated files only) or full-refresh (reprocess all files) | ✅ | incremental |
| Sync Schedule | Frequency for running the flow, specified using a Cron expression | ✅ | 0 0 05 1/1 * ? * UTC |
Action Node Configuration
Configure the Google Drive node as an action by selecting the desired action and providing the required parameters.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Credentials | Google authentication details for Drive access | ✅ | my-google-drive-credentials |
| Action | Action to perform (see available actions below) | ✅ | Create Google Doc |
Available Actions
1. Create Google Doc
Creates a new Google Doc. Markdown content is converted to DOCX and uploaded to Drive.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Document Title | Name for the new DOCX file (Markdown content is converted to DOCX) | ✅ | My Report |
| Parent Folder | Optional parent folder for the new doc. Leave empty for root | ❌ | https://drive.google.com/drive/folders/{folder-id} |
| Initial Content (Markdown) | Optional initial content in Markdown. Converted to DOCX and uploaded to Drive | ❌ | # Heading\n\nParagraph text |
2. Edit File
Updates an existing file. Markdown content is converted to DOCX; the existing file is replaced with the new DOCX.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Folder | Folder containing the file to update | ✅ | https://drive.google.com/drive/folders/{folder-id} |
| File | The file to update | ✅ | report.docx |
| Content (Markdown) | Markdown content. Converted to DOCX; existing file is replaced | ✅ | # Updated content |
3. Create Folder
Creates a new folder in Google Drive.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Folder Name | Name for the new folder | ✅ | Q1 Reports |
| Parent Folder | Optional parent folder. Leave empty for root | ❌ | https://drive.google.com/drive/folders/{folder-id} |
4. List files in Folder
Lists files in a specified folder.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Folder | Folder to list files in | ✅ | https://drive.google.com/drive/folders/{folder-id} |
| Page Size | Max number of files to return (1–1000) | ❌ | 100 |
5. Move File
Moves a file to a different folder.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Folder | Folder containing the file to move | ✅ | https://drive.google.com/drive/folders/{folder-id} |
| File | The file to move | ✅ | document.docx |
| Destination Folder | The folder to move the file into | ✅ | https://drive.google.com/drive/folders/{dest-folder-id} |
6. Get File Metadata
Fetches metadata for a specific file.
| Parameter | Description | Required | Example |
|---|---|---|---|
| Folder | Folder containing the file | ✅ | https://drive.google.com/drive/folders/{folder-id} |
| File | The file to get metadata for | ✅ | report.docx |
Low-Code Example
Batch Trigger Example
triggerNode:
nodeId: triggerNode_1
nodeType: googleDriveNode
nodeName: Google Drive
values:
process: batch
syncMode: incremental_append
credentials: Google Drive OAuth
cronExpression: 0 0 */12 ? * * UTC
folderUrl: https://drive.google.com/drive/folders/YOUR_IDAction Node Example
- nodeId: googleDriveNode_1
nodeType: googleDriveNode
nodeName: Google Drive
values:
credentials: Google Drive OAuth
action: createGoogleDoc # or editFile, createFolder, listFiles, moveFile, getFileMetadata
documentTitle: ''
parentFolder: ''
initialContentMarkdown: ''
folder: ''
file: ''
contentMarkdown: ''
folderName: ''
pageSize: 100
destinationFolder: ''
needs:
- triggerNode_1Testing
For testing purposes, you need to manually provide content and document_key as dummy data. Once deployed, these values will be automatically fetched from your configured Google Drive folder.
Test Configuration
{
"document_key": "test_document.pdf",
"content": "This is test content that will be processed for RAG flows"
}document_key: Serves as the unique identifier for the document, used to locate or update the specific file or filename.content: Represents the data or text that will be stored in the document.
Output
Batch Trigger Output
document_key: String identifier for the document (filename or unique key)content: String containing the document content or text datametadata: Additional file information (if available)file_type: Type of the processed filelast_modified: Timestamp of last modificationfile_size: Size of the file in bytes
Action Node Output
Action node output depends on the action performed:
- Create Google Doc: Returns the new document ID and metadata (e.g.,
id,name,webViewLink). - Edit File: Returns updated file metadata.
- Create Folder: Returns the new folder ID and metadata.
- List files in Folder: Returns a list of files with
id,name,mimeType, and related metadata; length limited by Page Size. - Move File: Returns updated file metadata including new parent folder.
- Get File Metadata: Returns file metadata (e.g.,
id,name,mimeType,size,createdTime,modifiedTime).
Troubleshooting
Common Issues
| Problem | Solution |
|---|---|
| Invalid Credentials | Verify that the correct Google Drive credentials are provided |
| Folder Not Found | Ensure the folder URL is accurate and accessible |
| Sync Not Working | Check the Cron expression for correctness |
| File Types Unsupported | Confirm that the files in the folder are of supported types (Google Docs, PDFs, etc.) |
| Permission Errors | Verify Google Drive API access permissions and folder sharing settings |
| Scheduling Issues | Validate Cron expression syntax and timezone settings |
| Action Fails | For action node: verify Folder/File IDs or URLs, credentials scope, and required params |
Debugging
- Check Lamatic Flow logs for detailed error messages
- Verify Google Drive API access permissions
- Test the folder URL to ensure it's valid and accessible
- Validate Cron expression syntax using online Cron validators
- Monitor file processing logs for specific file errors
- Test with a small folder containing few files before scaling up
- Verify network connectivity and API rate limits