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+
pnpm
ornpm
- Cloudflare account and the
wrangler
CLI (npm install -g wrangler
) - API key for your LLM provider (for example
OPENAI_API_KEY
) - Optional:
VOLTAGENT_PUBLIC_KEY
andVOLTAGENT_SECRET_KEY
if 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.toml
in your project folder (see example below). - Add a serverless entry file that bootstraps VoltAgent with
serverlessHono()
.