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
This node enables interaction with Cloudflare R2 object storage, focusing on managing objects within buckets. Specifically, the Download operation under the Object resource allows users to download a file stored in a specified R2 bucket by providing the bucket name and the object's key (its path or filename).
Common scenarios for this node include:
- Retrieving files stored in Cloudflare R2 for further processing or analysis.
- Automating workflows that require fetching assets or data files from cloud storage.
- Integrating Cloudflare R2 downloads into larger automation pipelines, such as backing up files or feeding data into other systems.
For example, you might use this node to download an image file from your R2 bucket to process it in subsequent workflow steps or to retrieve JSON configuration files stored remotely.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the R2 bucket to operate on. This identifies which bucket contains the object. |
| Object Key | The key (path/filename) of the object in the bucket to download. For example: folder/file.txt. |
Output
The output JSON contains:
success: A boolean indicating if the download was successful.object: Metadata of the downloaded object, including properties like content type.binary: An object containing the binary data of the downloaded file with these fields:data: The file content encoded as a base64 string.mimeType: The MIME type of the file (e.g.,image/jpeg,application/octet-stream).fileName: The name of the file extracted from the object key.fileSize: The size of the file in bytes as a string.
This structure allows downstream nodes to access both metadata and the actual file content for further processing or saving.
Dependencies
- Requires valid credentials for Cloudflare R2 API authentication (an API key or token configured in n8n).
- Relies on internal utility functions to interact with Cloudflare R2 services.
- No additional external dependencies beyond standard n8n environment and Cloudflare R2 API access.
Troubleshooting
- Invalid Object Key Format: If the object key is malformed, the node will throw an error. Ensure the key matches the expected path/filename format.
- Bucket Not Found or Access Denied: Errors may occur if the specified bucket does not exist or the credentials lack permission. Verify bucket existence and credential permissions.
- File Not Found: If the object key does not exist in the bucket, the download will fail. Double-check the key spelling and path.
- Binary Data Handling: The node outputs the file content as base64-encoded binary data. Downstream nodes must handle this encoding properly.
- Large Files: Downloading very large files may impact performance or memory usage; consider chunking or alternative approaches if needed.