Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
vercel-labs avatar

Workflow

  • 58 installs
  • 5.8k repo stars
  • Updated July 15, 2026
  • vercel-labs/open-agents

workflow is an agent skill for building durable resumable workflows with Vercel Workflow DevKit use workflow and use step directives.

About

The workflow skill creates durable, resumable workflows using Vercel Workflow DevKit that survive restarts, pause for external events, retry on failure, and coordinate multi-step operations over time. Agents must read bundled docs in node_modules/workflow/docs before coding because installed API shapes differ from outdated training data. Core directives are use workflow on orchestration functions and use step on cached retryable units with full Node.js access. The skill recommends putting logic in steps and keeping workflow functions as thin orchestrators to avoid sandbox limits on fetch, setTimeout, and Node modules. Error handling uses FatalError for permanent failures and RetryableError with retryAfter for transient ones. Serialization rules require plain data only, not functions or class instances. Streaming uses getWritable in step functions with lock release. Framework integrations cover Next.js withWorkflow, Vite, Astro, and Nitro modules. Debugging commands include npx workflow health, npx workflow web dashboard, and npx workflow inspect runs. Triggers include workflow, durable functions, resumable, or workflow devkit mentions.

  • Requires reading node_modules/workflow/docs before any workflow implementation.
  • Separates sandboxed use workflow orchestration from full Node.js use step units.
  • Documents FatalError versus RetryableError patterns with retryAfter support.
  • Lists serialization constraints and getWritable streaming in step functions.
  • Covers Next.js, Vite, Astro integrations plus health and inspect CLI debugging.

Workflow by the numbers

  • 58 all-time installs (skills.sh)
  • +3 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #1,026 of 2,742 Automation & Workflows skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 27, 2026 (Skillselion catalog sync)
At a glance

workflow capabilities & compatibility

Capabilities
use workflow and use step directive patterns · sandbox limitation workarounds and step placemen · fatalerror and retryableerror handling · serialization and streaming rules · framework integration and cli debugging commands
Works with
vercel · openai
Use cases
orchestration
From the docs

What workflow says it does

Creates durable, resumable workflows using Vercel's Workflow DevKit.
SKILL.md
npx skills add https://github.com/vercel-labs/open-agents --skill workflow

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs58
repo stars5.8k
Security audit3 / 3 scanners passed
Last updatedJuly 15, 2026
Repositoryvercel-labs/open-agents

How do I build durable workflows that survive restarts, retry steps, and pause for external events?

Build durable resumable workflows with Vercel Workflow DevKit using use workflow and use step directives.

Who is it for?

Developers building long-running orchestration with Vercel Workflow DevKit across Next.js or Node backends.

Skip if: Skip for simple cron jobs, stateless API routes, or workflows without durability requirements.

When should I use this skill?

User mentions workflow devkit, durable functions, resumable workflows, or use workflow directives.

What you get

A Workflow DevKit project with step-based orchestration, error handling, and framework integration.

Files

SKILL.mdMarkdownGitHub ↗

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:

"use workflow";  // First line - makes async function durable
"use step";      // First line - makes function a cached, retryable unit

Essential imports:

// 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.

// 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:

LimitationWorkaround
No fetch()import { fetch } from "workflow" then globalThis.fetch = fetch
No setTimeout/setIntervalUse sleep("5s") from "workflow"
No Node.js modules (fs, crypto, etc.)Move to a step function

Example - Using fetch in workflow context:

import { fetch } from "workflow";

export async function myWorkflow() {
  "use workflow";
  globalThis.fetch = fetch;  // Required for AI SDK and HTTP libraries
  // Now generateText() and other libraries work
}

Note: DurableAgent from @workflow/ai handles the fetch assignment automatically.

Error Handling

Use FatalError for permanent failures (no retry), RetryableError for transient failures:

import { FatalError, RetryableError } from "workflow";

if (res.status >= 400 && res.status < 500) {
  throw new FatalError(`Client error: ${res.status}`);
}
if (res.status === 429) {
  throw new RetryableError("Rate limited", { retryAfter: "5m" });
}

Serialization

All data passed to/from workflows and steps must be serializable.

Supported types: string, number, boolean, null, undefined, bigint, plain objects, arrays, Date, RegExp, URL, URLSearchParams, Map, Set, Headers, ArrayBuffer, typed arrays, Request, Response, ReadableStream, WritableStream.

Not supported: Functions, class instances, Symbols, WeakMap/WeakSet. Pass data, not callbacks.

Streaming

Use getWritable() in step functions to stream data:

async function streamData() {
  "use step";  // Required - streaming only works in steps
  const writer = getWritable();
  await writer.write(data);
  writer.releaseLock();  // Always release the lock
}

// Close when done
await getWritable().close();

Debugging

# Check workflow endpoints are reachable
npx workflow health
npx workflow health --port 3001  # Non-default port

# Visual dashboard for runs
npx workflow web
npx workflow web --app-url http://localhost:3001

# CLI inspection (for agents)
npx workflow inspect runs
npx workflow inspect run <run_id>

Tip: Only import workflow APIs you actually use. Unused imports can cause 500 errors.

Related skills

FAQ

What does the workflow skill produce?

Durable workflow functions with cached retryable steps, error classes, and framework-specific integration patterns.

When should I use the workflow skill?

When building workflows that must survive restarts, coordinate multi-step operations, or pause for external events.

Is the workflow skill safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.