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, specifically focusing on managing objects within buckets. The "List" operation under the "Object" resource allows users to retrieve a list of objects stored in a specified R2 bucket. This is useful for scenarios where you need to enumerate files or data stored in a bucket, such as displaying available files, processing multiple objects, or syncing data.
Practical examples include:
- Listing all images stored in a media bucket to generate a gallery.
- Retrieving a subset of files with a specific prefix (e.g., all logs from a certain date).
- Grouping objects by folder-like structures using delimiters.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the R2 bucket to operate on. |
| Options | Collection of optional parameters to filter and control the listing: |
| Prefix | Only list objects whose keys start with this prefix. |
| Max Results | Maximum number of objects to return (1 to 1000). |
| Delimiter | Character used to group keys, typically "/" to simulate folder hierarchy. |
Output
The output JSON contains the following fields:
objects: An array of objects representing the listed items in the bucket. Each object includes metadata about an individual stored file or item.truncated: A boolean indicating whether the result set was truncated due to the maximum results limit.
No binary data is output for this operation.
Example output structure (simplified):
{
"objects": [
{
"key": "folder/file1.txt",
"size": 12345,
"lastModified": "2024-01-01T12:00:00Z",
"...": "other metadata"
},
...
],
"truncated": false
}
Dependencies
- Requires an API key credential for authenticating with Cloudflare R2.
- Uses internal utility functions to communicate with Cloudflare R2 APIs.
- No additional external dependencies beyond standard n8n environment and configured credentials.
Troubleshooting
- Invalid Bucket Name: If the bucket name does not conform to Cloudflare R2 naming rules, the node will throw an error. Ensure the bucket name is valid and exists.
- Permission Errors: Insufficient permissions or invalid API credentials can cause authentication failures. Verify that the API key has access to the specified bucket.
- Empty Results: If no objects match the prefix or if the bucket is empty, the
objectsarray will be empty. - Max Results Limit: Setting
Max Resultsabove 1000 will cause an error; keep it between 1 and 1000. - Delimiter Usage: Incorrect delimiter usage may lead to unexpected grouping of keys; typically use "/" for folder-like grouping.