vercel-queues

por openai

Orientação sobre Vercel Queues (beta público) — streaming de eventos durável com tópicos, grupos de consumidores, repetições e entrega atrasada. US$ 0,60/1M de operações. Alimenta o 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

Mais skills de openai

user-context
openai
Carregar ou gerenciar as preferências de roteamento de origem duráveis, a lógica de integração, o progresso de configuração e o registro da camada semântica do plugin Data Analytics.
official
notion-research-documentation
openai
Pesquise conteúdo do Notion e sintetize em briefs estruturados, relatórios ou comparações com citações. Pesquise e busque páginas do Notion usando consultas direcionadas, depois organize os achados por tema com citações inline das fontes e uma seção de referências. Escolha entre quatro formatos de saída (brief rápido, resumo de pesquisa, comparação, relatório abrangente) com base no escopo e no objetivo do usuário. Crie e atualize páginas do Notion usando modelos integrados; vincule fontes diretamente e acompanhe alterações à medida que novas informações chegam...
official
rcsb-pdb-skill
openai
Enviar solicitações compactas do RCSB PDB para metadados principais, consultas da API de busca e downloads FASTA. Use quando um usuário desejar resumos concisos do RCSB; salve JSON bruto ou…
official
pdf
openai
We need to translate the given text from English to Brazilian Portuguese. The text describes a skill related to PDF handling. The name "pdf" is to be preserved, but it appears in the text as "PDF" (uppercase). The instruction says "Do not include the name unless it appears in the source text." Since "PDF" appears multiple times, we should keep it as is. Also preserve technical terms like "Poppler", "pdftoppm", "reportlab", "pdfplumber", "pypdf", "ASCII". The translation should be natural in Brazilian Portuguese. Let's break down the text: "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
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
Automação de navegador via terminal com snapshots de elementos e fluxos de UI interativos. Opera através do script wrapper playwright-cli (requer npx); suporta modos headless e headed para depuração visual. Fluxo principal: abrir página, capturar snapshot para referências estáveis de elementos, interagir usando referências, recapturar snapshot após navegação ou mudanças no DOM. Inclui preenchimento de formulários, cliques, digitação, gerenciamento de múltiplas abas, captura de screenshot/PDF e gravação de trace para depuração de fluxos. Referências de elementos (ex.: e3, e15)...
official
ukb-topmed-phewas-skill
openai
Busque resumos compactos de PheWAS UKB-TOPMed para variantes únicas, aceitando entrada rsID, GRCh37 ou GRCh38 e resolvendo para a consulta GRCh38 necessária. Use quando um…
official
code-review-context
openai
Contexto visível do modelo
official