Overview
This node integrates with Cloudflare R2, a cloud object storage service compatible with the S3 API. It allows users to perform common file 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 generated in workflows to Cloudflare R2 for persistent storage.
- Downloading files from R2 to process or analyze them further in n8n.
- Managing stored files by deleting obsolete or unwanted objects.
- Retrieving lists of files in a bucket to dynamically handle or display available content.
For example, you could upload JSON data or binary files from previous workflow steps into a specific bucket, then later download those files for processing or sharing.
Properties
Name | Meaning |
---|---|
Bucket 名称 (bucket) | The name of the Cloudflare R2 bucket where the operation will be performed. |
文件名 (key) | The key (filename) identifying the object in the bucket. Required for upload, download, delete. |
二进制数据 (binaryData) | Boolean flag indicating whether the data to upload is binary. Only shown for upload operation. |
二进制属性 (binaryPropertyName) | The name of the binary property containing the data to upload. Required if binaryData is true. Defaults to "data". |
Output
The node outputs an array of JSON objects corresponding to each input item processed. Each output JSON contains:
success
: Boolean indicating if the operation succeeded.operation
: The operation performed (upload
,download
,delete
, orlist
).bucket
: The bucket name used.key
: The object key (filename) involved (for all except list).- Additional fields depending on operation:
- For upload and delete: just success confirmation.
- For download: includes a
data
field containing the downloaded file content as a UTF-8 string. - For list: includes a
files
field which is an array of objects representing the files in the bucket.
If uploading binary data, the node reads the specified binary property and uploads its raw content. Downloaded data is returned as a UTF-8 string in the JSON output.
Dependencies
- Requires valid Cloudflare R2 credentials including an account ID, access key ID, and secret access key.
- Uses AWS SDK's 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
Error: "下载失败:文件内容为空" (Download failed: file content is empty)
This occurs if the requested file does not exist or is empty in the bucket. Verify the bucket and key names are correct and that the file exists.Authentication errors
Ensure the provided API credentials have sufficient permissions and are correctly configured.Upload issues with binary data
If binary upload fails, confirm the binary property name matches the actual binary data property in the input and that the data is properly encoded.General AWS SDK errors
These may indicate network issues, incorrect bucket names, or permission problems. Check the error message details and verify configuration.