Cloudflare R2 icon

Cloudflare R2

Interact with Cloudflare R2 object storage. Upload, download, manage files and buckets. Supports batch operations, multipart uploads, and can be used as a tool by AI Agents.

Overview

This node enables interaction with Cloudflare R2 object storage, specifically focusing here on managing buckets. The "Delete" operation for the "Bucket" resource allows users to delete an existing R2 bucket by specifying its unique name. This is useful for cleaning up unused or obsolete buckets to manage storage costs and organization.

Practical scenarios include:

  • Removing a bucket that is no longer needed after migrating data elsewhere.
  • Automating cleanup of temporary buckets created during workflows.
  • Managing lifecycle of buckets programmatically within larger automation pipelines.

Properties

Name Meaning
Bucket Name The unique name of the R2 bucket to delete. Must be globally unique across all Cloudflare R2 buckets.

Output

The output JSON contains:

  • success (boolean): Indicates whether the deletion was successful.
  • message (string): A confirmation message stating the bucket name that was deleted.

Example output:

{
  "success": true,
  "message": "Bucket my-r2-bucket deleted"
}

No binary data is output for this operation.

Dependencies

  • Requires an API key credential for authenticating with Cloudflare R2.
  • The node depends on internal utility functions to validate bucket names and perform the deletion via Cloudflare's API.
  • Proper configuration of the Cloudflare R2 API credentials in n8n is necessary.

Troubleshooting

  • Invalid bucket name format: If the bucket name does not meet Cloudflare R2 naming rules, the node will throw an error. Ensure the bucket name is valid and unique.
  • Bucket not found or already deleted: Attempting to delete a non-existent bucket may result in an error from the API. Verify the bucket exists before deletion.
  • Permission errors: Insufficient permissions on the API key can cause failures. Confirm the API key has rights to delete buckets.
  • API connectivity issues: Network problems or incorrect credentials can prevent communication with Cloudflare R2.

To resolve errors:

  • Double-check the bucket name spelling and format.
  • Verify API credentials and permissions.
  • Check network connectivity and Cloudflare service status.

Links and References

Discussion