Cloudflare Workers
This guide shows how to run VoltAgent on Cloudflare Workers. Workers are an edge runtime, but inside VoltAgent we refer to this mode as the serverless runtime because the same provider also powers Vercel Edge, Deno Deploy, and similar fetch-based platforms. We cover both the VoltAgent CLI flow and manual setup.
Prerequisites
- Node.js 18+
pnpmornpm- Cloudflare account and the
wranglerCLI (npm install -g wrangler) - API key for your LLM provider (for example
OPENAI_API_KEY) - Optional:
VOLTAGENT_PUBLIC_KEYandVOLTAGENT_SECRET_KEYif you use VoltOps observability
1. Generate project files
Option A: VoltAgent CLI
npm run volt deploy --target cloudflare
The CLI writes a sample wrangler.toml, a serverless entry file, and notes on required env vars. It works with empty or existing projects.
Option B: Manual setup
- Install and log in with
wrangler(wrangler login). - Create a
wrangler.tomlin your project folder (see example below). - Add a serverless entry file that bootstraps VoltAgent with
serverlessHono().