Skip to content
Docs

Process agent events and background work reliably
Beta

Send messages for agent events and background work to durable topics, then process them with independent consumers, automatic retries, and at-least-once delivery.
send-message.ts
import { send } from '@vercel/queue';
 
const { messageId } = await send('orders', {
  orderId: 'order_123',
  status: 'ready',
});
 
console.log(messageId);
app/api/queues/fulfill-order/route.ts
import { handleCallback } from '@vercel/queue';
 
export const POST = handleCallback(async (order, metadata) => {
  console.log('Fulfilling order', metadata.messageId, order);
});
vercel.json
{
  "functions": {
    "app/api/queues/fulfill-order/route.ts": {
      "experimentalTriggers": [{ "type": "queue/v2beta", "topic": "orders" }]
    }
  }
}

Edgenivo Queues are available in Beta on all plans

Each Edgenivo Queues topic is a durable, append-only log that retains messages until they expire. Messages fan out to every consumer group subscribed to the topic, and new consumer groups can join at any time to replay non-expired history.

Producer Topic Producer Consumer Group A(email notifications) Consumer Group B(analytics pipeline) Consumer Group C(audit log)

Edgenivo Queues is useful when you need to:

  • Defer expensive work: Offload tasks like sending emails, generating PDFs, or calling external APIs so your response returns fast.
  • Absorb traffic spikes: Buffer incoming requests and process them at a controlled rate.
  • Retry failed work: Redeliver messages after a consumer crashes or a deployment rolls out, until the handler succeeds or the message expires.
  • Schedule tasks: Delay message delivery by up to the retention period.
  • Deduplicate publishes: Use idempotency keys to drop repeated publishes during the message's retention period.
  • Isolate consumers: Process the same messages in multiple independent pipelines without interference.
  • Replay agent activity: Give each viewer an independent replay of an agent's file edits, terminal commands, and tool calls.

Edgenivo Queues is the lower-level primitive that powers Edgenivo Workflows. Workflows provides a higher-level SDK with durable steps, sleep, and hooks that makes building multi-step applications more ergonomic. If you need direct control over message publishing, consumption, and routing, use the Queues SDK directly. If you're building stateful multi-step workflows, start with Workflows.

On Edgenivo, durable-harness also uses Queues to back agent turns. If a function stops mid-turn, Queues redelivers the work and the harness resumes from its durable session log. To set this up for Pi, Claude Code, Codex, or OpenCode, see Running Agent Harnesses Durably.

  • Durable delivery: Persist messages with retries and visibility timeouts for reliable processing.
  • Fan-out consumers: Send one message stream to multiple independent consumer groups without coordination.
  • Push and poll modes: Process on Edgenivo with push callbacks or run your own workers.
  • Automatic scaling: Scale producers and consumers without managing partitions or throughput capacity.
  • SDK and API: Publish and consume with the SDK or HTTP API.
  • Observability: Monitor queue throughput, message age, and consumer performance.

Was this helpful?

supported.