New260+ blocks and 240+ tools are now fully documented
DocumentationReferenceTool IntegrationsCloud & Infrastructure
Tool

Cloudflare Tools

Manage Cloudflare zones, DNS records, and cache purging from your workflows.

Overview

PropertyValue
Providercloudflare
Categorytools
AuthBearer Token (Cloudflare API Token)

Cloudflare tools let you automate domain and DNS management directly from Zelaxy workflows. Use them to list or inspect zones, create and update DNS records programmatically, and purge cached content — for example, as part of a deployment pipeline that sets a new CNAME and then clears the CDN cache.

Operations

OperationTool IDDescription
List Zonescloudflare_list_zonesLists all zones (domains) in the Cloudflare account, with optional filtering and pagination.
Get Zonecloudflare_get_zoneGets full details for a specific zone by its ID.
List DNS Recordscloudflare_list_dns_recordsLists DNS records for a specific zone, with optional type/name/content filters.
Create DNS Recordcloudflare_create_dns_recordCreates a new DNS record (A, CNAME, MX, TXT, etc.) in a zone.
Update DNS Recordcloudflare_update_dns_recordUpdates one or more fields of an existing DNS record via PATCH.
Delete DNS Recordcloudflare_delete_dns_recordPermanently deletes a DNS record from a zone.
Purge Cachecloudflare_purge_cachePurges cached content for a zone — everything, specific URLs, tags, hosts, or URL prefixes.

Configuration

cloudflare_list_zones

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token (sent as Authorization: Bearer).
namestringNoFilter results by domain name (exact match).
statusstringNoFilter by zone status. Enum: initializing, pending, active, moved.
pagenumberNoPage number for pagination (default: 1).
per_pagenumberNoNumber of zones per page (default: 20, max: 50).
accountIdstringNoFilter zones by account ID.
orderstringNoSort field. Enum: name, status, account.id, account.name.
directionstringNoSort direction. Enum: asc, desc.
matchstringNoMatch logic applied when multiple filters are set. Enum: any, all.

cloudflare_get_zone

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone to retrieve details for.

cloudflare_list_dns_records

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone whose DNS records to list.
typestringNoFilter by DNS record type. Common values: A, AAAA, CNAME, MX, TXT.
namestringNoFilter by record name (exact match).
contentstringNoFilter by record content (exact match).
pagenumberNoPage number for pagination.
per_pagenumberNoRecords per page (default: 100).
searchstringNoFree-text search across record fields (name, content, comment).

cloudflare_create_dns_record

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone to create the record in.
typestringYesDNS record type. Enum: A, AAAA, CNAME, MX, TXT, NS, SRV.
namestringYesDNS record name (e.g. www or @ for root).
contentstringYesDNS record content (e.g. an IP address for A records, a hostname for CNAME).
ttlnumberNoTime-to-live in seconds. Use 1 for automatic TTL.
proxiedbooleanNoWhen true, traffic routes through Cloudflare's proxy (orange cloud).
prioritynumberNoPriority value, required for MX and SRV records.
commentstringNoHuman-readable comment attached to the record.

cloudflare_update_dns_record

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone containing the record.
recordIdstringYesThe ID of the DNS record to update.
typestringNoNew DNS record type.
namestringNoNew record name.
contentstringNoNew record content.
ttlnumberNoNew TTL in seconds.
proxiedbooleanNoToggle Cloudflare proxy on or off.
prioritynumberNoNew priority for MX/SRV records.
commentstringNoNew comment for the record.

cloudflare_delete_dns_record

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone containing the record.
recordIdstringYesThe ID of the DNS record to delete.

cloudflare_purge_cache

ParameterTypeRequiredDescription
apiKeystringYesCloudflare API Token.
zoneIdstringYesThe ID of the zone to purge cache for.
purge_everythingbooleanNoWhen true, purges all cached content for the zone. Cannot be combined with other selectors.
filesstringNoComma-separated list of exact URLs to purge.
tagsstringNoComma-separated list of cache tags to purge. Enterprise plans only.
hostsstringNoComma-separated list of hostnames to purge. Enterprise plans only.
prefixesstringNoComma-separated list of URL prefixes to purge. Enterprise plans only.

At least one of purge_everything, files, tags, hosts, or prefixes must be provided.

Outputs

cloudflare_list_zones

  • zones (array) — List of zone objects returned by the Cloudflare API, each containing the full zone metadata (id, name, status, account, nameservers, etc.).
  • total_count (number) — Total number of zones matching the filters across all pages.

cloudflare_get_zone

  • id (string) — The zone's unique identifier.
  • name (string) — The domain name for the zone.
  • status (string) — The current zone status (active, pending, initializing, moved).

cloudflare_list_dns_records

  • records (array) — List of DNS record objects, each containing id, type, name, content, proxied, ttl, and other metadata.
  • total_count (number) — Total number of records matching the filters across all pages.

cloudflare_create_dns_record

  • id (string) — The newly created DNS record's unique ID.
  • name (string) — The DNS record name.
  • type (string) — The DNS record type.

cloudflare_update_dns_record

  • id (string) — The updated DNS record's unique ID.
  • name (string) — The DNS record name after the update.

cloudflare_delete_dns_record

  • id (string) — The ID of the record that was deleted.

cloudflare_purge_cache

  • id (string) — A purge-request identifier returned by Cloudflare confirming the operation was queued.

YAML Example

cloudflare_1:
  type: cloudflare
  name: "Cloudflare"
  inputs:
    operation: "cloudflare_create_dns_record"
    apiKey: "{{CLOUDFLARE_API_TOKEN}}"
    zoneId: "{{vars.zoneId}}"
    type: "CNAME"
    name: "app"
    content: "{{deploy.hostname}}"
    proxied: true
    ttl: 1
  connections:
    outgoing:
      - target: purge-cache-block

Tips

  • API Token vs Global API Key: Always use a scoped API Token (created in the Cloudflare dashboard under Profile > API Tokens) rather than your Global API Key. Scope it to the minimum permissions needed — for DNS management, grant Zone:DNS:Edit on the relevant zones.
  • Chaining zone lookup with DNS operations: If you don't know a Zone ID ahead of time, use cloudflare_list_zones first with a name filter to look it up, then pass {{cloudflare_1.zones[0].id}} into the next block's zoneId input.
  • Cache purge scope: purge_everything is the simplest option but invalidates your entire CDN cache. For production sites, prefer targeting specific files or prefixes to avoid a cache-warming spike. Tag-based and host-based purging require an Enterprise plan.