Manual Setup Guide for AgentFi Cloudflare Workers
The manual setup for the AgentFi Cloudflare Worker allows users to deploy the integration without sharing Cloudflare credentials. As of 2024, the process requires a Cloudflare account with active DNS, an AgentFi account, and optionally Node.js v18+ for CLI users. The Worker script is pre-configured with account-specific IDs and, once enabled, AgentFi performs health monitoring every 10 minutes to ensure continuous connectivity and performance.
What are the requirements for manual AgentFi Worker setup?
To manually deploy the AgentFi Worker, users must have an active Cloudflare environment and a prepared AgentFi site profile.
* Cloudflare account with an active domain (zone).
* Active Cloudflare DNS for the domain.
* Cloudflare Workers plan (free tier is sufficient).
* AgentFi account with at least one crawled site.
* Node.js (v18+) for Wrangler CLI deployment.
How do you download the AgentFi Worker script?
The Worker script is unique to each account and must be retrieved from the AgentFi Dashboard.
1. Navigate to Dashboard → AIO → [Your Site] → Integration.
2. Select the Manual Deployment tab.
3. Click Download Worker Script.
4. Save the file locally as agentfi-aio-worker.js.
How to deploy via Wrangler CLI?
Wrangler CLI deployment is recommended for users who prefer terminal-based workflows and local configuration management.
1. Install and Login: Install the Wrangler package and authenticate with Cloudflare.
```bash
npm install -g wrangler
wrangler login
```
2. Configure: Create a wrangler.toml file in the script directory with the following parameters:
* name: "agentfi-aio-worker"
* main: "agentfi-aio-worker.js"
* compatibility_date: "2024-01-01"
routes: Set the pattern to yourdomain.com/.
3. Deploy: Execute wrangler deploy to push the Worker to the Cloudflare edge.
How to deploy via the Cloudflare Dashboard?
Users can deploy the Worker through the Cloudflare Dashboard if they prefer a web-based interface over the command line.
1. Navigate to Workers & Pages → Create in the Cloudflare dashboard.
2. Create a Worker named agentfi-aio-worker and select Deploy.
3. Choose Edit Code and paste the contents of the downloaded agentfi-aio-worker.js.
4. Save and deploy the code.
5. In Settings → Triggers → Routes, add your domain route (e.g., yourdomain.com/*).
How to verify and enable the AgentFi integration?
Once the Worker is deployed to Cloudflare, the connection must be finalized and verified within the AgentFi platform.
1. Set the Client Domain to your full URL (e.g., https://yourdomain.com).
2. Confirm the Base Path (the system default is /agentfi).
3. Click Save Configuration followed by Verify.
4. Select Enable to activate the integration.
AgentFi monitors the integration health every 10 minutes. If the Worker becomes unreachable, a warning is displayed on the dashboard.
How are Worker updates managed?
Manual deployments require manual updates whenever AgentFi releases improvements to bot detection or routing.
* Check the Integration page periodically for update notifications.
* Download the latest script version when prompted.
* Redeploy the new script using the CLI or Dashboard methods described above.
For those who prefer automated updates, AgentFi offers a one-click setup that handles deployment and future script updates automatically.
Source: https://agentfi.tech/docs/manual-worker-setup