Google Drive Loader: Include Subfolders ON = Bad Request
Describe the bug
The Google Drive document loader node works correctly when loading files from a single, specified folder. However, when the "Include Subfolders" option is toggled on, the node fails to load or preview documents. It throws a Failed to list files: Bad Request error, indicating the API request sent to Google is malformed when attempting to search recursively.
The issue is independent of the "File Types" configuration, as the error persists even with valid file types selected. The error only occurs when recursive searching is enabled.
To Reproduce
- In Google Drive, create a parent folder and place a document inside it.
- Inside the parent folder, create a subfolder and place another document inside it.
- In Flowise, create a new chatflow.
- Add a Google Drive document loader node.
- Configure the node with valid Google API credentials.
- Set the "Folder ID" to the ID of the parent folder created in step 1.
- Leave "Include Subfolders" turned off. Click "Preview Chunks". Observe that it successfully loads the document from the parent folder.
- Now, turn on the "Include Subfolders" option.
- Click "Preview Chunks" again.
- Observe the error: Failed to list files: Bad Request
Expected behavior
When "Include Subfolders" is enabled, the Google Drive loader should successfully list and load all documents from both the specified parent folder and all of its subfolders without throwing a "Bad Request" error.
Screenshots
Flow
No response
Use Method
Docker
Flowise Version
3.0.5
Operating System
Linux
Browser
Chrome
Additional context
The credentials used are confirmed to be working, as the loader functions correctly when "Include Subfolders" is disabled. The issue seems to be specifically with how the node constructs the recursive file search query for the Google Drive API.
Source: FlowiseAI/Flowise