Queues

Background jobs with retries built in

Process background jobs reliably. Send a message from a request handler, a cron run, or a workflow step, and a message handler in the same worker picks it up. Failed messages retry with exponential backoff, and every message is visible in the dashboard.

Queue Dashboard

Pending

42

Processing

3

Acknowledged

15,847

Failed

12

Dead Letter

2

Recent Messages

Latest messages in this queue (auto-refreshes every 5 seconds)

IDStatusPayloadAttemptCreated
msg_a1b2c3d4...
Acknowledged
{"type":"email","to":"user@example.com"}1
UTC ISO
2024-01-15T10:30:00.000Z
Local Time
Jan 15, 2024, 10:30 AM UTC
msg_e5f6g7h8...
Processing
{"type":"webhook","url":"https://api.example.com"}1
UTC ISO
2024-01-15T10:29:55.000Z
Local Time
Jan 15, 2024, 10:29 AM UTC
msg_i9j0k1l2...
Pending
{"type":"image","action":"resize"}0
UTC ISO
2024-01-15T10:29:50.000Z
Local Time
Jan 15, 2024, 10:29 AM UTC
msg_m3n4o5p6...
Failed
{"type":"notification","userId":123}3
UTC ISO
2024-01-15T10:25:00.000Z
Local Time
Jan 15, 2024, 10:25 AM UTC
msg_q7r8s9t0...
Dead Letter
{"type":"sync","source":"external"}5
UTC ISO
2024-01-15T09:00:00.000Z
Local Time
Jan 15, 2024, 9:00 AM UTC

Key Features

Automatic Retries

Messages that throw are retried with exponential backoff, and the attempt number is passed to your handler.

Message Inspection

View payloads, attempts, and status for every message in the dashboard.

Failure Visibility

Messages that exhaust their attempts are kept so you can see what went wrong.

Same Worker, Same Env

The message handler lives next to your fetch handler and uses the same database and storage bindings.

Queue Consumer

Send and process queue messages in your worker.

src/index.ts
export default {
  async fetch(request, env) {
    await env.TASKS.send({
      task: "send-email",
      to: "user@example.com",
    });
    return Response.json({ queued: true });
  },

  async message(event) {
    console.log("Processing:", event.payload, event.attempt);
  },
} satisfies Ploy;

Ready to get started?

Deploy your first project in minutes with Ploy.