# Cloudflare R2 Integrations

Manage buckets and objects, create signed links, and start workflows from R2 object events.

## Setup notes

- **Connect Cloudflare R2** Enter your account ID and an API token that can list buckets. Grant the permissions required for each management action.
- **Connect S3-compatible storage** For S3 actions and signed links, enter an R2 access key ID and secret access key. Select the jurisdiction of your bucket.
- **Receive object events** Send bucket notifications to a dedicated Cloudflare Queue. Forward each message body to the FastHook callback with the shared secret in the x-r2-notification-secret header.

## Workflow templates

- [Archive newly issued origin certificates in R2](https://www.fasthook.io/templates/origin-ca-issued-certificates-to-r2.md): Sign a CSR for a configured origin hostname and save the signed PEM in R2 under its serial number.
- [Archive published WordPress articles in R2](https://www.fasthook.io/templates/wordpress-published-snapshots-to-r2.md): Capture the published WordPress permalink and save its rendered Markdown and desktop screenshot together in an R2 bucket.
- [Archive DNS records to R2 on a schedule](https://www.fasthook.io/templates/cloudflare-dns-zone-exports-to-r2.md): Save a dated BIND zone file in a private R2 bucket.
- [Announce a new R2 release file in Slack](https://www.fasthook.io/templates/cloudflare-r2-release-pointer-to-kv-and-slack.md): Record the object key from an R2 upload in KV and let your release channel know which file arrived.
- [Back up a group of KV keys to R2](https://www.fasthook.io/templates/cloudflare-kv-prefix-backups-to-r2.md): Export a selected prefix with binary values, metadata and absolute expiry times.
- [Archive a daily D1 SQL export in R2](https://www.fasthook.io/templates/cloudflare-d1-backups-to-r2.md): Export database schema and data as SQL and save a dated copy in the selected R2 bucket.
- [Archive queue messages in R2](https://www.fasthook.io/templates/cloudflare-queues-archive-to-r2.md): Save each message body as a JSON file in the chosen R2 bucket, with a distinct object key for each queue and message.
- [Import R2 videos into Cloudflare Stream](https://www.fasthook.io/templates/cloudflare-r2-videos-to-stream.md): When a video arrives in a selected R2 bucket, create a temporary download URL and submit it to Stream for encoding.
- [Review new R2 uploads in Trello](https://www.fasthook.io/templates/cloudflare-r2-uploads-to-trello.md): Create a review card with a one-hour signed download link.
- [Report R2 bucket storage to Discord](https://www.fasthook.io/templates/cloudflare-r2-storage-report-to-discord.md): Post a daily report of object counts and bytes in one selected R2 bucket, grouped by storage class.
- [Archive an R2 object in Dropbox](https://www.fasthook.io/templates/cloudflare-r2-object-to-dropbox.md): Send a bucket, object key and Dropbox path to copy the original bytes.
- [Archive completed multipart uploads in Dropbox](https://www.fasthook.io/templates/cloudflare-r2-multipart-to-dropbox.md): When an R2 multipart upload finishes, archive the assembled file in Dropbox within the FastHook file transfer limit.
- [Notify Slack when an R2 object is deleted](https://www.fasthook.io/templates/cloudflare-r2-deletions-to-slack.md): Send the bucket, object key and deletion time to your operations channel.
- [Log R2 copies in Google Sheets](https://www.fasthook.io/templates/cloudflare-r2-copies-to-google-sheets.md): Record the destination bucket, new object key and original key for each R2 copy.

## Triggers

5 Instant

- **A lifecycle rule deleted an object** (Instant) — Start a workflow when R2 automatically removes an object under a lifecycle rule. Use the bucket and key to record which file expired.
- **A multipart upload finished** (Instant) — Start a workflow when R2 assembles the uploaded parts into a complete object. Use its bucket and key to process the finished file.
- **An object was copied** (Instant) — Start a workflow when R2 creates a copy in the selected bucket. Use the new object’s key to track or process the copy.
- **An object was deleted** (Instant) — Start a workflow when an explicit delete operation removes an object from the selected bucket. Use its key to update a file index or notify its owner.
- **An object was uploaded or replaced** (Instant) — Start a workflow when a file is written to the selected bucket in a single upload. Use the object key to find the new or updated file.

## Actions

- **Analyze bucket operations** — Group sampled R2 requests to compare storage operations over a selected period.
- **Analyze Iceberg catalog requests** — Group sampled requests to the R2 Data Catalog’s Iceberg interface to understand how tables are being accessed.
- **Analyze R2 SQL activity** — Group sampled query requests to see when and how R2 SQL is being used.
- **Analyze storage usage over time** — Group sampled storage measurements to see how the amount of data in R2 changes over time.
- **Analyze table maintenance activity** — Compare sampled measurements for maintenance work such as compacting tables and expiring snapshots.
- **Attach a domain using the legacy endpoint** — Register a hostname through the older R2 interface. Its existing access setting determines whether it can serve files.
- **Browse objects in a bucket** — List stored files and their metadata. Use a key prefix to narrow the results to a folder or group of objects.
- **Browse storage buckets** — Find buckets in the selected account and jurisdiction and page through the results.
- **Cancel a multipart upload** — Discard uploaded parts and end an unfinished upload through the S3-compatible interface.
- **Change local upload settings** — Choose whether R2 initially writes object data near the uploading client.
- **Change public access through r2.dev** — Enable or disable public access through the bucket’s managed development domain.
- **Change the default storage class** — Choose the storage class R2 should use for future uploads to this bucket.
- **Check a background job’s progress** — Look up a bucket job by ID to see its current status and progress.
- **Check a connected domain** — Look up the configuration and status of a custom hostname attached to the bucket.
- **Check access to a bucket** — Send a metadata-only request to find out whether the bucket is reachable with the selected credentials.
- **Check account-wide R2 usage** — Read storage metrics across the account’s buckets for a high-level usage report.
- **Check bucket encryption settings** — Read the bucket’s server-side encryption configuration through the S3-compatible interface.
- **Check local upload settings** — See whether R2 accepts writes near the uploading client for this bucket.
- **Check on-demand migration settings** — Inspect the Sippy configuration that tells R2 where to fetch objects missing from the bucket.
- **Check public access through r2.dev** — See whether the bucket is publicly reachable through Cloudflare’s managed development domain.
- **Configure on-demand migration** — Connect a source storage provider so Sippy can fetch missing objects into R2 when requested.
- **Connect a custom domain to a bucket** — Attach your own hostname so people can reach bucket content through that domain.
- **Copy a stored object** — Use the S3-compatible interface to copy an object to a new key or another accessible bucket.
- **Copy stored data into an upload part** — Use all or part of an existing object as a numbered part of a multipart upload.
- **Count objects and bytes in one bucket** — Scan the selected bucket and total its objects and bytes by storage class.
- **Create a bucket by its path name** — Create a bucket using the name in the request path and optionally choose its storage class.
- **Create a bucket through S3** — Create a new R2 bucket using S3-compatible credentials.
- **Create a storage bucket** — Choose a bucket name, jurisdiction and default storage class for newly uploaded objects.
- **Create a temporary deletion link** — Give the holder a time-limited URL that authorizes deletion of one specific object.
- **Create a temporary download link** — Share a private object with another app or person through a download URL that expires.
- **Create a temporary metadata link** — Give another app a time-limited URL to inspect an object’s headers without downloading its contents.
- **Create a temporary upload link** — Allow the holder to upload a file to one specific object key before the link expires.
- **Delete a batch of objects** — Remove a specified set of object keys from the same bucket in one request.
- **Delete an empty bucket** — Remove the bucket and its settings after clearing its objects, unfinished multipart uploads and notification rules.
- **Delete an empty bucket through S3** — Remove an empty R2 bucket using the S3-compatible interface.
- **Delete an object by key** — Remove one stored file using its bucket and full object key.
- **Delete multiple objects through S3** — Submit a list of object keys to remove together through the S3-compatible interface.
- **Delete one object through S3** — Use its bucket and key to remove one stored object through the S3-compatible interface.
- **Detach a domain using the legacy endpoint** — Remove the hostname association through the older interface, which retains the domain’s previous access setting.
- **Disconnect a custom domain** — Remove a hostname and its configuration from this bucket while keeping other configured routes available.
- **Download a file through S3** — Retrieve an object’s contents using S3-compatible credentials and its key.
- **Download an object by key** — Retrieve the contents of a stored file using its bucket and object key.
- **Edit a bucket’s custom domain** — Change how a selected hostname serves content from the bucket.
- **Estimate data transferred from R2** — Compare sampled transfer volumes. Transfers smaller than 100 KiB are excluded from this dataset.
- **Explore R2 analytics columns** — Look up the fields and data types available for SQL queries against a selected R2 dataset.
- **Find unfinished multipart uploads** — List uploads that have started in the bucket and still have parts to complete or discard.
- **Finish a multipart upload** — Submit the ordered list of uploaded parts so R2 can assemble the complete object.
- **Get bucket details** — Look up the selected bucket’s configuration, including its location and storage class.
- **Inspect an object’s metadata** — Read headers such as the file size and content type without downloading the object itself.
- **Issue temporary bucket credentials** — Grant time-limited access to a bucket and optionally restrict it to selected objects or key prefixes.
- **List a bucket’s custom domains** — See the hostnames registered to the bucket and whether each one is enabled.
- **List accessible buckets through S3** — Find the R2 buckets visible to the selected S3-compatible credentials.
- **List background jobs for a bucket** — Review bulk operations such as prefix deletions and storage class migrations.
- **List bucket notification destinations** — Inspect the queues and rules configured to receive object events from the bucket.
- **List domain names using the legacy endpoint** — Retrieve registered hostnames in the older response format, which omits their enabled status.
- **List objects with S3 continuation tokens** — Browse object keys using the newer listing format and its token for the next page.
- **List objects with S3 marker pagination** — Browse object keys using the original S3 listing format and its marker for the next page.
- **List parts of a multipart upload** — See which numbered parts R2 has received for an upload before resuming or completing it.
- **Look up a bucket’s location** — Read the location reported for an R2 bucket through the S3-compatible interface.
- **Query Iceberg catalog activity with SQL** — Use SQL to filter and summarize data operations recorded by R2 Data Catalog.
- **Query R2 object operations with SQL** — Filter and group recorded storage operations to investigate how applications use R2.
- **Query SQL request activity** — Analyze the requests made to R2 SQL over the period you select.
- **Query table maintenance with SQL** — Use SQL to investigate maintenance jobs recorded for R2 Data Catalog tables.
- **Read browser access rules through S3** — Retrieve the bucket’s cross-origin access policy in the S3-compatible format.
- **Read lifecycle rules through S3** — Retrieve the selected bucket’s lifecycle configuration in the S3-compatible format.
- **Remove browser access rules** — Delete the bucket’s cross-origin rules that allow web pages on other origins to request its content.
- **Remove browser access rules through S3** — Use the S3-compatible interface to delete the bucket’s cross-origin access policy.
- **Remove bucket notification rules** — Remove configured rules for sending bucket events to a selected Cloudflare Queue.
- **Remove bucket retention rules** — Delete the bucket’s lock rules that protect matching objects from being overwritten or removed.
- **Set browser access rules** — Replace the list of origins, methods and headers allowed to make cross-origin requests to this bucket.
- **Set browser access rules through S3** — Replace the bucket’s cross-origin access policy using the S3-compatible format.
- **Set lifecycle rules through S3** — Apply lifecycle rules to the bucket using the S3-compatible configuration format.
- **Set object lifecycle rules** — Define when matching objects expire or change storage class and when unfinished uploads are discarded.
- **Set object retention rules** — Protect matching objects from deletion or replacement for the period specified by each rule.
- **Set up bucket event notifications** — Choose which object events to send to a Cloudflare Queue and optionally filter by object key.
- **Start a background bucket job** — Submit a bulk task such as deleting objects with a shared prefix or moving objects to another storage class.
- **Start a multipart upload** — Reserve an upload ID so a large file can be sent in separate parts.
- **Stop on-demand migration** — Turn off Sippy so missing objects are no longer fetched from the source. Objects already copied stay in R2.
- **Upload a file through S3** — Write file contents and optional metadata to a chosen bucket and key through the S3-compatible interface.
- **Upload a file to a bucket** — Store file contents at the selected object key, replacing an existing object at that key.
- **Upload one part of a large file** — Send a numbered chunk for an existing multipart upload and keep its receipt for assembly.
- **View browser access rules** — See which origins, methods and headers the bucket permits for cross-origin browser requests.
- **View object lifecycle rules** — See when R2 expires objects, changes their storage class or aborts unfinished uploads.
- **View object retention rules** — Inspect the rules that protect objects in the bucket and the retention periods they specify.
- **View rules for one queue** — See which bucket events and object key filters route notifications to the selected queue.
