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 interacts with Cloudflare R2 object storage, specifically managing buckets and their configurations. The "Delete CORS" operation for the "Bucket" resource removes the Cross-Origin Resource Sharing (CORS) configuration from a specified R2 bucket. This is useful when you want to disable or reset CORS settings on a bucket to restrict or stop cross-origin requests.

Practical scenarios include:

  • Removing previously set CORS rules that are no longer needed.
  • Resetting bucket permissions related to web applications accessing resources across different domains.
  • Cleaning up bucket configurations during automation workflows.

Properties

Name Meaning
Bucket Name The unique name of the Cloudflare R2 bucket from which the CORS configuration will be deleted. Must be unique across all Cloudflare R2 buckets.

Output

The output JSON contains:

  • success: A boolean indicating if the deletion was successful (true).
  • message: A string confirming that the CORS configuration was deleted, e.g., "CORS configuration deleted".

Example output JSON:

{
  "success": true,
  "message": "CORS configuration deleted"
}

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for authenticating with Cloudflare R2.
  • Relies on internal utility functions to interact with Cloudflare R2's API for bucket management.
  • The node must be configured with valid Cloudflare R2 credentials in n8n.

Troubleshooting

  • Invalid Bucket Name: If the bucket name format is invalid, the node throws an error. Ensure the bucket name follows Cloudflare R2 naming conventions.
  • Permission Errors: If the API key lacks permission to modify bucket CORS settings, the operation will fail. Verify that the API key has appropriate access rights.
  • Network Issues: Connectivity problems with Cloudflare's API can cause failures. Check network connectivity and retry.
  • Unknown Operation Error: If the operation parameter is incorrect or unsupported, an error will be thrown. Confirm the operation is set to "deleteCORS" for this use case.

Links and References

Discussion