New260+ blocks and 240+ tools are now fully documented
DocumentationReferenceCore BlocksCloud & Infrastructure
Block

Cloudflare Block

Manage zones, DNS records, and caching in Cloudflare

The Cloudflare block integrates Cloudflare into your workflows. Use it to list zones, manage DNS records, and purge caches — making infrastructure changes and deployments fully automatable without leaving Zelaxy.

Overview

PropertyValue
Typecloudflare
Categorytools
Color#F48120

When to Use

  • List all zones on a Cloudflare account or fetch details for a single zone by ID.
  • Programmatically create, update, or delete DNS records (A, CNAME, MX, TXT) when infrastructure changes.
  • Point a new subdomain at a server by creating a DNS record as part of a provisioning workflow.
  • Purge a zone's cache after deploying updated content so visitors see the latest version immediately.
  • Audit or sync DNS records by reading all current records for a zone.
  • Automate DNS teardown by deleting records when deprovisioning a service or environment.

Configuration

Operation (required)

Selects which Cloudflare action to execute. This dropdown is always required and controls which other fields appear.

LabelID
List Zonescloudflare_list_zones
Get Zonecloudflare_get_zone
List DNS Recordscloudflare_list_dns_records
Create DNS Recordcloudflare_create_dns_record
Update DNS Recordcloudflare_update_dns_record
Delete DNS Recordcloudflare_delete_dns_record
Purge Cachecloudflare_purge_cache

API Token (required)

Your Cloudflare API token, stored as a secret. Required for every operation. Use {{CLOUDFLARE_API_TOKEN}} to reference an environment variable.

Zone/Record Name

The zone domain name (e.g. example.com) or the DNS record name to create. Shown when the operation is List Zones or Create DNS Record.

Zone ID

The target zone's unique ID. Shown for Get Zone, List DNS Records, Create DNS Record, and Purge Cache.

Record ID

The DNS record's unique ID. Shown for Update DNS Record and Delete DNS Record.

Record Type

The DNS record type. Shown for Create DNS Record and Update DNS Record.

LabelID
AA
CNAMECNAME
MXMX
TXTTXT

Record Content

The record's value (e.g. 1.2.3.4 for an A record). Shown for Create DNS Record and Update DNS Record.

Operation Field Matrix

OperationRequired fieldsOptional / condition-gated fields
List ZonesapiTokenname
Get ZoneapiToken, zoneId
List DNS RecordsapiToken, zoneId
Create DNS RecordapiToken, zoneId, name, recordType, recordContent
Update DNS RecordapiToken, recordId, recordType, recordContent
Delete DNS RecordapiToken, recordId
Purge CacheapiToken, zoneId

Inputs & Outputs

  • Inputs:

    • operation (string) — Operation to perform (one of the operation IDs above)
    • apiToken (string) — API token
    • name (string) — Zone or record name
    • zoneId (string) — Zone ID
    • recordId (string) — Record ID
    • recordType (string) — DNS record type
    • recordContent (string) — Record content
  • Outputs:

    • zones (json) — Zone list (populated by List Zones)
    • dnsRecords (json) — DNS records (populated by List DNS Records)

Tools

Cloudflare List Zones (cloudflare_list_zones) — Lists all zones (domains) in the Cloudflare account. Supports optional filtering by name, status, account ID, and pagination parameters.

Cloudflare Get Zone (cloudflare_get_zone) — Retrieves full details for a single zone by its ID, including status, name, and configuration.

Cloudflare List DNS Records (cloudflare_list_dns_records) — Lists DNS records for a specific zone. Supports optional filtering by record type, name, content, and free-text search across record fields.

Cloudflare Create DNS Record (cloudflare_create_dns_record) — Creates a new DNS record in a zone. Accepts type, name, content, TTL, proxied flag, priority (for MX/SRV), and an optional comment.

Cloudflare Update DNS Record (cloudflare_update_dns_record) — Updates an existing DNS record using a PATCH request. All fields (type, name, content, TTL, proxied, priority, comment) are optional; only supplied fields are changed.

Cloudflare Delete DNS Record (cloudflare_delete_dns_record) — Permanently deletes a DNS record from a zone by record ID. Returns the deleted record ID on success.

Cloudflare Purge Cache (cloudflare_purge_cache) — Purges cached content for a zone. Supports purging everything (purge_everything: true), specific URLs, cache tags (Enterprise), hostnames (Enterprise), or URL prefixes (Enterprise).

YAML Example

cloudflare_1:
  type: cloudflare
  name: "Cloudflare"
  inputs:
    operation: "cloudflare_create_dns_record"
    apiToken: "{{CLOUDFLARE_API_TOKEN}}"
    zoneId: "{{start.zoneId}}"
    name: "app.example.com"
    recordType: "A"
    recordContent: "1.2.3.4"
  connections:
    outgoing:
      - target: next-block-id