Actions19
Overview
This node allows users to delete a file from Google Drive using a service account for authentication. It supports both credential-based and manual authentication methods. The node is useful in automation workflows where files need to be programmatically removed from Google Drive, such as cleaning up temporary files or managing storage.
Use Case Examples
- Deleting a specific file by its ID to free up space.
- Automating file removal after processing or backup tasks.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose the authentication method to use: either saved n8n credentials or manual entry for each execution. |
| Service Account Email | The email address of the service account used for authentication (required if manual authentication is selected). |
| Private Key | The 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 ID | The ID of the file to delete from Google Drive. |
Output
JSON
success- Boolean indicating if the file deletion was successful.fileId- The ID of the file that was deleted.
Dependencies
- Google Drive API accessed via googleapis library
- Service account credentials or OAuth credentials for authentication
Troubleshooting
- Ensure the service account has the necessary permissions to delete files in the target Google Drive.
- Verify that the provided File ID is correct and the file exists.
- If using manual authentication, ensure the private key is correctly formatted (newline characters replaced properly).
- Common error: 'No credentials provided' - occurs if no credentials are selected or provided; resolve by selecting saved credentials or entering manual credentials.
- API errors related to permissions or file not found should be checked against Google Drive API documentation and service account permissions.
Links
- Google Drive API - Files: delete - Official documentation for deleting files using the Google Drive API.