A typical Workers architecture
┌──────────────┐ HTTP ┌──────────────────────┐
Browser ──▶│ Next.js app │────────▶│ Hono API Worker │──▶ Postgres (Neon) via Drizzle
│ (OpenNext) │ │ /v1/products, orders │──▶ R2 (private files)
└──────────────┘ │ /v1/webhooks/* │──▶ Queue producer
└──────────┬───────────┘
│ Queue (payment events, retries, DLQ)
┌──────────▼───────────┐
│ Queue consumer │──▶ Email (Resend)
│ + cron sweep (6h) │
└──────────────────────┘
This is the shape of the creator commerce platform. The frontend and API are separate Workers coupled only over HTTP: no shared build dependency, so each can be deployed independently.
Environments in Wrangler config
Bindings are declared per environment in wrangler.toml. Development and production each get their own R2 bucket and payment queue, and production adds a dead-letter queue. Code reads env.ASSETS_BUCKET or env.PAYMENT_QUEUE and never knows which environment it’s in.
Queues and cron triggers
- Queues decouple webhook receipt from processing: the webhook handler verifies and enqueues, then returns immediately.
- Cron Triggers run a scheduled job (every six hours on that platform) that finds paid-but-unfulfilled orders and completes them, a safety net for anything the queue path missed.
Multi-app deployments
On Ekonavi, multiple apps deploy to Workers from one monorepo. GitHub Actions builds affected apps, deploys to staging, and promotes to production through a matrix job, so every app follows the same release path.