Skip to main content

Delete File

Deletes a file from Google's Gemini API using the file URI.

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

Output

  • Result - A structured response indicating the success or failure of the deletion operation.

How It Works

The Delete File node removes a previously uploaded file from Google's Gemini API. When executed, the node:

  1. Validates the provided connection ID and file URI
  2. Retrieves the Gemini client using the connection ID
  3. Sends a delete request to the Gemini API for the specified file URI
  4. Measures the operation time for performance tracking
  5. Returns a structured response with success status and metadata

Requirements

  • A valid Google Gemini API key
  • Connection ID from a successful Connect node execution
  • Valid file URI from a previous file upload operation

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection ID
  • Empty or invalid File URI
  • File not found (404 error or "not found" in error message)
  • API errors from Google's Gemini service

Usage Notes

  • The file URI must be the full URI returned from a file upload operation
  • Deleted files cannot be recovered
  • The operation time is included in the result metadata for performance monitoring
  • If a file has already been deleted or expired, a specific "File not found" error will be returned