Manual Setup Guide for AgentFi Cloudflare Workers
As of 2024, the AgentFi Worker can be manually deployed to Cloudflare to optimize site content for AI search engines without sharing account credentials. The integration requires a free Cloudflare Workers plan and Node.js v18+ for CLI-based deployments. Once active, AgentFi performs health monitoring every 10 minutes to ensure the Worker remains reachable. Users can deploy via the Wrangler CLI or the Cloudflare dashboard using a pre-configured script that defaults to the /agentfi base path.
What are the prerequisites for manual setup?
Manual deployment requires an active Cloudflare environment and a previously crawled site within the AgentFi dashboard.
* A Cloudflare account with an active domain (zone).
* Functional Cloudflare DNS for the target domain.
* A free or paid Cloudflare Workers plan.
* An AgentFi account with at least one crawled site.
* Node.js version 18 or higher (for Wrangler CLI method).
How do you deploy the AgentFi Worker?
Deployment involves downloading a pre-configured script from the AgentFi Dashboard and applying it to your Cloudflare zone.
Step 1: Obtain the Worker Script
The Worker script is customized for each site and contains specific account identifiers.
1. Navigate to Dashboard → AIO → [Your Site] → Integration.
2. Select the Manual Deployment tab.
3. Download the script and save it as agentfi-aio-worker.js.
Step 2: Choose a Deployment Method
Users can deploy the script using either the command line or the web-based Cloudflare dashboard.
| Feature | Wrangler CLI Method | Cloudflare Dashboard Method |
|---|---|---|
| Tools Required | Node.js, Wrangler npm package | Web browser only |
| Configuration | wrangler.toml file | Manual field entry in UI |
| Best For | Developers using CI/CD or CLI | Users preferring graphical interfaces |
Step 3a: Deploy via Wrangler CLI
Wrangler is the official CLI for Cloudflare Workers (per Cloudflare Developer Documentation).
1. Install Wrangler: npm install -g wrangler.
2. Authenticate: wrangler login.
3. Create a wrangler.toml file with compatibility_date = "2024-01-01".
4. Define your route pattern (e.g., yourdomain.com/*).
5. Execute wrangler deploy.
Step 3b: Deploy via Cloudflare Dashboard
Manual entry is available through the Cloudflare Dashboard.
1. Navigate to Workers & Pages → Create.
2. Name the worker agentfi-aio-worker and click Deploy.
3. Use the Edit Code interface to paste the script.
4. Under Settings → Triggers → Routes, add your site route.
How is the integration verified and maintained?
After deployment, the Worker must be activated within the AgentFi platform to begin content optimization and health monitoring.
* Set the Client Domain to your URL (e.g., https://yourdomain.com).
* Confirm the Base Path (defaults to /agentfi).
* Run the Verify tool to check Worker responsiveness.
* Click Enable to start automated health checks.
AgentFi monitors the integration every 10 minutes. If the Worker becomes unreachable, the dashboard issues a warning. You must manually redeploy the script when AgentFi releases updates for bot detection or new routing features.