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.
Actions15
- Bucket Actions
- Object Actions
- Batch Operations Actions
Overview
The node provides integration with Cloudflare R2 object storage, focusing on managing buckets and objects within those buckets. Specifically, the Bucket - Create operation allows users to create a new R2 bucket with a unique name and an optional location hint for optimal performance.
This operation is useful when setting up new storage containers in Cloudflare R2 to organize and isolate data. For example, you might create separate buckets for different projects, environments (development, staging, production), or data types (images, logs, backups).
Practical examples:
- Creating a bucket named "my-r2-bucket" in the Europe region to store user-uploaded images.
- Creating a bucket with automatic location selection to let Cloudflare optimize latency.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The unique name of the R2 bucket to create. Must be globally unique across all Cloudflare R2. |
| Location Hint | Optional location hint to optimize bucket placement. Options: |
| - Automatic (let Cloudflare choose) | |
| - Eastern North America (ENAM) | |
| - Western North America (WNAM) | |
| - Europe (EEUR) | |
| - Asia-Pacific (APAC) |
Output
The output JSON contains a single field:
bucket: An object representing the newly created bucket. This typically includes metadata about the bucket such as its name and possibly location details.
Example output structure:
{
"bucket": {
"name": "my-r2-bucket",
"location": "EEUR",
...
}
}
No binary data is output by this operation.
Dependencies
- Requires an API key credential for authenticating with Cloudflare R2.
- Uses internal utility functions to validate bucket names and perform API calls to Cloudflare.
- No additional external dependencies beyond the configured Cloudflare R2 API credentials.
Troubleshooting
- Invalid bucket name format: The node validates the bucket name format before creation. If the name does not meet Cloudflare R2 naming rules, an error will be thrown. Ensure the bucket name is valid and unique.
- API authentication errors: If the API key credential is missing or invalid, the operation will fail. Verify that the correct API key is configured.
- Bucket name already exists: Since bucket names must be unique globally, attempting to create a bucket with an existing name will result in an error from Cloudflare.
- Unknown location value: The location hint must be one of the predefined options or empty for automatic selection.