queues
Vercel Queues enables agents to publish JSON messages to durable topics using @vercel/queue (JavaScript) or vercel-queue (Python), with consumer functions…
Identity proven by GitHub's verified organisation badge (vercel, vercel-labs)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- Apache-2.0 (permissive)
- Pin
- 2a1e58dpinned Oct 9, 2026
- Context cost
- about 1,600 tokenswhen the skill loads
- GitHub stars
- 300on vercel/vercel-plugin
- Scripts
- None found
What it does
“Vercel Queues guidance — durable topics with at-least-once delivery, independent consumer groups, retries, delays, and idempotency keys via @vercel/queue (JS) or vercel-queue (Python). Use when deferring background work, buffering traffic, fanning out events, or choosing between Queues and Workflows.”
Generated summary from the skill's own text
Vercel Queues enables agents to publish JSON messages to durable topics using @vercel/queue (JavaScript) or vercel-queue (Python), with consumer functions automatically invoked by Vercel to process messages. It provides at-least-once delivery with automatic retries, independent consumer groups, and configurable retention, making it suitable for deferring background work, buffering traffic, and fanning out events.
When to use it
- Deferring background jobs or one-off tasks to run asynchronously
- Processing events across multiple independent consumer groups
- Buffering traffic spikes or fan-out messaging patterns
- Handling retries and delays for fault-tolerant message delivery
When not to
- Building multi-step workflows with sleep, hooks, or human approval steps
- Handling scheduled time-based invocations like cron jobs
- Working with non-JSON payloads without configuring custom transports
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add vercel/vercel-plugin --skill queuesInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install vercel/vercel-plugin queues@2a1e58dfb63c064c2589c0c21b3e93c53728f8d5Installs the commit we checked (2a1e58d).
Copy by hand
Download the folder at 2a1e58d and put it in .claude/skills/queues for Claude Code and in .agents/skills/queues for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install vercel@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "queues" by Vercel. Source, pinned to commit 2a1e58dfb63c064c2589c0c21b3e93c53728f8d5: https://github.com/vercel/vercel-plugin/tree/2a1e58dfb63c064c2589c0c21b3e93c53728f8d5/skills/queues 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/queues/ for Claude Code and .agents/skills/queues/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/vercel/queues
SKILL.md at the pin
---
name: queues
description: Vercel Queues guidance — durable topics with at-least-once delivery, independent consumer groups, retries, delays, and idempotency keys via @vercel/queue (JS) or vercel-queue (Python). Use when deferring background work, buffering traffic, fanning out events, or choosing between Queues and Workflows.
summary: "Vercel Queues (beta) publishes JSON messages to durable topics with `send()` from `@vercel/queue`; consumers are Vercel Functions exported with `handleCallback()` and registered in vercel.json under `functions.<path>.experimentalTriggers` as `{ type: 'queue/v2beta', topic: '<name>' }`. Delivery is at-least-once with automatic retries; use Workflows instead for multi-step durable logic."
metadata:
priority: 6
docs:
- "https://vercel.com/docs/queues"
- "https://vercel.com/docs/queues/sdk"
sitemap: "https://vercel.com/sitemap.xml"
pathPatterns:
- 'app/api/queues/**'
- 'src/app/api/queues/**'
- 'pages/api/queues/**'
- 'lib/queue.*'
- 'src/lib/queue.*'
- 'lib/queues/**'
- 'src/lib/queues/**'
bashPatterns:
- '\bnpm\s+(install|i|add)\s+[^\n]*@vercel/queue\b'
- '\bpnpm\s+(install|i|add)\s+[^\n]*@vercel/queue\b'
- '\bbun\s+(install|i|add)\s+[^\n]*@vercel/queue\b'
- '\byarn\s+add\s+[^\n]*@vercel/queue\b'
- '\b(pip|uv)\s+(install|add)\s+[^\n]*vercel-queue\b'
importPatterns:
- "@vercel/queue"
promptSignals:
phrases:
- "vercel queues"
- "@vercel/queue"
- "background job"
- "background jobs"
- "message queue"
- "job queue"
- "consumer group"
allOf:
- [vercel, queues]
- [queue, topic]
- [queue, consumer]
- [queue, buffer]
- [fan, out]
anyOf:
- "queue"
- "topic"
- "retry"
- "consumer"
- "buffer"
- "background"
noneOf:
- "build queue"
- "deployment queue"
- "queued deployment"
- "deployments stuck"
- "queues up deployments"
- "queue up deployments"
- "queues my deployments"
- "queues our deployments"
- "queues your deployments"
- "queues the deployments"
- "queues deployments"
- "queues builds"
- "queues my builds"
minScore: 6
retrieval:
aliases:
- queues
- message queue
- background jobs
- event streaming
- pub sub
intents:
- defer work to a queue
- process background jobs
- fan out events to consumers
- retry failed jobs
- buffer traffic spikes
entities:
- Vercel Queues
- "@vercel/queue"
- topic
- consumer group
- handleCallback
- experimentalTriggers
chainTo:
-
pattern: '"use workflow"|"use step"|from\s+[''"]workflow[''"]'
targetSkill: workflow
message: 'Workflow SDK code alongside Queues — Workflows is built on Queues and adds durable steps, sleep, and hooks. Loading Workflow guidance.'
-
pattern: 'from\s+[''"](bullmq|bull|bee-queue|agenda)[''"]|@aws-sdk/client-sqs'
targetSkill: queues
message: 'Third-party job queue detected — Vercel Queues provides durable topics with retries and fan-out without running a broker. Loading Queues guidance.'
skipIfFileContains: '@vercel/queue'
---
# Vercel Queues
You are an expert in Vercel Queues, the durable message topics that power background work and agent events on Vercel.
## What It Is
Vercel Queues (public beta) gives you durable, append-only topics. Producers publish JSON messages, and every subscribed consumer group receives every message with at-least-once delivery and automatic retries. New consumer groups can join later and replay non-expired history. Queues is the primitive under Vercel Workflows; use Queues directly when you need control over publishing, consumption, and routing.
- **Topic**: a named durable log of messages, created on first publish
- **Consumer group**: an independent subscriber that receives every message on a topic
- **Delivery**: at-least-once; handlers must be idempotent
- **Retention**: 24 hours by default, up to 7 days; delivery can be delayed up to the retention period
- **Modes**: push (Vercel invokes your function) or poll (your own workers pull messages from any environment)
## Choose Queues or Workflows
| Need | Use | Why |
|------|-----|-----|
| Fire-and-forget background job, fan-out, buffering | **Queues** | Direct publish/consume, independent consumer groups |
| Multi-step logic with sleep, hooks, or human approval | **Workflows** (`⤳ skill: workflow`) | Durable steps and replay built on top of Queues |
| Scheduled invocation on a cron | Cron Jobs (`⤳ skill: vercel-functions`) | Time-based trigger, not message-based |
## Quickstart (Next.js App Router)
Install the SDK:
```bash
npm install @vercel/queue
```
Publish from any route, Server Action, or function:
```ts
// app/api/orders/route.ts
import { send } from '@vercel/queue';
export async function POST(request: Request) {
const body = await request.json();
const { messageId } = await send('orders', { orderId: body.orderId, action: 'process' });
return Response.json({ messageId });
}
```
Consume with a push-mode handler. Messages are acknowledged when the handler returns and retried when it throws:
```ts
// app/api/queues/process-order/route.ts
import { handleCallback } from '@vercel/queue';
export const POST = handleCallback(async (message, metadata) => {
await processOrder(message);
console.log('processed', metadata.messageId, 'delivery', metadata.deliveryCount);
});
```
Register the consumer in `vercel.json` (or `vercel.ts`) so Vercel routes the topic to that function:
```json filename="vercel.json"
{
"functions": {
"app/api/queues/process-order/route.ts": {
"experimentalTriggers": [{ "type": "queue/v2beta", "topic": "orders" }]
}
}
}
```
Run `vercel link` and `vercel env pull` before local development so the SDK can authenticate.
## Send Options
```ts
await send('orders', payload, {
region: 'sfo1', // target a specific region
retentionSeconds: 3600, // message TTL; min 60, max 604800 (7 days); default 24 hours
delaySeconds: 60, // delay first delivery; max 7 days, capped at the TTL
idempotencyKey: 'order-123', // duplicates within min(retention, 24 hours) are dropped
headers: { 'x-trace-id': 'abc-123' },
});
```
Create a `QueueClient` when you need defaults, a fixed region, or multiple clients:
```ts
// lib/queue.ts
import { QueueClient } from '@vercel/queue';
const queue = new QueueClient({ region: 'sfo1' });
export const { send, handleCallback } = queue;
```
## Consumer Options and Retries
`handleCallback(handler, options)` accepts:
| Option | Default | Notes |
|--------|---------|-------|
| `visibilityTimeoutSeconds` | 300 | How long a message stays in flight; the SDK re-extends the lease while the handler runs |
| `retry` | trigger `retryAfterSeconds` (60s) | `(error, metadata) => { afterSeconds } \| { acknowledge: true } \| undefined` |
Handle poison messages by acknowledging after a delivery-count threshold:
```ts
export const POST = handleCallback(processOrder, {
retry: (error, metadata) => {
if (metadata.deliveryCount > 5) return { acknowledge: true }; // stop retrying
return { afterSeconds: Math.min(300, 2 ** metadata.deliveryCount * 5) };
},
});
```
`metadata` includes `messageId`, `deliveryCount`, `createdAt`, `expiresAt`, `topicName`, `consumerGroup`, and `region`.
For Express, Connect, or Next.js Pages Router handlers use `queue.handleNodeCallback(async (message, metadata) => ...)` from a `QueueClient` instance, which takes `(req, res)`.
## Other Runtimes and Frameworks
- **Python**: `vercel-queue` publishes and consumes with the same topic model, and FastAPI, Flask, and Django apps can use it; Celery and Dramatiq integrations are documented under the Python backend frameworks.
- **Nitro / Nuxt**: declare `vercel.queues.triggers` in `nitro.config.ts` and handle messages with the `vercel:queue` runtime hook; `send` from `@vercel/queue` works in any server route.
- **Poll mode**: pull messages from your own workers in any environment when push delivery to a Vercel Function does not fit.
- **Payloads**: JSON by default; use `BufferTransport` for binary or `StreamTransport` for large bodies when constructing a `QueueClient`.
## Errors
`@vercel/queue` exports typed errors: `UnauthorizedError`, `BadRequestError`, `MessageNotFoundError`, and `QueueEmptyError`. Duplicate idempotency keys do not throw; the duplicate is silently dropped.
## Common Pitfalls
1. **Missing trigger**: a `handleCallback` route with no `experimentalTriggers` entry never receives messages. Register every consumer in `vercel.json`/`vercel.ts`.
2. **Non-idempotent handlers**: delivery is at-least-once. Key side effects on `metadata.messageId` or your own `idempotencyKey`.
3. **Retrying forever**: without a `retry` policy that acknowledges poison messages or a trigger `maxDeliveries` cap, a permanently failing message is redelivered until it expires.
4. **Using Queues for multi-step logic**: if you need sleep, hooks, or approvals between steps, use Workflows instead of chaining topics by hand.
5. **Local dev without credentials**: run `vercel link` and `vercel env pull` first; otherwise `send()` throws `Failed to get OIDC token for local development`.
## References
- 📖 docs: https://vercel.com/docs/queues
- 📖 JS SDK: https://vercel.com/docs/queues/sdk
- 📖 Python SDK: https://vercel.com/docs/queues/python-sdk
- 📖 poll mode: https://vercel.com/docs/queues/poll-mode
- 📖 pricing and limits: https://vercel.com/docs/queues/pricing
From vercel/vercel-plugin at 2a1e58d, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 2a1e58dFiles
- SKILL.md9.7 KB · 38ad06c8c978
- .vercel.approvers22 B · 9989f04e3c14
2 files, 9.7 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 2a1e58dMore from Vercel
next-bundle-optimizer
Audits Next.js applications to identify and reduce browser bundle size and initial-load work by analyzing routes, dependencies and client outputs.
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
next-cache-components-optimizer
Optimize Next.js routes to display meaningful UI instantly on initial load or client navigation by encoding the optimization goal as a failing…
Claude Code, Codex, Cursor +4 · about 5.6K tokens · pinned 6 days ago
next-partial-prefetching-adoption
Enables Partial Prefetching in Next.js 16.3+ apps and guides adoption through auditing Link prefetch behavior, preserving UI in tests or manually, and…
Claude Code, Codex, Cursor +4 · about 6.7K tokens · pinned 6 days ago
next-partial-prefetching-optimizer
This skill optimizes Next.js client-side navigation under Partial Prefetching by defining what UI loads before and after a click.
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago
apple
This skill emulates Apple's OAuth and OIDC services for local development and testing.
Claude Code, Codex, Cursor +4 · about 1.9K tokens · pinned 6 days ago
aws
This skill emulates AWS cloud services locally, providing S3 bucket and object operations, SQS message queues, IAM user and role management, and STS assume…
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago
Related in Backend and APIs
auth
This skill guides implementing user authentication in Next.js applications using Clerk, Better Auth, Descope, Auth0, or Vercel's own identity primitives like…
by VercelOfficial publisher
Claude Code, Codex, Cursor +3 · about 5K tokens · pinned 6 days ago
flags-sdk
The Flags SDK is a feature flags toolkit for Next.js and SvelteKit that declares flags as functions and evaluates them server-side.
by VercelOfficial publisher
Claude Code, Codex, Cursor +3 · about 5.8K tokens · pinned 6 days ago
vercel-connect
Vercel Connect lets applications obtain short-lived scoped credentials from third-party services like Slack, GitHub, and Linear without storing API keys in…
by VercelOfficial publisher
Claude Code, Codex, Cursor +3 · about 4.4K tokens · pinned 6 days ago
upstash-ratelimit-js
This skill adds rate limiting to serverless and edge applications using the Upstash Rate Limit TypeScript SDK backed by Upstash Redis.
by upstashCommunity
Claude Code, Codex, Cursor +4 · about 250 tokens · pinned 6 days ago
supabase
This skill enables the agent to work with Supabase products including Database, Auth, Edge Functions, Realtime, Storage, and Vectors.
by SupabaseOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago
speech-engine
This skill integrates ElevenLabs Speech Engine to add real-time voice conversations to custom agent runtimes.
by ElevenLabsOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago
Open roles at Vercel
5 of 11 open roles on the jobs board
- Software Engineer - Data Platform
Remote (United States) (Remote)
- Software Engineer, CDN
San Francisco, California, United States; New York City, New York, United States (Hybrid)
- Software Engineer, Trust & Safety
San Francisco, California, United States; New York City, New York, United States (Hybrid)
- Solutions Architect
San Francisco, New York City, Austin, United States (Hybrid)
- Software Engineer, Compute
London, UK (Hybrid)