Portal / Nodes / Cloudflare / zone/purgeAll
zone/purgeAll
Purge all cached assets for a Cloudflare zone. Every subsequent request will hit the origin until assets are re-cached.
Origin load spike: Purging all cached assets means every subsequent request hits your origin server until the cache warms back up. For high-traffic zones this can cause a significant load spike. Prefer
cache/purgeByUrl or
cache/purgeByTag for surgical invalidation.
When to Use
- Post major content update: After a large content migration or full-site redesign deployment, purge all cache to ensure visitors immediately see fresh content.
- Emergency security patch: After deploying a security-critical fix that affects many pages, a full purge ensures no user receives a cached vulnerable response.
- Domain migration cleanup: After migrating a domain or switching origin infrastructure, purge all stale cached responses to avoid routing old content.
- Corrupted content remediation: When a caching error has stored corrupted responses, a full purge is the fastest recovery path.
- Pre-testing origin headers: Clear all cached content before running a test that needs to observe raw origin response headers without CDN interference.
Configuration
Connection
| Field | Type | Required | Description |
ApiToken | string | required | Scoped Cloudflare API Token with Cache Purge permission. Store in BizFirst Credentials Manager. |
Operation Fields
| Field | Type | Required | Description |
ZoneId | string | required | 32-character hexadecimal Zone ID. Identifies which zone's entire cache to purge. |
Sample Configuration
{
"resource": "zone",
"operation": "purgeAll",
"connection": {
"ApiToken": "{{ $credentials.cloudflare_cache_purge }}"
},
"ZoneId": "023e105f4ecef8ad9ca31a8372d0c353"
}
Validation Errors
| Code | Condition | Resolution |
MISSING_API_TOKEN | ApiToken is empty or not configured | Set the ApiToken credential with Cache Purge permission |
MISSING_ZONE_ID | ZoneId field is empty | Provide a valid 32-character hex Zone ID |
UNKNOWN_ERROR | Cloudflare returned an error (e.g., insufficient permissions) | Verify the token has Cache Purge scope for this zone |
Output
Success Port
| Field | Type | Description |
id | string | Purge job ID assigned by Cloudflare — use for audit logging |
status | string | ok 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
| Expression | Returns |
{{ $node.PurgeAll.output.id }} | Purge job ID for audit log |
{{ $node.PurgeAll.output.status }} | "ok" on success |
Node Policies & GuardRails
| Policy | Detail |
| Use targeted purge when possible | cache/purgeByUrl and cache/purgeByTag minimize origin load — reserve purgeAll for situations that genuinely require full invalidation |
| Verify Zone ID before execution | A wrong Zone ID purges the wrong domain's cache — use zone/list upstream if the ID is not hard-coded |
| Use Cache Purge scoped token | Token needs only Cache Purge permission — do not use a Zone.Edit token for this operation |
| Store ApiToken in Credentials Manager | Never hardcode the token in configuration JSON |
| Log the purge job ID | Store the returned id in an audit log for traceability — required for compliance and incident review |
Examples
Example 1: Full Cache Purge as Part of Deployment Pipeline
As the final step in a CI/CD deployment workflow: after Docker containers are updated and health checks pass, call zone/purgeAll to flush stale cached responses. Log the purge job ID to the deployment audit trail.
Example 2: Emergency Purge via Webhook Trigger
Create a workflow triggered by a Webhook node. When an ops engineer POSTs to the webhook URL, the workflow validates the request, calls zone/purgeAll, and sends a Slack confirmation with the purge job ID and timestamp.
Example 3: Scheduled Nightly Cache Refresh
Use a ScheduledTrigger node set to run at 02:00 UTC daily. Call zone/purgeAll for development or staging zones to ensure testers always start the day with fresh content from origin without manual intervention.