Manual Worker Setup
Deploy the AgentFi Worker yourself — no need to share Cloudflare credentials with AgentFi.
Prefer automatic deployment? If you're comfortable providing a Cloudflare API Token, the one-click setup handles everything for you. Both methods result in the same Worker.
Prerequisites
- A Cloudflare account with an active domain (zone) using Cloudflare DNS.
- A free Cloudflare Workers plan is sufficient.
- An AgentFi account with at least one site added and crawled.
- For the Wrangler CLI method: Node.js (v18+) installed on your machine.
Step 1: Download the Worker Script
- Go to Dashboard → AIO → [Your Site] → Integration.
- Select the "Manual Deployment" tab.
- Click "Download Worker Script."
- Save the file as
agentfi-aio-worker.js. The script is pre-configured with your account ID and base path.
Step 2a: Deploy via Wrangler CLI
Install Wrangler if you haven't already:
npm install -g wrangler wrangler login
Create a wrangler.toml in the same directory as your downloaded script:
name = "agentfi-aio-worker"
main = "agentfi-aio-worker.js"
compatibility_date = "2024-01-01"
routes = [
{ pattern = "yourdomain.com/*", zone_name = "yourdomain.com" }
]Replace yourdomain.com with your actual domain. Then deploy:
wrangler deploy
Step 2b: Deploy via Cloudflare Dashboard
Alternatively, you can deploy through the Cloudflare web dashboard:
- Log in to dash.cloudflare.com.
- Go to Workers & Pages → Create.
- Name the Worker
agentfi-aio-worker. - Click "Deploy" to create an empty Worker.
- Click "Edit Code" and paste the contents of the downloaded script.
- Click "Save and Deploy."
- Go to Settings → Triggers → Routes and add a route:
yourdomain.com/*
Step 3: Configure and Verify in AgentFi
- Go back to the AgentFi Integration page and set the Client Domain to your site URL (e.g.,
https://yourdomain.com). - Set the Base Path if you changed it (default is
/agentfi). - Click "Save Configuration".
- Click "Verify" to confirm the Worker is responding correctly.
- Click "Enable" to activate the integration and start health monitoring.
Once verified and enabled, AgentFi will monitor the integration every 10 minutes. If the Worker becomes unreachable, the dashboard will show a warning.
Updating the Worker
When AgentFi updates the Worker script (e.g., new routes or bot detection improvements), you'll need to download the new script and redeploy it manually. Check the Integration page periodically — if a redeploy is needed, you can download the latest script from there.