Agent skill · vercel

migrating-workflow-v4-to-v5

Upgrades an app from Workflow SDK 4.x to 5.0. Use when bumping the `workflow` / `@workflow/*` dependencies to v5, or when hitting removed v4 APIs — `runStep`, `stepEntrypoint`, `workflow/internal/private`, `@workflow/core/private`, `writeToStream` / `closeStream` / `readFromStream` on a World, `world.steps.get` without a runId, `hook.getConflict()` returning `{ runId }`, `hook.metadata` read synchronously off a `getHookByToken()` result, `experimental_setAttributes`, `createLocalWorld` / `createVercelWorld`, `NestLocalBuilder` imported from `@workflow/nest`, or an SWC transform invoked with `mode: 'client'`.

What it needs

About 12k tokens when loaded.

What this skill does

Migrating Workflow SDK 4.x to 5.0 Workflow SDK 5.0 keeps the programming model from 4.x. "use workflow" / "use step", start(), getRun(), hooks, webhooks, streams, sleep(), retries, and the event log are unchanged, so most application code compiles as-is. The breaking changes are concentrated in three places: 1. Runtime entrypoints (workflow/api, workflow/runtime) — two exports removed. 2. The World interface — only relevant if the app implements a custom World or calls getWorld() directly. 3. Build integrations — @workflow/nest subpaths, and private compiler subpaths that were never public. Do not rewrite workflow or step bodies. If you find yourself restructuring business logic, you have gone outside this migration. Intake Before editing, establish: 1. Which packages are installed. Read package.json for workflow and every @workflow/ dependency. 2. Whether the app touches the runtime. Grep for getWorld, createWorld, getWorldHandlers, writeToStream, readFromStream, closeStream, listStreamsByRunId, getStreamChunks, world.steps, listByCorrelationId, runStep, stepEntrypoint, internal/private, core/private. 3. Whether the app implements a custom World. Grep for implements World, : World, createLocalWorld, createVercelWorld, startWorkflowWorld. 4. Which framework integration is in use. @workflow/next, @workflow/nest, @workflow/nitro, @workflow/sveltekit, @workflow/vite, @workflow/nuxt, @workflow/astro, or the CLI. 5. Whether hook.getConflict() is used. Grep for getConflict. 6. Whether hook metadata is read outside a workflow. Grep for getHookByToken and resumeHook, then for .metadata on their results. 7. Whether the app calls the compiler directly. Grep for mode: 'client', transformSync, swc-plugin-workflow. Only custom build integrations do this. 8. Whether experimentalsetAttributes is used. Grep for experimentalsetAttributes. Report anything in 2–8 that the app does not use as "not applicable" rather than silently skipping it. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills vercel/migrating-workflow-v4-to-v5

View the source on GitHub

Browse the @skills marketplace