Portal Community

cache/purgeAll

Purge all cached assets for a Cloudflare zone. All subsequent requests will hit the origin until the cache warms back up.

Full origin load spike: This operation instantly invalidates all cached content for the zone. Every request from every user will hit your origin server until the cache is rebuilt. For high-traffic zones, this can significantly increase origin server load. Use cache/purgeByUrl or cache/purgeByTag for targeted invalidation when possible.
Equivalent operation: This operation is functionally identical to zone/purgeAll. Both purge all cached assets for the zone. This version is provided under the cache resource for workflow organization convenience.

When to Use

Configuration

Connection

FieldTypeRequiredDescription
ApiTokenstringrequiredScoped Cloudflare API Token with Cache Purge permission. Store in BizFirst Credentials Manager.

Operation Fields

FieldTypeRequiredDescription
ZoneIdstringrequired32-character hexadecimal Zone ID. Identifies which zone's entire cache to purge.

Sample Configuration

{
  "resource": "cache",
  "operation": "purgeAll",
  "connection": {
    "ApiToken": "{{ $credentials.cloudflare_cache_purge }}"
  },
  "ZoneId": "023e105f4ecef8ad9ca31a8372d0c353"
}

Validation Errors

CodeConditionResolution
MISSING_API_TOKENApiToken is emptySet the ApiToken credential with Cache Purge permission
MISSING_ZONE_IDZoneId is emptyProvide the Zone ID
UNKNOWN_ERRORCloudflare returned an errorVerify the token has Cache Purge scope for this zone

Output

Success Port

FieldTypeDescription
idstringPurge job ID assigned by Cloudflare — log for audit trail
statusstringok when the purge request was accepted

Error Port

On failure, the error port receives an object with code and message.

Sample Output

{
  "id": "9a7806061c88ada191ed06f989cc3dac",
  "status": "ok"
}

Expression Reference

ExpressionReturns
{{ $node.CachePurgeAll.output.id }}Purge job ID for audit log
{{ $node.CachePurgeAll.output.status }}"ok" on success

Node Policies & GuardRails

PolicyDetail
Prefer targeted purge operationsUse cache/purgeByUrl or cache/purgeByTag whenever the scope of change is known — reserve purgeAll for genuine full-site scenarios
Verify Zone ID before executionA wrong Zone ID purges the wrong domain's entire cache — use zone/list upstream if the ID is not hard-coded
Monitor origin capacity before purgingOn high-traffic sites, a full purge during peak hours can overload the origin — schedule purges during low-traffic windows
Use Cache Purge scoped tokenToken needs only Cache Purge permission
Log the purge job IDStore the returned id in an audit log with timestamp, initiating workflow, and reason for the purge

Examples

Example 1: Emergency Incident Response Purge

An ops webhook fires when a P1 incident is declared involving stale or corrupted cached content. The workflow: (1) Validates the Zone ID from the incident payload. (2) Calls cache/purgeAll. (3) Logs the purge job ID and timestamp to the incident record in PagerDuty. (4) Sends a Slack notification to the #incidents channel confirming the cache was purged.

Example 2: Post-Full-Deployment Cache Reset

After a major release: all services are deployed, health checks pass, and smoke tests succeed. The final step in the workflow calls cache/purgeAll to clear the CDN cache and allow the new release to be served to all users. The purge job ID is written to the deployment log.

Example 3: Scheduled Dev/Staging Cache Reset

A ScheduledTrigger runs at 07:00 every weekday for the staging zone. It calls cache/purgeAll to ensure developers and QA engineers start each day with fresh content from the origin. The operation is scoped only to the staging zone ID — production is never touched.