npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@workflow/world-vercel

v5.8.0

Published

Vercel platform World implementation for Workflow SDK

Readme

@workflow/world-vercel

Resolved hook resumes use /api/v4/runs/:runId/events/hook_received/resolved. This HTTP-only endpoint requires atomic resume deduplication, including when the normal event transport uses WebSockets. Older servers and the dedup kill switch reject before writing. Definite 400/404 refusals are preserved so core can look up the token and fall back to ordinary delivery. The adapter retries 429 and explicit 503 run-spec-version-changed / start-hook-run-pending admission refusals, using the same resume identity and bounded wait budgets. It never re-sends after an uncertain transport failure: a lost response must not become a safe-looking rejection after a backend rollback.

Core traces expose workflow.hook.resume_route (lookup, resolved, or resolved_fallback) and workflow.hook.resolved_refusal_status on fallback.

Production workflow backend for Vercel platform deployments.

Integrates with Vercel's infrastructure for storage, queuing, and authentication. Handles workflow persistence and scaling in production environments.

Used by default for deployments on Vercel. Authentication and API endpoints are configured automatically in Vercel deployments.

Concurrent hook registrations

Concurrent independent hook registrations use the existing single-event requests. The Node.js runtime defers per-request history catch-up and reconciles the committed events after all requests settle. The adapter supplies an optional eventCursor in Vercel's cursor format and honors resolved hook metadata for this path. A consecutive suffix needs no history read; missing or intervening events retain the normal reload before continuation. No server upgrade or batch registration endpoint is required.

The runtime applies this optimization only to hooks-only suspensions whose registrations are all independent. Mixed suspensions, forced claims, and same-token lifecycle operations keep the normal catch-up path without resolving metadata for unused mutation responses. Runtime spans record workflow.concurrent_hooks.carried_forward and, on fallback, workflow.concurrent_hooks.fallback_reason; debug logs include the same outcome.

Connection failures

Backend connection failures and interrupted event streams follow existing retry policies, including failures with unrecognized error codes. Repeated HTTP/2 session failures rebuild the shared events connection pool. Invalid backend URL protocols, embedded credentials, Fetch-blocked ports, and unsupported request headers fail immediately. Interrupted event writes retain their existing in-process retries; caller cancellations are excluded.

See Backend connection failures for retry behavior and diagnostics.

Events channel

Event writes go over a per-run WebSocket (the default WORKFLOW_EVENTS_TRANSPORT; with http, only for the workflows listed in WORKFLOW_EVENTS_TRANSPORT_WS_OVERRIDE_WORKFLOWS) only while that run's channel is open. The queue handler opens it for each delivery, so workflows need nothing extra. Code that writes a run's events outside a delivery (a custom driver, a long-lived process) opens and releases it itself; otherwise those writes go over HTTP:

import { createWorld, openEventsChannel } from '@workflow/world-vercel';

const world = createWorld();
const release = openEventsChannel(runId);
try {
  await world.events.create(runId, event);
} finally {
  release?.();
}

It returns undefined, and writes stay on HTTP, when the transport is disabled or the World cannot hold a socket (a projectConfig World, as the CLI uses).

Stream writer sockets

Stream writes upgrade to a WebSocket by default; set WORKFLOW_STREAMS_TRANSPORT=http to keep them on HTTP. A writer's first two write groups go over HTTP while the socket opens in the background, and a writer whose upgrade the server declines stays on HTTP.

Releasing a writer after its writes drain retires its socket without closing the shared stream. Reacquiring that handle continues over HTTP; a new step's writer can upgrade independently. Released writers do not keep idle WebSockets or reconnect them in the background.

Step-local getWritable() handles release their transport at step completion, not between acquire/write/release cycles within the step. External Run#getWritable() handles release it on the first observed unlock after pending writes drain; subsequent writes through that same handle stay on HTTP. To retain WebSocket transport across an external streaming burst, hold the writer lock until the burst finishes. Call releaseLock() when finished contributing, not close(), unless you intend to close the shared stream.

Custom dispatcher

HTTP requests (including the queue) use shared undici dispatchers for connection pooling. Pass a custom dispatcher to override them, for example, to tune undici on newer Node.js runtimes:

import { Agent } from 'undici';
import { createWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createWorld({ dispatcher: new Agent({ connections: 16 }) }));

Caller user agent

Pass a User-Agent header to append a caller-specific product token while preserving the world-vercel token:

import { createWorld } from '@workflow/world-vercel';

const world = createWorld({
  headers: { 'User-Agent': 'my-framework/1.2.3' },
});