Actions19
Overview
This node allows users to import files into Google Drive using a service account for authentication. It supports converting the imported file into various Google Workspace formats such as Google Docs, Sheets, Slides, or Drawings. This is useful for automating the upload and conversion of files into Google Drive, enabling seamless integration with Google Workspace for document management and collaboration.
Use Case Examples
- Import a text or base64 encoded file and convert it to a Google Docs document in a specified Google Drive folder.
- Automate the import of spreadsheet files and convert them to Google Sheets format for further processing within Google Workspace.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose the authentication method: use saved credentials or enter service account details manually. |
| Service Account Email | Email address of the 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 of the user to impersonate, requires domain-wide delegation (optional, manual authentication only). |
| File Name | Name of the file to be imported into Google Drive. |
| File Content | Content of the file to import, can be text or base64 encoded. |
| Convert To | Google Workspace format to convert the imported file to, such as Google Docs, Sheets, Slides, or Drawings. |
| Parent Folder ID | ID of the parent folder in Google Drive where the file will be imported. Leave empty to import to the root folder. |
| Additional Fields | Optional additional metadata for the file, such as description and MIME type. |
Output
JSON
fileId- The unique identifier of the imported file in Google Drive.name- The name of the imported file.mimeType- The MIME type of the imported file.parents- Array of parent folder IDs where the file is located.convertedTo- The Google Workspace format to which the file was converted.
Dependencies
- Google Drive API
- Google service account credentials
Troubleshooting
- Ensure that the service account has the necessary permissions to access and modify files in the target Google Drive.
- If using manual authentication, verify that the service account email and private key are correctly entered and formatted (private key must replace escaped newlines with actual newlines).
- For impersonation, ensure domain-wide delegation is properly configured and the impersonate email is valid.
- Common errors include authentication failures due to invalid credentials, permission errors if the service account lacks access, and file format errors if the content or conversion type is incompatible.
Links
- Google Drive API Documentation - Official documentation for the Google Drive API used by this node.
- Google Cloud Service Accounts - Information on creating and managing Google Cloud service accounts.