Actions19
Overview
This node allows interaction with Google Drive using a Service Account for authentication. Specifically, the 'Get' operation under the 'File' resource retrieves metadata and details of a specified file by its ID. This is useful for scenarios where you need to fetch file information programmatically, such as automating file management, auditing file properties, or integrating file data into workflows.
Use Case Examples
- Retrieve metadata of a Google Drive file by its ID to display file details in a dashboard.
- Fetch file information to verify file existence or properties before performing further operations like download or update.
Properties
| Name | Meaning |
|---|---|
| Authentication | Selects the authentication method: either using saved n8n credentials or manual entry of service account details. |
| Service Account Email | The email address of the Google service account used for authentication (required if manual authentication is selected). |
| Private Key | The private key associated with the service account, used for authentication (required if manual authentication is selected). |
| Impersonate Email (Optional) | Email address of a user to impersonate, requiring domain-wide delegation (optional, manual authentication only). |
| File ID | The unique identifier of the file in Google Drive to retrieve information about. |
Output
JSON
fileId- The unique identifier of the file.name- The name of the file.mimeType- The MIME type of the file.createdTime- The creation timestamp of the file.modifiedTime- The last modification timestamp of the file.size- The size of the file in bytes.parents- Array of parent folder IDs containing the file.*- All other metadata fields returned by the Google Drive API for the file.
Dependencies
- Google Drive API
- Google Service Account credentials
Troubleshooting
- Ensure that the service account has the necessary permissions to access the specified file ID.
- If using manual authentication, verify that the private key is correctly formatted and includes proper newline characters.
- Common error: 'No credentials provided' indicates missing or incorrect authentication setup; resolve by selecting valid credentials or entering manual details.
- Errors related to file not found usually mean the file ID is incorrect or the service account lacks access rights.
Links
- Google Drive API - Files: get - Official documentation for the Google Drive API method to get file metadata.
- Google Cloud Service Accounts - Information about Google Cloud service accounts and how to use them for authentication.