Cloudflare R2 icon

Cloudflare R2

Store and retrieve objects from Cloudflare R2

Overview

This node integrates with Cloudflare R2, a scalable object storage service compatible with the S3 API. Specifically, the "Bucket - Create" operation allows users to create a new R2 bucket with a globally unique name. This is useful for organizing and isolating data storage within Cloudflare's R2 environment.

Common scenarios include:

  • Automating the creation of buckets for new projects or clients.
  • Dynamically provisioning storage spaces in workflows that manage cloud resources.
  • Setting up buckets with optional location hints to optimize data locality.

Example use case:

  • A workflow that provisions a new R2 bucket named "my-new-bucket" in the Western North America region by specifying the location hint "wnam".

Properties

Name Meaning
Bucket Name The globally unique name of the R2 bucket to create.
Additional Options Optional settings for bucket creation:
- Location Hint A string hint indicating the desired geographic location of the bucket (e.g., "wnam").

Output

The output JSON contains an object with:

  • success: Boolean indicating if the bucket was created successfully.
  • bucket: The name of the created bucket.

Example output:

{
  "success": true,
  "bucket": "my-new-bucket"
}

No binary data is output by this operation.

Dependencies

  • Requires valid Cloudflare API credentials configured with "R2 S3-Compatible" authentication mode.
  • Needs the R2 Access Key ID, Secret Access Key, and Account ID.
  • The node uses AWS SDK v3 S3 client internally configured to communicate with Cloudflare R2 endpoints.
  • No additional environment variables are required beyond the Cloudflare API credentials setup.

Troubleshooting

  • Error: "R2 credentials are missing or invalid."
    Ensure that the Cloudflare API credentials are correctly set with the R2 S3-compatible keys and account ID. Verify that the authentication mode is set to "R2 S3-Compatible".

  • Bucket name conflicts:
    Bucket names must be globally unique across all R2 buckets. If a bucket name already exists, creation will fail. Choose a unique bucket name.

  • Location hint usage:
    The location hint is optional and only serves as a suggestion. If invalid or unsupported, the bucket may be created in a default location.

  • Network or permission errors:
    Check network connectivity and ensure the API token has sufficient permissions to create buckets.

Links and References


This summary is based on static analysis of the provided source code and property definitions for the "Bucket - Create" operation of the Cloudflare R2 node.

Discussion