Skip to content

Architecture Overview

LayerTechnologyRationale
ComputeCloudflare WorkersEdge-first, zero cold starts, scales to zero
DatabaseCloudflare D1 (SQLite)SQL at the edge, point-in-time recovery, 100GB storage
ValidationZod (shared schema package)Same validation on CLI and API, TypeScript-first
DocsAstro Starlight on Cloudflare PagesStatic, fast, built-in search (Pagefind)
┌──────────────────────────────────────────────────────┐
│ Client (CLI / SDK) │
└────────────┬───────────────────────────────┬─────────┘
│ │
┌───────▼────────┐ ┌──────▼──────────┐
│ POST /form │ │ POST /submit │
│ (validate) │ │ (webhook) │
└───────┬────────┘ └──────┬──────────┘
│ │
┌───────▼───────────────────────────────▼─────────┐
│ Cloudflare Worker │
│ ┌─────────────────────────────────────────┐ │
│ │ Hono Router │ │
│ │ ├─ Auth middleware (API key) │ │
│ │ ├─ Zod validation │ │
│ │ ├─ Business logic │ │
│ │ └─ D1 query │ │
│ └─────────────────────────────────────────┘ │
└──────────────────────┬──────────────────────────┘
┌───────▼────────┐
│ Cloudflare D1 │
│ (SQLite) │
└────────────────┘
  • Latency. Workers run in 300+ data centers. A form validation round-trip is <50ms for most users.
  • Scaling. Zero servers to manage. Workers scale to zero when idle.
  • D1. SQLite at the edge with full SQL support, point-in-time restore, and up to 100GB per database.
  • Cost. Pay per request, not per server-hour.
agentsforms/
├── apps/
│ ├── api/ Cloudflare Workers API (Hono)
│ ├── web/ Landing page + dashboard (Astro)
│ └── docs/ This documentation (Astro Starlight)
├── packages/
│ ├── schemas/ Zod schemas + validation (shared)
│ └── sdk-js/ JavaScript SDK (TypeScript)
├── forms/ Demo form definitions
└── examples/ Agent integration examples
ServicePlatformURL
APICloudflare Workersapi.agentsforms.com
DocsCloudflare Pagesdocs.agentsforms.com
LandingCloudflare Pagesagentsforms.com
Hosted FormsCloudflare Workersagentsforms.com/f/*