Actions19
Overview
This node interacts with Google Drive using a Service Account for authentication. Specifically, the 'Folder - List' operation lists folders in Google Drive based on optional filtering, sorting, and pagination parameters. It is useful for workflows that need to retrieve and process folder metadata from Google Drive, such as organizing files, syncing folder structures, or auditing folder contents.
Use Case Examples
- List all folders in the root directory of a Google Drive account.
- Retrieve folders matching a specific query, e.g., folders with names containing 'Project'.
- Fetch a limited number of folders sorted by creation date.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose the authentication method: use saved credentials or enter service account details manually. |
| Service Account Email | Email address of the Google service account used for authentication (required if manual authentication is selected). |
| Private Key | Private key from the service account JSON used for authentication (required if manual authentication is selected). |
| Impersonate Email | Optional email address to impersonate a user (requires domain-wide delegation). |
| Options | Additional parameters to filter, paginate, and sort the folder list. |
Output
JSON
id- Unique identifier of the folder.name- Name of the folder.createdTime- Timestamp when the folder was created.modifiedTime- Timestamp when the folder was last modified.parents- Array of parent folder IDs.
Dependencies
- Google Drive API accessed via googleapis library
- Service Account credentials or saved n8n credentials for authentication
Troubleshooting
- Ensure that the service account has the necessary permissions to access Google Drive and list folders.
- If using manual authentication, verify that the private key is correctly formatted and includes proper newline characters.
- Check that the impersonate email (if used) has domain-wide delegation enabled.
- Common errors include authentication failures due to invalid credentials or insufficient permissions, and query syntax errors in the filter string.
Links
- Google Drive API - Files: list - Official documentation for listing files and folders in Google Drive API.
- Google Cloud Service Accounts - Information about creating and managing Google Cloud service accounts.