Overview
This node integrates with Cloudflare R2, a cloud object storage service compatible with the S3 API. It allows users to perform common storage operations such as uploading files, downloading files, deleting files, and listing files within a specified bucket.
Typical use cases include:
- Uploading data or files from workflows to Cloudflare R2 for backup or sharing.
- Downloading stored files from R2 to process or forward in subsequent workflow steps.
- Managing stored objects by deleting unnecessary files.
- Retrieving lists of files in a bucket to dynamically handle storage contents.
For example, you could automate backing up JSON data generated in your workflow by uploading it to a specific bucket, or download configuration files stored in R2 to configure other systems.
Properties
Name | Meaning |
---|---|
Bucket 名称 | The name of the Cloudflare R2 bucket where the operation will be performed. |
文件名 | The key (filename) of the file in the bucket to upload, download, or delete. |
Output
The node outputs an array of JSON objects, each corresponding to one input item processed. The structure varies by operation:
upload:
{ "success": true, "operation": "upload", "bucket": "<bucket name>", "key": "<file key>" }
Indicates successful upload of the file or data.
download:
{ "success": true, "operation": "download", "bucket": "<bucket name>", "key": "<file key>", "data": "<file content as UTF-8 string>" }
Contains the downloaded file content as a UTF-8 string in the
data
field.delete:
{ "success": true, "operation": "delete", "bucket": "<bucket name>", "key": "<file key>" }
Confirms successful deletion of the specified file.
list:
{ "success": true, "operation": "list", "bucket": "<bucket name>", "files": [ /* array of file metadata objects */ ] }
Returns an array of files (
files
) present in the specified bucket.
The node does not output binary data directly; downloaded file contents are returned as UTF-8 strings.
Dependencies
- Requires valid credentials for Cloudflare R2, including an account ID, access key ID, and secret access key.
- Uses AWS SDK for JavaScript v3 S3 client configured to connect to the Cloudflare R2 endpoint.
- The node expects these credentials to be configured in n8n under a generic API authentication credential type.
Troubleshooting
- Download failure with empty content: If the downloaded file's content is empty, the node throws an error indicating the file body is empty. This may happen if the file does not exist or is empty in the bucket.
- Authentication errors: Ensure that the provided API credentials are correct and have sufficient permissions for the requested operations.
- Bucket or key not found: Verify that the bucket name and file key are correctly specified and exist in the Cloudflare R2 storage.
- Network or endpoint issues: Confirm network connectivity and that the endpoint URL matches the Cloudflare R2 region/account setup.