
Workflow
Implement durable, resumable multi-step backends on Vercel with the Workflow SDK—retries, hooks, queues, and events that survive restarts.
Overview
workflow is an agent skill most often used in Build (also Ship perf, Operate monitoring) that implements Vercel Workflow SDK durable, resumable step orchestration using the installed package documentation.
Install
npx skills add https://github.com/vercel/workflow --skill workflowWhat is this skill?
- Mandatory pattern: read installed docs from node_modules/workflow/docs/ via glob and grep—do not rely on stale model kno
- Covers durable workflows, steps, hooks, streaming, sleep, fatal errors, and World SDK (runs, steps, events, queue, obser
- Framework setup paths for Next.js, Express, Hono, and related getting-started guides
- Client APIs for start, get-run, resume-hook, and event-driven pause/resume
- Triggers on workflow, durable functions, resumable, workflow sdk, queue, subscribe, and step orchestration
- Documentation bundle organized across getting-started, foundations, api-reference, ai, and world/ paths per SKILL.md
Adoption & trust: 2.6k installs on skills.sh; 2.1k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your multi-step server logic breaks on restarts, cannot wait for external events safely, or you are guessing Workflow SDK APIs from outdated training data.
Who is it for?
Indie SaaS and API builders on Vercel who need event-driven or long-running backend flows without running their own job runner.
Skip if: Static sites, one-shot CRUD with no async coordination, or teams not deploying on Vercel-compatible Workflow SDK stacks.
When should I use this skill?
Building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations; or when the user mentions workflow, durable functions, resumable, workflow sdk, queue, e
What do I get? / Deliverables
You implement workflows aligned with the installed SDK docs—steps, hooks, retries, and client run control—ready to deploy on your Vercel framework target.
- Workflow and step definitions wired to SDK APIs
- Hook, queue, or event handlers per installed documentation
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Workflow SDK work lands in Build when you wire orchestration into your app backend, even though the same patterns matter at Ship perf and Operate monitoring. Backend subphase matches step-based orchestration, hooks, sleeps, and client APIs for long-running server logic.
Where it fits
Model an onboarding pipeline with sleep and resume-hook waiting for Stripe webhook confirmation.
Subscribe to external events and push results through a workflow stream to the UI.
Add retries and fatal-error handling so failed steps do not poison the whole run.
Use World SDK observability docs to inspect run history and queue depth after deploy.
How it compares
Skill package for Vercel-native durable orchestration—not a generic CRON snippet or a third-party queue MCP unless you explicitly choose that stack.
Common Questions / FAQ
Who is workflow for?
Developers using Claude Code, Cursor, or Codex to add resumable Vercel Workflow SDK pipelines to Next.js, Express, Hono, or similar apps.
When should I use workflow?
In Build backend when adding step-based jobs; at Ship when fixing retry and resume behavior; in Operate when tracing runs, hooks, and queue backlog via World observability docs.
Is workflow safe to install?
The skill drives filesystem search and app code changes; review the Security Audits panel on this Prism page and pin workflow package versions in your repo.
SKILL.md
READMESKILL.md - Workflow
## *CRITICAL*: Always Use Correct `workflow` Documentation Your knowledge of `workflow` is outdated. The `workflow` documentation outlined below matches the installed version of the Workflow SDK. Follow these instructions before starting on any `workflow`-related tasks: Search the bundled documentation in `node_modules/workflow/docs/`: 1. **Find docs**: `glob "node_modules/workflow/docs/**/*.mdx"` 2. **Search content**: `grep "your query" node_modules/workflow/docs/` Documentation structure in `node_modules/workflow/docs/`: - `getting-started/` - Framework setup (next.mdx, express.mdx, hono.mdx, etc.) - `foundations/` - Core concepts (workflows-and-steps.mdx, hooks.mdx, streaming.mdx, etc.) - `api-reference/workflow/` - API docs (sleep.mdx, create-hook.mdx, fatal-error.mdx, etc.) - `api-reference/workflow-api/` - Client API (start.mdx, get-run.mdx, resume-hook.mdx, etc.) - `api-reference/workflow-api/world/` - World SDK (runs.mdx, steps.mdx, hooks.mdx, events.mdx, streams.mdx, queue.mdx, observability.mdx) - `ai/` - AI SDK integration docs - `errors/` - Error code documentation Related packages also include bundled docs: - `@workflow/ai`: `node_modules/@workflow/ai/docs/` - DurableAgent and AI integration - `@workflow/core`: `node_modules/@workflow/core/docs/` - Core runtime (foundations, how-it-works) - `@workflow/next`: `node_modules/@workflow/next/docs/` - Next.js integration **When in doubt, update to the latest version of the Workflow SDK.** ### Official Resources - **Website**: https://workflow-sdk.dev - **GitHub**: https://github.com/vercel/workflow ### Quick Reference **Directives:** ```typescript "use workflow"; // First line - makes async function durable "use step"; // First line - makes function a cached, retryable unit ``` **Essential imports:** ```typescript // Workflow primitives import { sleep, fetch, createHook, createWebhook, getWritable } from "workflow"; import { FatalError, RetryableError } from "workflow"; import { getWorkflowMetadata, getStepMetadata } from "workflow"; // API operations import { start, getRun, resumeHook, resumeWebhook } from "workflow/api"; // Observability & data hydration import { hydrateResourceIO, observabilityRevivers, parseStepName, parseWorkflowName } from "workflow/observability"; // Framework integrations import { withWorkflow } from "workflow/next"; import { workflow } from "workflow/vite"; import { workflow } from "workflow/astro"; // Or use modules: ["workflow/nitro"] for Nitro/Nuxt // AI agent import { DurableAgent } from "@workflow/ai/agent"; ``` ## Prefer Step Functions to Avoid Sandbox Errors `"use workflow"` functions run in a sandboxed VM. `"use step"` functions have **full Node.js access**. Put your logic in steps and use the workflow function purely for orchestration. ```typescript // Steps have full Node.js and npm access async function fetchUserData(userId: string) { "use step"; const response = await fetch(`https://api.example.com/users/${userId}`); return response.json(); } async function processWithAI(data: any) { "use step"; // AI SDK works in steps without workarounds return await generateText({ model: openai("gpt-4"), prompt: `Process: ${JSON.stringify(data)}`, }); } // Workflow orchestrates steps - no sandbox issues export async function dataProcessingWorkflow(userId: string) { "use workflow"; const data = await fetchUserData(userId); const processed = await processWithAI(data); return { success: true, processed }; } ``` **Benefits:** Steps have aut