Skip to main content

Delete File/Folder

Deletes a file or folder from Google Drive.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Drive Id - The identifier for the connected Google Drive service obtained from the Connect node.
  • File Id - The unique identifier of the file or folder to be deleted.

How It Works

The Delete File/Folder node permanently removes a file or folder from Google Drive. When executed, the node:

  1. Validates the required inputs (Drive Id and File Id)
  2. Retrieves the Google Drive service client using the provided Drive Id
  3. Uses the Google Drive API to delete the file or folder with the Files.Delete method
  4. The deletion is permanent and cannot be undone through the API

Requirements

  • A valid Google Drive connection established using the Connect node
  • The File Id of an existing file or folder in Google Drive
  • Appropriate permissions to delete the specified file or folder

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Drive Id
  • Empty or invalid File Id
  • Google Drive API errors during the deletion
  • Insufficient permissions to delete the file or folder
  • Attempting to delete a file or folder that doesn't exist

Usage Notes

  • This operation is permanent and cannot be undone through the API
  • When deleting a folder, all of its contents are also deleted
  • Make sure you have the necessary permissions to delete the file or folder
  • Consider using caution with this node, especially in production environments
  • The node does not return any output as the file or folder is completely removed