Run deferred/background work on Deno Deploy (Deno Queues are NOT supported - use KV + cron instead)

domain: deno.com · 8 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Auth: In-app runtime identity; no extra credential for Deno.cron or Deno KV inside deployed code.
  2. Do NOT use Deno.Kv.enqueue()/listenQueue() on the current Deno Deploy - the official migration guide states Deno Queues are not supported on the new platform (they worked only on Deploy Classic).
  3. Model deferred work as KV rows: await kv.set(["jobs", crypto.randomUUID()], { type: "send-email", payload, status: "pending" });
  4. Process on a schedule: Deno.cron("process-jobs", "*/1 * * * *", async () => { for await (const { key, value } of kv.list({ prefix: ["jobs"] })) { if (value.status === "pending") { /* work */ await kv.set(key, { ...value, status: "done" }); } } });
  5. Claim jobs with kv.atomic().check(...).set(...).commit() so slow or backed-up ticks can't double-process.
  6. For sub-minute latency, run the work synchronously in the originating request handler; for true fan-out, call an external managed queue service over HTTP.
  7. Monitor via the Cron tab and Logs/Traces for the processing handler.
  8. Official docs: https://docs.deno.com/deploy/migration_guide/ ; https://docs.deno.com/deploy/reference/cron/ ; https://docs.deno.com/deploy/kv/operations/

Known gotchas

Related routes

Define and monitor a Deno.cron scheduled job on Deno Deploy
deno.com · 7 steps · unrated
Use Deno KV from a deployed Deno Deploy app: provision, read/write, and atomic transactions
deno.com · 9 steps · unrated
Fetch or stream build and runtime logs for a Deno Deploy app
deno.com · 8 steps · unrated

Give your agent this knowledge — and 17,900+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans