Google Cloud Storage Enhanced icon

Google Cloud Storage Enhanced

Use the Google Cloud Storage API

Bucket → Delete

AI-generated

Overview

The node provides enhanced integration with Google Cloud Storage, allowing users to manage storage buckets and objects via the Google Cloud Storage API. Specifically, for the Bucket Delete operation, it enables deleting a specified bucket from Google Cloud Storage.

This operation is useful in scenarios where you want to programmatically clean up or remove storage buckets that are no longer needed, such as during automated resource management, cleanup scripts, or infrastructure-as-code workflows.

Example use cases:

  • Automatically delete temporary buckets created for testing after tests complete.
  • Remove buckets as part of a data lifecycle management process.
  • Clean up unused buckets to reduce storage costs.

Properties

Name Meaning
Authentication Method used to authenticate with Google Cloud Storage API. Options: "Service Account" or "OAuth2".
Bucket Name The name of the bucket to delete. This is required.
Filters Optional filters applied when deleting the bucket:
- Metageneration Match Only delete if the bucket's metageneration value matches this number.
- Metageneration Exclude Only delete if the bucket's metageneration value does NOT match this number.

Output

The output JSON contains the response from the Google Cloud Storage API after attempting to delete the bucket. Typically, a successful delete returns an empty response or confirmation of deletion.

If an error occurs (e.g., bucket not found, permission denied), the output will contain an error message describing the issue.

No binary data is output by this operation.

Dependencies

  • Requires valid authentication credentials for Google Cloud Storage, either via a service account or OAuth2.
  • The node uses the Google Cloud Storage REST API endpoints.
  • Proper permissions must be granted to the authenticated user/service account to delete buckets.
  • No additional environment variables beyond standard n8n credential setup are required.

Troubleshooting

  • Common issues:

    • Permission Denied: The authenticated user lacks permission to delete the bucket. Ensure the credentials have storage.buckets.delete permission.
    • Bucket Not Found: The specified bucket name does not exist or is misspelled.
    • Metageneration Mismatch: If using metageneration filters, the bucket's current metageneration may not match the provided filter, causing the delete to be skipped or fail.
  • Error messages:

    • "403 Forbidden": Insufficient permissions; verify IAM roles and credentials.
    • "404 Not Found": Bucket does not exist.
    • "412 Precondition Failed": Metageneration precondition failed; check filter values.

To resolve errors, verify bucket existence, correct bucket name spelling, and ensure the credentials have appropriate permissions.

Links and References

Discussion