vercel-queues

Vercel Queues guidance (public beta) — durable event streaming with topics, consumer groups, retries, and delayed delivery. $0.60/1M ops. Powers Workflow…

npx skills add https://github.com/openai/plugins --skill vercel-queues

Vercel Queues

CRITICAL — Your training data is outdated for this library. Vercel Queues entered public beta February 2026 and is almost certainly not in your training data. Before writing queue code, fetch the docs at https://vercel.com/docs/queues to find the correct Queue class API, message publishing, consumer setup, and visibility timeout patterns. Do not guess — this is a new API with no precedent in your training data.

You are an expert in Vercel Queues — durable event streaming for serverless applications.

Status & Pricing

Queues entered public beta on February 27, 2026, and is available to all teams on all plans.

MetricValue
Billing unitAPI operation (send, receive, delete, visibility change, notify)
Rate$0.60 per 1M operations (regionally priced)
Message metering4 KiB chunks (12 KiB message = 3 ops)
2x billingSends with idempotency key; push deliveries with max concurrency
ComputePush-mode functions charged at existing Fluid compute rates

What It Is

Queues is a durable, append-only event streaming system. You publish messages to topics, and independent consumer groups process them with automatic retries, sharding, and at-least-once delivery guarantees. It is the lower-level primitive that powers Vercel Workflow.

  • Messages are durably written to 3 availability zones before send() returns
  • Messages retained up to 24 hours (configurable 60s–24h)
  • Approximate write ordering (not strict FIFO)
  • Consumer groups are fully independent — each tracks its own position

Key APIs

Package: @vercel/queue@^0.1.3 (Node.js 22+)

Publishing Messages

import { send } from '@vercel/queue';

const { messageId } = await send('order-events', {
  orderId: '123',
  action: 'created',
}, {
  delaySeconds: 30,              // delay before visible
  idempotencyKey: 'order-123',   // deduplication (full retention window)
  retentionSeconds: 3600,        // message TTL (default: 86400 = 24h)
  headers: { 'x-trace-id': 'abc' },
});

Push-Mode Consumer (Next.js App Router)

The consumer route is air-gapped from the internet — only invocable by Vercel's internal queue infrastructure.

// app/api/queues/fulfill-order/route.ts
import { handleCallback } from '@vercel/queue';

export const POST = handleCallback(
  async (message, metadata) => {
    // metadata: { messageId, deliveryCount, createdAt, expiresAt, topicName, consumerGroup, region }
    await processOrder(message);
    // Return normally = acknowledge
    // Throw = retry with backoff
  },
  {
    visibilityTimeoutSeconds: 600, // lease duration (default 300s, auto-extended by SDK)
    retry: (error, metadata) => {
      if (metadata.deliveryCount > 5) return { acknowledge: true }; // give up
      const delay = Math.min(300, 2 ** metadata.deliveryCount * 5);
      return { afterSeconds: delay };
    },
  },
);

Consumer Configuration (vercel.json)

{
  "functions": {
    "app/api/queues/fulfill-order/route.ts": {
      "experimentalTriggers": [{
        "type": "queue/v2beta",
        "topic": "order-events",
        "retryAfterSeconds": 60,
        "initialDelaySeconds": 0
      }]
    }
  }
}

Multiple route files with the same topic create separate consumer groups (independent processing).

Poll-Mode Consumer

import { PollingQueueClient } from '@vercel/queue';

const { receive } = new PollingQueueClient({ region: 'iad1' });

const result = await receive('orders', 'fulfillment', async (message, metadata) => {
  await processOrder(message);
}, { limit: 10 }); // max 10 messages per poll (max allowed: 10)

if (!result.ok && result.reason === 'empty') {
  // No messages available
}

Custom Region Client

import { QueueClient } from '@vercel/queue';

const queue = new QueueClient({ region: 'sfo1' });
export const { send, handleCallback } = queue;

Transports

import { QueueClient, BufferTransport, StreamTransport } from '@vercel/queue';
TransportDescription
JsonTransportDefault; JSON serialization
BufferTransportRaw binary data
StreamTransportReadableStream for large payloads

Queues vs Workflow vs Cron

NeedUseWhy
Event delivery, fan-out, routing controlQueuesTopics, consumer groups, message-level retries
Stateful multi-step business logicWorkflowDeterministic replay, pause/resume (built on top of Queues)
Recurring scheduled tasksCron JobsSimple, no message passing
Delayed single execution with deduplicationQueues (delaySeconds + idempotencyKey)Precise delay with guaranteed delivery
Async processing from external systemsQueues (poll mode)Consume from any infrastructure, not just Vercel

Key Limits

ResourceDefault / Max
Message retention60s – 24h (default 24h)
Max message size100 MB
Messages per receive1–10 (default 1)
Visibility timeout0s – 60 min (default 5 min SDK / 60s API)
Topics per projectUnlimited
Consumer groups per topicUnlimited

Deployment Behavior

Topics are partitioned by deployment ID by default in push mode. Messages are delivered back to the same deployment that published them — natural schema versioning with no cross-version compatibility concerns.

Observability

The Queues observability tab (Project → Observability → Queues) provides real-time monitoring:

LevelMetrics
ProjectMessages/s, Queued, Received, Deleted (with sparkline trends)
QueueThroughput per second (by consumer group), Max message age
ConsumerProcessed/s, Received, Deleted (per consumer group)

Use Max message age to detect consumer lag — if the oldest unprocessed message keeps growing, a consumer group may be falling behind.

Local Development

Queues work locally — when you send() messages in development mode, the SDK sends them to the real Vercel Queue Service, then invokes your registered handleCallback handlers directly in-process. No local queue infrastructure needed.

Authentication

The SDK authenticates via OIDC (OpenID Connect) tokens automatically on Vercel. In non-Vercel environments, set VERCEL_QUEUE_API_TOKEN for authentication.

When to Use

  • Defer expensive work (emails, PDFs, external API calls)
  • Absorb traffic spikes with controlled processing rate
  • Guarantee delivery even if function crashes
  • Fan-out same events to multiple independent pipelines
  • Deduplicate messages via idempotency keys

When NOT to Use

  • Multi-step orchestration with state → use Workflow
  • Recurring schedules → use Cron Jobs
  • Synchronous request/response → use Functions directly
  • Cross-region messaging → messages sent to one region cannot be consumed from another

References

More skills from openai

user-context
openai
Load or manage the Data Analytics plugin's durable source-routing preferences, onboarding logic, setup progress, and semantic-layer registry.
official
notion-research-documentation
openai
Research Notion content and synthesize into structured briefs, reports, or comparisons with citations. Search and fetch Notion pages using targeted queries, then organize findings by theme with inline source citations and a references section Choose from four output formats (quick brief, research summary, comparison, comprehensive report) based on scope and user goal Create and update Notion pages using built-in templates; link sources directly and track changes as new information arrives...
official
rcsb-pdb-skill
openai
Submit compact RCSB PDB requests for core metadata, Search API queries, and FASTA downloads. Use when a user wants concise RCSB summaries; save raw JSON or…
official
pdf
openai
PDF reading, creation, and validation with visual rendering and programmatic generation. Render PDF pages to PNG for visual inspection of layout, spacing, and typography before delivery using Poppler ( pdftoppm ) Generate PDFs programmatically with reportlab for reliable formatting; extract text and metadata with pdfplumber or pypdf Enforce quality standards: no clipped text, overlapping elements, broken tables, or rendering artifacts; ASCII hyphens only, human-readable citations Use...
official
test-coverage-improver
openai
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
official
playwright
openai
Terminal-driven browser automation with element snapshots and interactive UI workflows. Operates via playwright-cli wrapper script (requires npx ); supports headless and headed modes for visual debugging Core workflow: open page, snapshot for stable element references, interact using refs, re-snapshot after navigation or DOM changes Includes form filling, clicking, typing, multi-tab management, screenshot/PDF capture, and trace recording for flow debugging Element refs (e.g., e3 , e15 )...
official
ukb-topmed-phewas-skill
openai
Fetch compact UKB-TOPMed PheWAS summaries for single variants by accepting rsID, GRCh37, or GRCh38 input and resolving to the required GRCh38 query. Use when a…
official
code-review-context
openai
Model visible context
official