docs
Apps
Google Drive Node

Google Drive Node

Loading node sections...

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

TypeDescriptionStatus
Batch TriggerStarts the flow on a schedule or batch event. Ideal for periodic data processing.✅ True
Event TriggerStarts the flow based on external events (e.g., webhook, user interaction).❌ False
ActionExecutes 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
  1. Batch Trigger: Automates file fetching and synchronization on a schedule using Cron expressions for regular execution.
  2. Action Operations: Create Google Docs, edit files (Markdown → DOCX), create folders, list files, move files, and get file metadata.
  3. File Type Support: Handles multiple file formats including Google Docs, Slides, Word Documents, PDFs, and text files.
  4. Synchronization Modes: Supports both incremental (process new/updated files only) and full-refresh (reprocess all files) modes.
  5. Folder-based Processing: Processes files from specified Google Drive folders with configurable access permissions.
Benefits
  1. Streamlined File Collection: Automates the process of collecting files from Google Drive, reducing manual effort and ensuring consistency.
  2. RAG Flow Preparation: Prepares files for vectorization and indexing to enhance Retrieval-Augmented Generation workflows.
  3. Scheduled Synchronization: Enables regular file updates through configurable scheduling, keeping data current.
  4. Flexible Processing: Supports both incremental and full synchronization modes to optimize processing efficiency.
  5. 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

  1. 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
  2. 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 NameDescriptionExample Value
Credential NameName to identify this set of credentialsmy-google-drive-creds
Google OAuthGoogle authentication details for Drive accessGoogle Drive OAuth

Step 3: Set Up Lamatic Flow

  1. For Batch Trigger: Create a custom flow for Google Drive:

    • Configure the Google Drive node as trigger
    • Set up scheduling parameters
    • Define synchronization preferences
  2. 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
  3. Use Pre-built Usecases from the Lamatic Studio

Configuration Reference

Batch Trigger Configuration

ParameterDescriptionRequiredExample
NameDisplay name for the nodeGoogle Drive
CredentialsGoogle authentication details required to connect to the Drive foldermy-google-drive-credentials
FolderThe folder from which files will be fetchedhttps://drive.google.com/drive/folders/{folder-id}
Sync ModeSpecify either incremental (process new/updated files only) or full-refresh (reprocess all files)incremental
Sync ScheduleFrequency for running the flow, specified using a Cron expression0 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.

ParameterDescriptionRequiredExample
CredentialsGoogle authentication details for Drive accessmy-google-drive-credentials
ActionAction 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.

ParameterDescriptionRequiredExample
Document TitleName for the new DOCX file (Markdown content is converted to DOCX)My Report
Parent FolderOptional parent folder for the new doc. Leave empty for roothttps://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.

ParameterDescriptionRequiredExample
FolderFolder containing the file to updatehttps://drive.google.com/drive/folders/{folder-id}
FileThe file to updatereport.docx
Content (Markdown)Markdown content. Converted to DOCX; existing file is replaced# Updated content
3. Create Folder

Creates a new folder in Google Drive.

ParameterDescriptionRequiredExample
Folder NameName for the new folderQ1 Reports
Parent FolderOptional parent folder. Leave empty for roothttps://drive.google.com/drive/folders/{folder-id}
4. List files in Folder

Lists files in a specified folder.

ParameterDescriptionRequiredExample
FolderFolder to list files inhttps://drive.google.com/drive/folders/{folder-id}
Page SizeMax number of files to return (1–1000)100
5. Move File

Moves a file to a different folder.

ParameterDescriptionRequiredExample
FolderFolder containing the file to movehttps://drive.google.com/drive/folders/{folder-id}
FileThe file to movedocument.docx
Destination FolderThe folder to move the file intohttps://drive.google.com/drive/folders/{dest-folder-id}
6. Get File Metadata

Fetches metadata for a specific file.

ParameterDescriptionRequiredExample
FolderFolder containing the filehttps://drive.google.com/drive/folders/{folder-id}
FileThe file to get metadata forreport.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_ID

Action 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_1

Testing

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 data
  • metadata: Additional file information (if available)
    • file_type: Type of the processed file
    • last_modified: Timestamp of last modification
    • file_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

ProblemSolution
Invalid CredentialsVerify that the correct Google Drive credentials are provided
Folder Not FoundEnsure the folder URL is accurate and accessible
Sync Not WorkingCheck the Cron expression for correctness
File Types UnsupportedConfirm that the files in the folder are of supported types (Google Docs, PDFs, etc.)
Permission ErrorsVerify Google Drive API access permissions and folder sharing settings
Scheduling IssuesValidate Cron expression syntax and timezone settings
Action FailsFor 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

Additional Resources

Was this page useful?

Questions? We're here to help

Subscribe to updates