R2 gives you the freedom to create the multi-cloud architectures you desire with an S3-compatible object storage.
Go to siteThe Cloudflare R2 API lets you interact with Cloudflare's object storage service, providing a cost-effective way to store large amounts of data with no egress fees. On Pipedream, you can harness this API to build automated workflows that can store, retrieve, and manage data within your R2 buckets. By combining Cloudflare R2 with Pipedream’s capabilities, you can create serverless workflows that trigger on various events, process data in-flight, and integrate with over 800+ apps available on the platform.
import { S3 } from "@aws-sdk/client-s3";
import { ListBucketsCommand } from "@aws-sdk/client-s3";
export default defineComponent({
props: {
cloudflare_r2: {
type: "app",
app: "cloudflare_r2",
}
},
async run({ steps, $ }) {
const cloudflare_r2 = {
account_id: this.cloudflare_r2.$auth.account_id
};
const s3Client = new S3({
forcePathStyle: false,
endpoint: `https://${cloudflare_r2.account_id}.r2.cloudflarestorage.com`,
region: "auto",
credentials: {
accessKeyId: this.cloudflare_r2.$auth.access_key_id,
secretAccessKey: this.cloudflare_r2.$auth.access_key_secret
}
});
const data = await s3Client.send(new ListBucketsCommand({}));
return data.Buckets;
}
}
)
Automated Backup to R2: Create a workflow on Pipedream that listens for new files in your Dropbox or Google Drive and automatically backs them up to an R2 bucket for secure and cost-effective long-term storage.
Website Asset Delivery: Build a pipeline that optimizes images or other static assets uploaded to Cloudflare R2 and serves them efficiently to your website, leveraging Pipedream’s ability to process the data and Cloudflare’s global delivery network.
Event-Driven Data Archival: Set up a system where logs or data from your application, received through webhooks or other triggers on Pipedream, are automatically archived to an R2 bucket for compliance, analysis, or backup purposes, potentially integrating with database services like Airtable for metadata management.
Cloudflare R2 uses API keys for authentication. When you connect your Cloudflare R2 account, Pipedream securely stores the keys so you can easily authenticate to Cloudflare R2 APIs in both code and no-code steps.
Navigate to your Cloudflare account and sign in
To retrieve your Account ID:
To retrieve your Access Keys: