Mattering Automations Cloudflare integration
Connect Cloudflare to Mattering Automations: DNS records with zone-file export and import, cache purge in every mode, zone settings, Workers KV, Worker scripts, R2 bucket management, ruleset audits, Page Rules, and bulk redirect lists as workflow steps, authenticated with one scoped API token.
The Mattering Automations Cloudflare integration adds the Cloudflare API v4 to your automation canvas: list and manage zones and their settings, work DNS records with BIND zone-file export and import, purge the cache by URL, hostname, tag, prefix, or everything, read and write Workers KV from single values to 10,000-pair bulk operations, read deployed Worker scripts and edit their settings, manage R2 buckets, audit rulesets and the WAF read-only, manage Page Rules, and build the redirect lists behind Bulk Redirects.
The credential is a scoped API token created in the Cloudflare dashboard and sent as a Bearer header. Tokens carry permission groups and zone or account scopes you choose at creation, they are available on every Cloudflare plan including Free, and the legacy Global API Key is deliberately not accepted by this integration because it is unscoped and all-powerful. Setup takes a few minutes once the token exists, and this guide walks through each step, including which permission groups each node family needs, and ends with the full node reference.
The safety modeling is stated on the nodes rather than buried. Of the 56 nodes, 30 read and 26 act, and nine carry a destructive flag: Cloudflare: Delete Zone, Cloudflare: Delete DNS Record, Cloudflare: Delete KV Namespace, Cloudflare: Delete KV Value, Cloudflare: Bulk Delete KV Pairs, Cloudflare: Delete Worker Script, Cloudflare: Delete R2 Bucket, Cloudflare: Delete Page Rule, and Cloudflare: Delete List. Some write surfaces are deliberately absent: Worker code uploads stay in Wrangler or CI, ruleset writes are excluded because one bad call can replace a zone's entire WAF phase, and R2 object reads and writes belong to R2's separate S3-compatible API.
Before you start
- A Cloudflare account with at least one zone (domain) added. API tokens are available on every Cloudflare plan, and a Free zone can exercise the DNS, zone settings, cache purge, Page Rules, and list nodes end to end.
- For the Workers KV and Worker script nodes, a Workers setup on the account. Workers KV has a free tier (100,000 reads and 1,000 writes per day, 1 GB of storage), so KV-backed workflows can be built and tested without a paid plan.
- For the R2 bucket nodes, R2 enabled on the account in the Cloudflare dashboard. Enabling R2 means completing Cloudflare's R2 subscription checkout flow; a free tier with 10 GB-month of storage is included once that is done, and the R2 nodes fail with a not-enabled error until it is.
- A Mattering workspace with access to the Automations app.
- Your account ID handy, or plan to fetch it with Cloudflare: List Accounts as the first step: the KV, Worker, R2, and list nodes are account-scoped and every one of them needs it.
Create a scoped Cloudflare API token
Mattering authenticates to Cloudflare with a scoped API token sent as a Bearer header on every request. A token only does what its permission groups allow: one scoped to DNS cannot purge cache or touch Workers KV, which is exactly the point, and it means the token you create must match the node families your workflows will use. The legacy Global API Key, the unscoped credential older Cloudflare tutorials describe, is deliberately not supported here.
Connect Cloudflare to Mattering
Verify it works
After connecting, open any automation canvas and check the palette: a Cloudflare section should list the query and action nodes. Drop Cloudflare: Verify API Token onto the canvas and run a test step. It is the integration's universal probe: it works for every scoped token no matter how narrow, and a successful response returns the token's id, its active status, and its validity window without echoing the secret. If this node succeeds, the credential is healthy; anything failing after it is a permissions or parameters question, not an authentication one.
Next, run Cloudflare: List Zones and copy a zone ID, because every zone-level node (DNS, cache, settings, Page Rules, zone rulesets) needs one, then run Cloudflare: List Accounts and copy the account ID that the KV, Worker, R2, and list nodes need. One caution on a nearby node: Cloudflare: Get Current User only works for user-owned tokens that carry the User Details read permission, so an account-owned token failing there is expected and not a defect. Everything in this verify path is read-only: it cannot reach the nine destructive nodes or change a single setting, so it is safe to re-run whenever you rotate the token.
Node reference
56 nodes, generated from the connector itself so this reference always matches what ships.
Read and query nodes 30
Cloudflare: Export DNS Records
cloudflare_export_dns_records
Export the zone's complete DNS record set as a BIND zone file (plain text at data.content). The natural backup step before bulk changes, and the input format Cloudflare: Import DNS Records accepts.
Cloudflare: Get Account
cloudflare_get_account
Fetch one account: name, type, settings, and created date.
Cloudflare: Get Bulk Operation Status
cloudflare_get_bulk_operation
Poll an asynchronous list operation (from Add List Items) until its status is completed or failed.
Cloudflare: Get Current User
cloudflare_get_user
Fetch the user the token belongs to: id, email, name, and two-factor status. Requires a USER-owned token with User Details read permission; account-owned tokens get a permission error here (use Verify API Token instead).
Cloudflare: Get DNS Record
cloudflare_get_dns_record
Fetch one DNS record: type, name, content, TTL, proxy status, comment, and tags.
Cloudflare: Get KV Key Metadata
cloudflare_get_kv_metadata
Read the JSON metadata stored with a key, without fetching the value itself.
Cloudflare: Get List
cloudflare_get_list
Fetch one list's properties: kind, description, item count, and how many rules reference it.
Cloudflare: Get List Items
cloudflare_get_list_items
List a list's items - for a redirect list, each item's source URL, target URL, and status code. Cursor paginated.
Cloudflare: Get Page Rule
cloudflare_get_page_rule
Fetch one Page Rule: its URL match pattern, actions, priority, and status.
Cloudflare: Get R2 Bucket
cloudflare_get_r2_bucket
Fetch one R2 bucket's properties: creation date, location, and storage class.
Cloudflare: Get Worker Script
cloudflare_get_worker_script
Download a Worker's deployed source code as text at data.content (module Workers return the bundle content). Capped at 200,000 characters in the node output. Uploading new code stays in Wrangler or CI; this connector reads and manages but does not deploy.
Cloudflare: Get Worker Script Settings
cloudflare_get_worker_script_settings
Read a Worker's metadata settings: Logpush flag, tags, tail consumers, and observability configuration.
Cloudflare: Get Zone
cloudflare_get_zone
Fetch one zone: status, type, paused flag, assigned Cloudflare name servers, and account.
Cloudflare: Get Zone Phase Entrypoint
cloudflare_get_zone_entrypoint_ruleset
Fetch the zone's entry point ruleset for a phase, with its rules: what actually runs for that phase on live traffic. Returns 404 when the zone has no ruleset in the phase yet.
Cloudflare: Get Zone Ruleset
cloudflare_get_zone_ruleset
Fetch one zone ruleset INCLUDING its rules: each rule's action, filter expression, description, and enabled flag. The audit view of a zone's WAF custom rules.
Cloudflare: Get Zone Setting
cloudflare_get_zone_setting
Read one zone setting by its ID, for example ssl, security_level, cache_level, development_mode, always_use_https, or browser_cache_ttl.
Cloudflare: List Account Lists
cloudflare_list_account_lists
List the account's lists (redirect, ip, hostname, asn kinds) with item counts. Redirect lists are the storage half of Bulk Redirects.
Cloudflare: List Account Rulesets
cloudflare_list_account_rulesets
List account-level rulesets, including the Bulk Redirect phase (http_request_redirect) and Enterprise custom rulesets.
Cloudflare: List Accounts
cloudflare_list_accounts
List the Cloudflare accounts the token can access, with their account IDs. Almost every account-level node (KV, Workers, R2, lists) needs an account ID from here.
Cloudflare: List DNS Records
cloudflare_list_dns_records
List a zone's DNS records with filters on type, name, content, comment, and proxy status. Returns record IDs used by the get, update, and delete nodes.
Cloudflare: List KV Keys
cloudflare_list_kv_keys
List key names in a KV namespace, optionally filtered by prefix, with each key's expiration and metadata. Cursor paginated: pass data.result_info.cursor back to get the next page.
Cloudflare: List KV Namespaces
cloudflare_list_kv_namespaces
List the account's Workers KV namespaces with their IDs, which every KV key node needs.
Cloudflare: List Page Rules
cloudflare_list_page_rules
List a zone's Page Rules with their URL targets, actions, priority, and status. Page Rules is deprecated in favor of modern Rules but still served; Free zones get 3 rules.
Cloudflare: List R2 Buckets
cloudflare_list_r2_buckets
List the account's R2 buckets with creation date, location, and storage class. Bucket MANAGEMENT only: reading and writing objects uses R2's S3-compatible API with separate R2 credentials and is not part of this connector.
Cloudflare: List Worker Scripts
cloudflare_list_worker_scripts
List the account's deployed Worker scripts with names, handlers, usage model, and modification times.
Cloudflare: List Zone Rulesets
cloudflare_list_zone_rulesets
List a zone's rulesets (WAF custom rules, rate limiting, redirects, transforms) with id, kind, phase, and version. Read-only: this connector audits rulesets but does not write them.
Cloudflare: List Zone Settings
cloudflare_list_zone_settings
Read every setting on a zone in one call: SSL mode, security level, cache level, development mode, always_use_https, minify, and dozens more, each with its current value and whether the plan allows editing it.
Cloudflare: List Zones
cloudflare_list_zones
List zones (domains) the token can see, with zone IDs, status, plan, and name servers. Filter by domain name, status, or account. The zone ID from here feeds every zone-level node (DNS, cache, settings, rules).
Cloudflare: Read KV Value
cloudflare_read_kv_value
Read one key's stored value, returned verbatim as text at data.content (KV values are arbitrary bytes; JSON values arrive as a JSON string to parse downstream). A missing key returns 404. Values are capped at 200,000 characters in the node output.
Cloudflare: Verify API Token
cloudflare_verify_token
Check the stored API token: returns its id, active/disabled/expired status, and validity window. Works with every scoped token regardless of permissions, so this is the credential health check to run first in any Cloudflare automation.
Action nodes 26
Cloudflare: Add List Items
cloudflare_add_list_items
Append items to a list - for a redirect list, the bulk redirect entries themselves. Asynchronous: the response returns an operation_id to poll with Cloudflare: Get Bulk Operation Status.
Cloudflare: Bulk Delete KV Pairs
cloudflare_delete_kv_bulk
DESTRUCTIVE: delete up to 10,000 keys from a namespace in one call. All listed values are gone permanently.
Cloudflare: Bulk Write KV Pairs
cloudflare_write_kv_bulk
Write up to 10,000 key-value pairs in one call. Each item is an object with key and value plus optional expiration, expiration_ttl, metadata, and base64 fields. Existing keys are overwritten.
Cloudflare: Create DNS Record
cloudflare_create_dns_record
Create a DNS record in a zone: A, AAAA, CNAME, MX, TXT, NS, and the other supported types. Reversible with Cloudflare: Delete DNS Record. Structured types like SRV and CAA take their data object via Extra body fields.
Cloudflare: Create KV Namespace
cloudflare_create_kv_namespace
Create a Workers KV namespace. Reversible with Cloudflare: Delete KV Namespace.
Cloudflare: Create List
cloudflare_create_list
Create a list. kind=redirect makes a Bulk Redirect list (all plans: 5 lists and 10,000 URL redirects on Free); kind=ip makes an IP list usable in WAF expressions. Fill it with Cloudflare: Add List Items, then enable redirect lists via a Bulk Redirect rule in the dashboard.
Cloudflare: Create Page Rule
cloudflare_create_page_rule
Create a Page Rule: a URL pattern plus the actions applied to matching requests (forwarding_url redirects, cache_level, always_use_https, and more). Counts against the plan's quota (3 on Free). Reversible with Cloudflare: Delete Page Rule.
Cloudflare: Create R2 Bucket
cloudflare_create_r2_bucket
Create an R2 bucket (requires R2 to be enabled on the account). Reversible with Cloudflare: Delete R2 Bucket while the bucket is empty.
Cloudflare: Create Zone
cloudflare_create_zone
Add a domain to a Cloudflare account. The response includes the two Cloudflare name servers to set at the registrar; the zone stays pending until they are. Reversible with Cloudflare: Delete Zone.
Cloudflare: Delete DNS Record
cloudflare_delete_dns_record
DESTRUCTIVE: delete a DNS record. The name stops resolving as caches expire and the record's exact contents are gone unless captured beforehand (Cloudflare: Get DNS Record or Export DNS Records).
Cloudflare: Delete KV Namespace
cloudflare_delete_kv_namespace
DESTRUCTIVE: delete a KV namespace and EVERY key-value pair in it, permanently. Workers bound to the namespace start failing their KV calls.
Cloudflare: Delete KV Value
cloudflare_delete_kv_value
DESTRUCTIVE: delete one key-value pair from a namespace. The stored value is gone unless read beforehand.
Cloudflare: Delete List
cloudflare_delete_list
DESTRUCTIVE: delete a list and every item in it. Fails while rules still reference the list; remove those rules first. Redirects served from the list stop.
Cloudflare: Delete Page Rule
cloudflare_delete_page_rule
DESTRUCTIVE: delete a Page Rule permanently. Its redirect/cache behavior stops immediately and the rule configuration is gone unless read beforehand.
Cloudflare: Delete R2 Bucket
cloudflare_delete_r2_bucket
DESTRUCTIVE: delete an R2 bucket. The bucket must already be empty (R2 refuses to delete a bucket containing objects), but the bucket configuration and its name reservation are gone.
Cloudflare: Delete Worker Script
cloudflare_delete_worker_script
DESTRUCTIVE: delete a deployed Worker script permanently. Its routes stop being served and the code is gone from Cloudflare (keep the source in git). force=true also removes the script when other resources still reference it.
Cloudflare: Delete Zone
cloudflare_delete_zone
DESTRUCTIVE: remove a zone from Cloudflare. All DNS records, settings, and rules for the zone are deleted with it and cannot be restored; the domain stops resolving through Cloudflare immediately. Export DNS records first if there is any doubt.
Cloudflare: Edit Page Rule
cloudflare_edit_page_rule
Edit fields on an existing Page Rule; only the fields you fill are changed. Flipping status between active and disabled is the low-risk way to toggle a rule.
Cloudflare: Edit Worker Script Settings
cloudflare_edit_worker_script_settings
Edit a Worker's metadata settings without redeploying code: toggle Logpush, set tags, wire tail consumers, or configure observability. Only fields you fill are changed.
Cloudflare: Edit Zone
cloudflare_edit_zone
Edit zone properties: pause or unpause Cloudflare on the zone (paused bypasses the proxy entirely), change the setup type, or set vanity name servers. Only fields you fill are sent.
Cloudflare: Edit Zone Setting
cloudflare_edit_zone_setting
Change one zone setting, for example turn development_mode on, set security_level to under_attack during an incident, or set min_tls_version to 1.2. Reversible by writing the previous value back; read it first with Cloudflare: Get Zone Setting.
Cloudflare: Import DNS Records
cloudflare_import_dns_records
Import DNS records into a zone from BIND zone-file text (the format Export DNS Records produces). Adds records; it does not delete existing ones. Returns how many records were parsed and added.
Cloudflare: Purge Cache
cloudflare_purge_cache
Purge Cloudflare's cache for a zone. Fill EXACTLY ONE of: purge_everything, files (URLs), tags, hosts, or prefixes - all purge modes are available on every plan. A purge cannot be undone, but the cache refills from the origin on the next requests; purging everything on a busy site briefly raises origin load. Deploy-webhook to purge is the classic automation.
Cloudflare: Rename KV Namespace
cloudflare_rename_kv_namespace
Rename a KV namespace. The namespace ID and all stored data are unchanged, so Workers bound by ID keep working.
Cloudflare: Update DNS Record
cloudflare_update_dns_record
Update fields on an existing DNS record; only the fields you fill are changed. The classic dynamic-DNS move: point content at a new IP, or flip proxied on and off.
Cloudflare: Write KV Value
cloudflare_write_kv_value
Write a value to a key (creating or overwriting it), with optional JSON metadata and expiry. KV is eventually consistent: edge reads can serve the old value for up to about 60 seconds. Values up to 25 MB; metadata up to 1024 bytes.
Using the integration
On the automation canvas
Cloudflare nodes chain with every other node: a deploy webhook can run Cloudflare: Purge Cache by prefix for the paths that changed and then open a verification task in Mattering Productivity, a scheduled sweep can read Cloudflare: List Zone Settings across zones and write drift into a Mattering database, and Cloudflare: List DNS Records can feed a domain inventory that lives next to the rest of the work. The zone ID from Cloudflare: List Zones and the account ID from Cloudflare: List Accounts are the two values almost every downstream node asks for.
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. An agent can read a zone with Cloudflare: List DNS Records, take a one-node backup with Cloudflare: Export DNS Records, repoint a record with Cloudflare: Update DNS Record, and clear the right cache with Cloudflare: Purge Cache. The read nodes are the safest surface to hand an agent; keep the nine destructive nodes behind conditions or approval steps.
DNS with the backup step built in
Cloudflare: Export DNS Records returns the zone's complete record set as BIND zone-file text, and running it before any bulk change is the habit that makes DNS automation calm. Cloudflare: Import DNS Records accepts that same format and adds the records back; note that import only adds, it never deletes existing records, so replaying an export onto a changed zone can produce duplicates rather than a reset. For single records, Cloudflare: Update DNS Record changes only the fields you fill, which is also the classic dynamic DNS move: point content at a new IP or flip proxied on and off.
Workers KV as shared state
Cloudflare: Write KV Value and Cloudflare: Read KV Value give automations and edge Workers a common store: a workflow writes a release id or a feature flag, and the Worker reads it on the next request. Cloudflare: Bulk Write KV Pairs loads up to 10,000 pairs in one call and Cloudflare: List KV Keys walks a namespace by prefix with cursor pagination. Two physical realities to plan around: KV is eventually consistent, so edge reads can serve an old value for up to about 60 seconds after a write, and value reads in the node output are capped at 200,000 characters even though stored values can be up to 25 MiB.
The nine destructive nodes, gated
Cloudflare: Delete Zone is the heaviest: it removes the zone with all its DNS records, settings, and rules, and the domain stops resolving through Cloudflare immediately, so export DNS first if there is any doubt. Cloudflare: Delete KV Namespace takes every stored pair with it and breaks Workers bound to it, Cloudflare: Bulk Delete KV Pairs removes up to 10,000 keys in one call, and Cloudflare: Delete Worker Script removes deployed code from Cloudflare entirely, so keep the source in git. The rest (Cloudflare: Delete DNS Record, Cloudflare: Delete KV Value, Cloudflare: Delete R2 Bucket, Cloudflare: Delete Page Rule, Cloudflare: Delete List) are smaller but equally final. The pattern for all nine is the same: read or export the thing first, and put the delete behind a condition, an approval task, or a manual run rather than a bare trigger.
What stays read-only or off the canvas
Four boundaries are deliberate. Ruleset writes are excluded because a mis-authored write replaces a zone's entire phase ruleset and can drop the WAF in one call; Cloudflare: List Zone Rulesets, Cloudflare: Get Zone Ruleset, Cloudflare: List Account Rulesets, and Cloudflare: Get Zone Phase Entrypoint make the audit side first-class instead (the entrypoint node returns 404 when the zone has no ruleset in that phase yet, which is normal). Worker code uploads stay in Wrangler or CI; the connector reads deployed code with Cloudflare: Get Worker Script and manages metadata with Cloudflare: Edit Worker Script Settings. R2 object reads and writes use R2's S3-compatible API with separate credentials, so the R2 nodes manage buckets only. And activating a redirect list built with Cloudflare: Create List and Cloudflare: Add List Items needs a Bulk Redirect rule enabled once in the Cloudflare dashboard, precisely because ruleset writes are off the canvas.
Troubleshooting
Test Connection fails with an invalid token error
Test Connection passes but some node families return authorization errors
Cloudflare: Get Current User fails while everything else works
Nodes start returning 429 during a large sweep
Cloudflare: Purge Cache returns 429 while every other node is fine
The R2 nodes fail on an account where everything else works
A redirect list is created and filled but the redirects do not serve
Cloudflare: Read KV Value returns an old value right after a write
Related
The Cloudflare MCP
What connecting Cloudflare 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 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.