
Workflow
Wire up durable, restart-safe multi-step backend flows with Vercel Workflow DevKit instead of brittle in-memory orchestration.
Overview
Workflow is an agent skill most often used in Build (also Operate) that guides durable, resumable orchestration with Vercel’s Workflow DevKit and its bundled node_modules documentation.
Install
npx skills add https://github.com/vercel-labs/open-agents --skill workflowWhat is this skill?
- Instructs agents to read installed Workflow DevKit docs under node_modules/workflow/docs/ (getting-started, foundations,
- Covers durable workflows and steps that survive restarts, pause for external events, and retry on failure
- Documents client APIs for start, get-run, resume-hook, plus workflow APIs like sleep, create-hook, and fatal-error
- Includes framework setup paths for Next.js, Express, Hono, and related @workflow/ai durable AI patterns
- Emphasizes step-based orchestration over ad-hoc timers or fire-and-forget background jobs
- Skill metadata version 1.0
- Bundled docs paths: getting-started, foundations, api-reference/workflow, api-reference/workflow-api, ai, errors
- Related @workflow/ai docs under node_modules/@workflow/ai/docs/
Adoption & trust: 25 installs on skills.sh; 5.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need multi-step backend work that survives restarts and external delays, but one-off scripts and in-process queues lose state and are painful to resume.
Who is it for?
Solo builders shipping Node or Next APIs on Vercel who want checkpointed, hook-driven workflows with official DevKit docs driving the implementation.
Skip if: Static sites, single synchronous request handlers with no long waits, or teams unwilling to adopt the Workflow DevKit dependency and its Vercel-oriented runtime model.
When should I use this skill?
User mentions workflow, durable functions, resumable runs, Workflow DevKit, or step-based orchestration for multi-step operations over time.
What do I get? / Deliverables
Your agent implements Workflow DevKit patterns—steps, hooks, retries, and client run control—aligned with the installed docs so flows stay resumable after deploys and failures.
- Workflow and step functions following DevKit conventions
- Hook and client resume/start integration for long-running runs
- Implementation aligned with searched bundled MDX documentation
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Workflow DevKit is primarily adopted while implementing server-side orchestration—steps, hooks, retries, and external waits belong in the build phase’s backend layer. Subphase backend fits APIs and long-running processes that must coordinate steps, sleep, hooks, and failure semantics in application code.
Where it fits
Model an order pipeline as workflow steps with sleep and retries instead of a fragile queue worker.
Pause a run on create-hook until a Stripe webhook or human approval arrives, then resume-hook continues the flow.
Validate that deploys do not drop in-flight runs before go-live by exercising get-run and resume paths.
Trace fatal-error handling and retry policy when a step fails after an external provider outage.
Extend an existing workflow with a new step while keeping run history compatible with the bundled API reference.
How it compares
Use for durable step orchestration with hooks and run resume—not for lightweight cron scripts or generic CI pipeline YAML alone.
Common Questions / FAQ
Who is workflow for?
Indie and solo builders implementing backend or agent pipelines who need workflows that survive restarts, wait on external events, and retry failed steps with Vercel Workflow DevKit.
When should I use workflow?
During Build when designing APIs and step chains; during Operate when debugging stuck runs, hooks, or resume behavior; whenever you say durable functions, resumable, workflow devkit, or step-based orchestration.
Is workflow safe to install?
Treat it as procedural guidance that may steer file and network changes in your repo; review the Security Audits panel on this Prism page and inspect the skill source before granting agent permissions.
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 DevKit. 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.) - `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 DevKit.** ### Official Resources - **Website**: https://useworkflow.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"; // 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 ``` ## 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 automatic retry, results are persisted for replay, and no sandbox restrictions. ## Workflow Sandbox Limitations When you need logic directly in a workflow function (not in a step), these restrictions apply: | Limitation | Workaround | |------------|------------| | No `fetch()` | `import { fetch } from "workflow"` then `globalThis.fetch = fetch` | | No `setTimeout`/`setInterval` |