Cloudflare Workers
When your frontend runs on Cloudflare Workers and pulls content from Directus, publishing a content change doesn't automatically trigger a new build. This integration adds deployment controls to Directus so your team can trigger builds, track progress, and review logs without switching to the Cloudflare dashboard.
- Enable the Deployment module in your Directus project settings (under Modules).
- Link Cloudflare: open the Deployment module and choose Configure Cloudflare Workers (or add the provider from Settings).
- Enter credentials and Account ID (see below), save, then select which Workers to manage.
- Deploy from a Worker's project view, or use an optional Deploy Hook action if you configured hook URLs.
Getting Started
Link Your Cloudflare Account
- In Directus, go to Settings.
- Under Modules, enable Deployment.
- Open the Deployment module from the primary navigation.
- Select Configure Cloudflare Workers (the label may appear as Cloudflare Workers in the provider list).
- Provide your credentials:
- Personal Access Token: a user-scoped Cloudflare API token (not an account token) with at least:
- Workers Builds Configuration: Edit
- Workers Scripts: Read
- Account ID: your Cloudflare account ID (the 32-character hex string shown in the dashboard URL and account overview).
Use Open Cloudflare Settings in the form to create or manage tokens in the Cloudflare dashboard. - Personal Access Token: a user-scoped Cloudflare API token (not an account token) with at least:
- Click Save to validate and continue to project selection.
Directus stores the token encrypted. Changing the token or Account ID after setup can make previously selected Workers unavailable until you update credentials or re-select them.
Workers Builds Prerequisites
For a Worker to appear as deployable in Directus, Cloudflare must have:
- Workers Builds enabled for that Worker.
- A connected Git repository and a build trigger configured.
If Directus shows that a Worker is not deployable, open Worker Settings → Builds in the Cloudflare dashboard and complete setup (the in-app copy points you there).
Configure Workers
- From the Cloudflare Workers configuration screen, choose which Workers Directus should manage.
- Click Save to store the selection.
- Return to integration settings anytime to add or remove Workers.
Removing a Worker from this integration permanently deletes all deployment history stored in Directus for that Worker. This cannot be undone.
Optional: Deploy Hooks
In Cloudflare, create Deploy Hook URLs under Worker Settings → Builds → Deploy Hooks. In Directus, you can add each hook with a name and URL. Those hooks appear in the Deploy menu as extra actions (for example Deploy via …) alongside the default production deploy.
View Your Workers
Once set up, connected Workers appear under the Cloudflare Workers provider. From here you can:
- See selected Workers and their deployment activity.
- Open a Worker to run deployments and browse deployment runs, logs, and links.
The Deployment module uses Directus native permissions. See Deployment Security for details on configuring roles and access policies.
Documentation
Trigger deployments, track build status, and view logs from within Directus.
Get once-a-month release notes & real‑world code tips...no fluff. 🐰