Skip to content

Deploy to Cloudflare

Ship a Pro app to Cloudflare Workers with D1, R2, Durable Objects and a maintenance cron.

Pro apps run on Cloudflare Workers:

  • D1 stores users, workspaces, agents, automations, runs and your models.
  • R2 stores profile images and workspace logos.
  • Durable Objects run agents and automations, so runs survive restarts and wait for approvals.
  • A cron trigger runs maintenance every five minutes: it recovers stalled schedules and runs, and applies retention.

Nuxt

  1. Create the database and bucket, then put the database ID in wrangler.jsonc:
    pnpm wrangler d1 create nuxt-agentic-starter
    pnpm wrangler r2 bucket create nuxt-agentic-starter-images
    
  2. Apply migrations and set secrets:
    pnpm db:migrate:remote
    pnpm wrangler secret put BETTER_AUTH_SECRET
    pnpm wrangler secret put AGENTIC_ENCRYPTION_KEY
    pnpm wrangler secret put ANTHROPIC_API_KEY   # and any other provider keys
    
  3. Build and deploy:
    pnpm run deploy
    

The build adds Agentic Durable Objects, their migration, and the maintenance cron to .output's Wrangler config. Set BETTER_AUTH_URL to your production URL. To change the maintenance schedule, set agentic.cron, for example agentic: { cron: '*/5 * * * *' }.

Void

pnpm run deploy

Void provisions D1, R2, Durable Objects and the maintenance cron, and creates BETTER_AUTH_SECRET on first deploy. Set AGENTIC_ENCRYPTION_KEY and provider keys as secrets.

Production checklist

  • Generate AGENTIC_ENCRYPTION_KEY once (pnpm exec agentic keygen writes one for development) and keep it safe. A new key makes stored integration credentials unreadable.
  • Use a different BETTER_AUTH_SECRET and AGENTIC_ENCRYPTION_KEY from development.
  • Register OAuth apps with your production callback URLs. See Integrations.
  • Allow outbound origins: AGENTIC_WEBHOOK_ORIGINS for webhook outcomes and AGENTIC_MCP_ORIGINS for MCP servers.
  • Choose retention. See Configuration.
  • Run pnpm exec agentic doctor before the first deploy.

Migrations are yours: review each generated migration before you apply it to production, and apply it before deploying code that needs it.