Mattering Automations Cloudflare R2 integration
Connect Cloudflare R2 to Mattering Automations: buckets, objects, presigned URLs, CORS, lifecycle and bucket lock rules, custom domains, event notification rules, Sippy and storage metrics as workflow steps, with one credential that carries both the management API token and the R2 access key pair.
The Mattering Automations Cloudflare R2 integration puts R2 object storage on your automation canvas: create and configure buckets, list and read and write the objects inside them, mint presigned URLs that expire, set CORS policies, lifecycle rules and bucket lock rules, attach custom domains, manage event notification rules, run Sippy incremental migration, and read account storage metrics. It is 38 nodes, 17 that read and 21 that act.
The setup is longer than most integrations for a reason worth knowing before you start. R2 is one product with two HTTP APIs that do not share credentials: a management API authenticated with a scoped Cloudflare API token, and an S3 compatible API authenticated with an R2 access key pair and signed with AWS Signature Version 4. Rather than ship two connectors and make every real workflow keep two connections in sync, this integration stores one credential carrying four values, and each node declares which plane it uses. The practical consequence is that you gather credentials from two places in the Cloudflare dashboard once, and after that the difference is invisible on the canvas.
The safety modeling is stated on the nodes rather than buried. Seven nodes carry a destructive flag, and object deletes are the ones to respect most: R2 keeps no previous object versions and has no recycle bin, so a deleted object is gone, and because S3 delete is idempotent by design and R2 follows S3 here, a success does not prove the object was ever there. Two nodes that are not flagged deserve the same care. Setting lifecycle rules writes rules that delete objects later on a schedule, so a wrong prefix quietly expires the wrong files, and turning the managed r2.dev domain on makes every object in that bucket readable by anyone who knows the URL. Both say so in their own descriptions, and this guide covers both below.
Before you start
- A Cloudflare account with R2 enabled, which is a step in its own right: Cloudflare's getting started guide has you add an R2 subscription by completing a checkout flow, and the R2 API token screen the steps below depend on is not reachable until that is done. Cloudflare runs the flow through billing checkout, so an account with no billing profile is asked to complete one. After that, either an existing bucket or the intention to create the first one from the integration itself with Cloudflare R2: Create Bucket.
- Your Cloudflare account ID. Cloudflare's documented route is to search the dashboard, or press CMD or CTRL plus K, and choose Copy account ID; the same value also forms part of the S3 API endpoint shown on the R2 page. It is stored on the credential rather than asked for on each node, because the S3 plane builds its hostname from it.
- Permission to create a scoped Cloudflare API token under My Profile, then API Tokens. This is the management half of the credential.
- Permission to create an R2 API token: on the R2 object storage page, under Account Details, select Manage next to API Tokens. This is the S3 half, and it is a different token from the one above.
- A Mattering workspace with access to the Automations app.
- Not required: a separate connection for bucket listing. The Cloudflare integration also ships a few R2 bucket nodes, and the two do not conflict, but nothing here depends on it.
Get your R2 credentials
Four values go into one credential. The account ID and a scoped Cloudflare API token authenticate the 28 management nodes as a bearer header. The account ID again, plus an R2 access key ID and secret access key, sign the 10 S3 nodes with AWS Signature Version 4. Collect them in this order, because the R2 secret access key is the one moment in the process that cannot be repeated.
Connect Cloudflare R2 to Mattering
Verify it works
Start on the management plane. Drop Cloudflare R2: List Buckets onto a canvas and run a test step. It takes no required parameters, it is the node every bucket picker in this integration reads from, and it returns each bucket's name, creation date, location hint, storage class and jurisdiction. If this succeeds, your account ID and API token are good. If it fails, the response carries Cloudflare's structured error envelope naming the problem, which is almost always a token without R2 permissions.
Then prove the S3 plane, because Test Connection did not. Drop Cloudflare R2: List Objects on the canvas, pick one of the buckets that just came back, and run it. A successful run, even one returning zero objects on an empty bucket, means the access key ID and secret access key are correct and the signature is being built against the right account host. A missing field error names which credential value is absent. An HTTP 403 means the request was signed and rejected, which is either the pair itself being wrong or belonging to a different account than the account ID on the credential, or an R2 token whose permissions do not cover the node being run; the troubleshooting section below separates the two. Both nodes in this verify path are read-only, so it is safe to re-run whenever you rotate either half of the credential.
Node reference
38 nodes, generated from the connector itself so this reference always matches what ships.
Read and query nodes 17
Cloudflare R2: Generate Presigned URL
r2_presign_url
Sign a temporary URL for one object. Nothing is called and nothing in R2 changes, which is why this is a safe read. What comes back is not inert: THE URL LETS ANYONE WHO HOLDS IT PERFORM THE CHOSEN METHOD ON THAT OBJECT WITH NO FURTHER AUTHENTICATION until it expires. Expiry is the expires_in field in seconds (1 to 604800, which is 7 days; this node defaults to 3600). Use a presigned PUT to let a browser or worker upload straight to R2, and a presigned GET to share a file from a private bucket without making the bucket public.
Cloudflare R2: Get Bucket
r2_get_bucket
Fetch one R2 bucket's properties: creation date, location hint, default storage class and jurisdiction.
Cloudflare R2: Get Bucket CORS Policy
r2_get_bucket_cors
Read a bucket's CORS rules: allowed methods, origins and headers, exposed headers and the preflight cache duration.
Cloudflare R2: Get Bucket Lock Rules
r2_get_bucket_lock_rules
Read a bucket's lock rules, which block deletion or overwriting of matching objects for an age, until a date, or indefinitely.
Cloudflare R2: Get Custom Domain
r2_get_custom_domain
Read one custom domain's settings: enabled state, minimum TLS version, cipher allowlist, zone, and ownership and SSL status.
Cloudflare R2: Get Event Notification Rules For Queue
r2_get_event_notification_rules
Read the notification rules that send a single queue messages for one bucket, with each rule's id, actions and filters.
Cloudflare R2: Get Lifecycle Rules
r2_get_lifecycle_rules
Read a bucket's object lifecycle rules: which prefixes expire, when incomplete multipart uploads are aborted, and any storage class transitions.
Cloudflare R2: Get Managed Domain
r2_get_managed_domain
Read the bucket's Cloudflare managed r2.dev domain and whether public access through it is switched on. Enabled means anyone with the URL can read the bucket's objects.
Cloudflare R2: Get Object
r2_get_object
Download an object's contents. Text that decodes as UTF-8 is returned as content with encoding utf-8; anything else is base64 in the same field with encoding base64. The body is capped at 256 KB of raw bytes, and truncated plus the real size are always reported, so a clipped read is never mistaken for a whole one. For anything larger, use Cloudflare R2: Generate Presigned URL and hand the URL to a worker that can stream it.
Cloudflare R2: Get Sippy Configuration
r2_get_sippy
Read a bucket's Sippy configuration: whether incremental migration is on, and which source bucket misses are copied from. Secrets are not echoed, only the access key id.
Cloudflare R2: Get Storage Metrics
r2_get_storage_metrics
Object counts and stored bytes across every R2 bucket in the account, split by storage class and by published versus uploaded state. This is a current snapshot with no date range, and Cloudflare notes it may lag the latest writes.
Cloudflare R2: Head Object
r2_head_object
Fetch an object's metadata without downloading it: size, content type, ETag, last modified time and any custom metadata. The cheap way to check whether a key exists, since a missing key comes back as HTTP 404 with no body.
Cloudflare R2: List Buckets
r2_list_buckets
List the account's R2 buckets with creation date, location hint, storage class and jurisdiction. This is the node every bucket picker in this connector reads from, and the cheapest call for checking that the API token half of the credential works.
Cloudflare R2: List Custom Domains
r2_list_custom_domains
List the custom domains attached to a bucket, with whether each is enabled and its ownership and SSL certificate status. This node populates the domain picker on the other custom domain nodes.
Cloudflare R2: List Event Notification Rules
r2_list_event_notification_rules
List every event notification rule on a bucket, grouped by the queue that receives them, with each rule's actions, prefix and suffix filters. Use it to find the queueId the other notification nodes need.
Cloudflare R2: List Multipart Uploads
r2_list_multipart_uploads
List multipart uploads that were started and never completed. Their parts still occupy the bucket, so this is the node that finds the cleanup work; abort them with Cloudflare R2: Abort Multipart Upload, or expire them automatically with a lifecycle abortMultipartUploadsTransition rule.
Cloudflare R2: List Objects
r2_list_objects
List objects in a bucket with key, size, last modified time, ETag and storage class. Calls the S3 ListObjectsV2 operation and returns ONE page: set max_keys (up to 1000), narrow with prefix, and follow next_continuation_token for more. Use delimiter to fold keys into folder style groups, which come back as common_prefixes.
Action nodes 21
Cloudflare R2: Abort Multipart Upload
r2_abort_multipart_upload
DESTRUCTIVE: abort an in progress multipart upload and discard every part already sent. The upload cannot be resumed afterwards; whoever was uploading has to start again. Safe and useful against uploads that Cloudflare R2: List Multipart Uploads shows as stale.
Cloudflare R2: Add Custom Domain
r2_add_custom_domain
Attach a custom domain to a bucket so its objects are served from a hostname you control. The domain must be on a zone in the same Cloudflare account. Setting enabled to true makes the bucket's objects PUBLICLY readable at that hostname. Reversible with Cloudflare R2: Remove Custom Domain.
Cloudflare R2: Copy Object
r2_copy_object
Copy an object inside R2 without moving bytes through this automation. Source and destination may be different buckets in the same account and jurisdiction. The source is left alone, so a move is this node followed by Cloudflare R2: Delete Object. Copying onto an existing destination key replaces it.
Cloudflare R2: Create Bucket
r2_create_bucket
Create an R2 bucket. Reversible with Cloudflare R2: Delete Bucket while the bucket is still empty. Bucket names are account wide, so a create fails if the name is taken.
Cloudflare R2: Create Event Notification Rule
r2_create_event_notification_rule
Create notification rules that push a message to a Cloudflare Queue when matching objects change. The queue must already exist. A bucket allows up to 100 rules, and Cloudflare rejects rules that overlap so one event cannot fire twice. Reversible with Cloudflare R2: Delete Event Notification Rules.
Cloudflare R2: Create Temporary Access Credentials
r2_create_temp_access_credentials
Mint a short lived S3 access key, secret and session token scoped to one bucket, and optionally to named objects or prefixes. Hand these to a service that should reach only that slice of R2. THE RETURNED SECRET AND SESSION TOKEN GRANT REAL ACCESS for ttlSeconds and cannot be revoked early, so keep the ttl short and do not log the output. Nothing is created that needs cleaning up: the credentials expire on their own.
Cloudflare R2: Delete Bucket
r2_delete_bucket
DESTRUCTIVE: delete an R2 bucket. The bucket must already be empty. Its configuration (CORS, lifecycle, domains, notification rules) and its name reservation are gone and cannot be restored.
Cloudflare R2: Delete Bucket CORS Policy
r2_delete_bucket_cors
DESTRUCTIVE: remove a bucket's whole CORS policy. Browser requests from other origins start failing immediately, and the previous rules are not recoverable from R2. Capture them with Cloudflare R2: Get Bucket CORS Policy first if you may want them back.
Cloudflare R2: Delete Event Notification Rules
r2_delete_event_notification_rules
DESTRUCTIVE: remove the bucket's notification rules for one queue. Downstream workflows stop receiving messages immediately and the rule definitions are gone; capture them with Cloudflare R2: Get Event Notification Rules For Queue first if you may need to restore them.
Cloudflare R2: Delete Object
r2_delete_object
DESTRUCTIVE: permanently delete one object. R2 keeps no previous versions and there is no recycle bin, so the bytes are gone. Note that S3 delete is idempotent: deleting a key that does not exist still returns success, so a success here is not proof the object was there.
Cloudflare R2: Delete Objects In Bulk
r2_delete_objects
DESTRUCTIVE: permanently delete up to 1000 objects in one call. R2 keeps no previous versions, so every key listed is gone for good. The response reports each key under deleted or errors, and a partial failure still deletes the rest, so read both lists rather than only the status code.
Cloudflare R2: Disable Sippy
r2_disable_sippy
Turn Sippy off for a bucket. No objects are deleted: reads simply stop falling back to the source bucket, so anything not yet copied starts returning not found. Reversible with Cloudflare R2: Enable Sippy, which needs the source credentials again.
Cloudflare R2: Enable Sippy
r2_enable_sippy
Enable Sippy on a bucket: a read that misses in R2 is fetched from the source bucket and copied into R2 in the background. Both objects carry live cloud credentials, so treat this node's config as secret material. Reversible with Cloudflare R2: Disable Sippy, though objects already copied stay.
Cloudflare R2: Put Object
r2_put_object
Upload an object. Give it content_url and the runner downloads that URL and stores the bytes, which is the right shape for real files; give it content for small inline text such as a JSON blob or a rendered report. One or the other, never both. Writing to a key that already exists REPLACES that object, and R2 keeps no previous version, so treat an overwrite as a delete plus a create.
Cloudflare R2: Remove Custom Domain
r2_remove_custom_domain
DESTRUCTIVE: detach a custom domain from a bucket. Every URL on that hostname stops resolving to the bucket immediately, and its TLS settings are discarded. Re-attaching means waiting for certificate issuance again.
Cloudflare R2: Set Bucket CORS Policy
r2_put_bucket_cors
REPLACE a bucket's CORS rules with the supplied list. This is a whole policy write, not a merge: rules you leave out are removed. Read the current policy first with Cloudflare R2: Get Bucket CORS Policy and write the edited list back.
Cloudflare R2: Set Bucket Lock Rules
r2_put_bucket_lock_rules
REPLACE a bucket's lock rules with the supplied list. Rules you leave out are removed. Note what a lock rule DOES: while it applies, matching objects cannot be deleted or overwritten, including by you, so an Indefinite condition is a decision to keep those objects.
Cloudflare R2: Set Lifecycle Rules
r2_put_lifecycle_rules
REPLACE a bucket's lifecycle rules with the supplied list. Rules you leave out are removed, so read the current set first. The rules themselves delete objects on a schedule, so check the prefix and age before writing: a wrong prefix here expires the wrong objects later, quietly.
Cloudflare R2: Update Bucket Storage Class
r2_update_bucket
Change a bucket's DEFAULT storage class, which applies to objects uploaded after the change. Existing objects keep the class they were written with; move those with a lifecycle storage class transition instead. Reversible by setting the previous class back.
Cloudflare R2: Update Custom Domain
r2_update_custom_domain
Update an attached custom domain: turn public access on or off, raise the minimum TLS version, or set a cipher allowlist. Only the fields you fill in are sent. Setting enabled to false stops serving the bucket at that hostname without detaching the domain.
Cloudflare R2: Update Managed Domain
r2_update_managed_domain
Turn the bucket's managed r2.dev domain on or off. Turning it ON makes every object in the bucket readable by anyone who knows the URL, with no authentication. Reversible by setting enabled back to false.
Using the integration
On the automation canvas
R2 nodes chain with every other node. A workflow that renders a report can store it with Cloudflare R2: Put Object and hand the link to a task in Mattering Productivity, a nightly sweep can read Cloudflare R2: Get Storage Metrics into a Mattering database and open a task when a bucket grows unexpectedly, and an intake workflow can copy an incoming file between buckets with Cloudflare R2: Copy Object without the bytes ever passing through the automation. The two values downstream nodes ask for most are a bucket name, which Cloudflare R2: List Buckets supplies to the pickers, and an object key, which Cloudflare R2: List Objects supplies.
From AI assistants over MCP
Every node speaks MCP, the open protocol for connecting AI assistants to tools, so Claude, ChatGPT, and Matter can drive the same surface. The natural agent surface here is the read side: Cloudflare R2: List Objects to find things by prefix, Cloudflare R2: Head Object to check a key's size and type without downloading it, Cloudflare R2: Get Object for small files, and Cloudflare R2: Generate Presigned URL to share a large one. Keep the seven destructive nodes behind conditions or approval steps, and treat presigned PUT and DELETE links as writes even though the node that mints them is a read.
Reading and writing objects
Cloudflare R2: List Objects calls ListObjectsV2 and returns one page, so set max_keys up to 1000, narrow with prefix, and follow next_continuation_token for more; delimiter folds keys into folder style groups that come back as common_prefixes. Cloudflare R2: Get Object caps the body at 256 KB of raw bytes and always reports truncated plus the true size, returning text that decodes as UTF-8 in content with encoding utf-8 and anything else base64 in the same field. Cloudflare R2: Put Object prefers content_url, which the runner downloads server side (capped at 100 MB) so a real file never has to be pasted into a canvas field; inline content is for small text. Writing to an existing key replaces that object and R2 keeps no previous version, so treat an overwrite as a delete plus a create.
Presigned URLs are a credential, not a link
Cloudflare R2: Generate Presigned URL signs a string locally: it calls nothing and changes nothing, which is why it is classed as a safe read. What it returns is not inert. The URL lets whoever holds it perform the chosen method on that exact object with no further authentication until it expires, and it cannot be revoked early. Expiry is the expires_in field in seconds, from 1 to 604800 (7 days), defaulting to 3600. R2 supports GET, HEAD, PUT and DELETE this way; presigned POST form uploads are not supported. The two patterns worth building deliberately: a presigned GET to share a file from a private bucket without switching on public access, and a presigned PUT to let a browser or worker upload straight to R2 instead of pushing the bytes through an automation.
Bucket settings are whole policy writes
Three nodes replace rather than merge, and each one says so on itself. Cloudflare R2: Set Bucket CORS Policy, Cloudflare R2: Set Lifecycle Rules and Cloudflare R2: Set Bucket Lock Rules all write the supplied list as the complete rule set, so anything you leave out is removed. The habit that avoids surprises is read first: run Cloudflare R2: Get Bucket CORS Policy, Cloudflare R2: Get Lifecycle Rules or Cloudflare R2: Get Bucket Lock Rules, edit the list, and write the whole thing back. Lifecycle rules deserve one extra look before saving, because they delete objects later on a schedule rather than now: a wrong prefix expires the wrong files at 3am with no run to inspect. Lock rules point the other way, blocking deletion or overwriting of matching objects, including by you, for as long as the rule applies.
Public access, on purpose
R2 buckets are private by default and there are two ways to open one. Cloudflare R2: Add Custom Domain attaches a hostname you control, on a zone in the same Cloudflare account, and Cloudflare R2: Update Custom Domain turns serving on or off, raises the minimum TLS version, or sets a cipher allowlist. Cloudflare R2: Update Managed Domain toggles Cloudflare's managed r2.dev hostname instead, and this is the one that catches people: setting enabled to true makes every object in the bucket readable by anyone who knows the URL, with no authentication at all. Read the current state with Cloudflare R2: Get Managed Domain before changing it, and prefer a presigned GET when the requirement is really just sharing one file. The zone ID that Cloudflare R2: Add Custom Domain asks for is not listed by this integration; if you also run the Cloudflare integration, its zone lister has it.
Jurisdictions and event notifications
R2 buckets can live in a jurisdiction, default, eu or fedramp, and every node in both planes carries the same optional jurisdiction field. The management plane sends it as a header and the S3 plane resolves it to a different hostname, and the integration applies whichever that node needs. This matters because a jurisdictional bucket is only reachable through its own jurisdiction: leave the field blank against an EU bucket and you get a not found rather than a silently wrong answer. Event notifications are the other cross product surface. Cloudflare R2: Create Event Notification Rule pushes a message to a Cloudflare Queue when matching objects change, the queue must already exist, a bucket allows up to 100 rules, and Cloudflare rejects overlapping rules so one event cannot fire twice. Cloudflare Queues is a separate product with its own API, so this integration does not list queue IDs; copy one from the Cloudflare dashboard, or from the output of Cloudflare R2: List Event Notification Rules.
What stays off the canvas
The omissions are deliberate and each has a reason. The create, upload part and complete half of multipart uploads is not authored: it is a stateful three step sequence carrying part ETags between runs, and a half finished sequence leaves incomplete uploads behind. What is built is the cleanup half a workflow actually needs, Cloudflare R2: List Multipart Uploads and Cloudflare R2: Abort Multipart Upload, with large files going through a presigned PUT or a lifecycle abortMultipartUploadsTransition rule instead. Super Slurper bulk migration has its own API surface and job lifecycle and is deferred, while Sippy is included because it is a single bucket setting. The S3 operations that read bucket settings are omitted as redundant, since the management plane exposes the same information as readable JSON. And object versioning, object tagging, ACLs and SSE with KMS are not part of R2's S3 implementation, so no node reaches for them.
Troubleshooting
Test Connection passes but every object node fails
S3 nodes return HTTP 403 or a signature error
Management nodes return a Cloudflare error envelope with 400 or 401
A bucket that exists in the dashboard comes back as not found
A delete reported success but nothing was deleted
Get Object output looks like gibberish or is cut short
A presigned URL returns 403 when someone uses it
Setting CORS or lifecycle rules removed rules I did not touch
Related
The Cloudflare R2 MCP
What connecting Cloudflare R2 unlocks for AI agents and automations, with common uses and FAQs.
More guides
All Automations documentation
Every integration guide, plus how connectors, credentials, and workflows fit together.
Cloudflare R2 is a trademark of its respective owner. Mattering uses platform names to identify the services these integrations connect to; no endorsement or affiliation is implied.