workflow

Creates durable, resumable workflows using Vercel's Workflow SDK for TypeScript applications.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/Aadi-110i/PEP-PROJECT --skill workflow-aadi-110i
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow
Source: https://github.com/Aadi-110i/PEP-PROJECT/tree/main/skills/workflow
Command: npx skills add https://github.com/Aadi-110i/PEP-PROJECT --skill workflow-aadi-110i

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires workflow, @workflow/ai, @workflow/core, @workflow/next, @workflow/serde, @workflow/vitest.

What problem does it solve? Long-running, multi-step operations in web applications often fail when servers restart, requests time out, or external events never arrive. This Skill guides you in building durable workflows with Vercel's Workflow SDK that survive restarts, retry on failure, pause for external events, and coordinate complex orchestration over time. ## Core Features & Use Cases - Durable Orchestration: Use the "use workflow" and "use step" directives to build workflows whose state persists across restarts, with automatic step retries and replay. - Hooks and Webhooks: Pause workflows with createHook() or createWebhook() and resume them from API routes when external events (approvals, messages, callbacks) arrive. - Durable AI Agents: Build stateful AI agents with DurableAgent that stream output, call tools, and survive interruptions. - Observability and Testing: Inspect runs via the World SDK, CLI, and web dashboard, and test workflows in-process with the Vitest plugin. - Use Case: Imagine building an order-approval pipeline: the workflow charges a payment in a step, sleeps for one hour, waits on an approval hook from an admin dashboard, and then triggers a child fulfillment workflow — all surviving deploys and restarts. ## Quick Start Ask the AI to create a durable workflow using the Workflow SDK that fetches user data in a step, waits for an approval hook, and then completes the order.

Frequently Asked Questions about workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a durable workflow with the Vercel Workflow SDK?

Add "use workflow" as the first line of an async function to make it durable, and "use step" for functions that need full Node.js access. Start the workflow from an API route with start() from "workflow/api", which returns a run handle immediately.

How do I pause a workflow and resume it with an external event?

Use createHook() inside the workflow with a deterministic token; the workflow suspends until resumed. From an API route, call resumeHook(token, data) from "workflow/api" to deliver the payload and continue execution.

Why can't I use fetch or setTimeout inside a workflow function?

Workflow functions run in a sandboxed VM without Node.js APIs, timers, or native fetch. Import fetch from "workflow", use sleep() instead of setTimeout, and move Node.js-dependent logic into "use step" functions.

Can I build AI agents that survive restarts with the Workflow SDK?

Yes, DurableAgent from "@workflow/ai/agent" maintains agent state across interruptions and handles the sandbox fetch setup automatically. Tool execute functions needing Node.js access should use "use step", and output streams via getWritable().

How do I test workflows that use sleep or hooks?

Use the @workflow/vitest plugin for in-process integration tests without a running server. Helpers like waitForHook, waitForSleep, resumeHook, and getRun(runId).wakeUp() let you advance paused workflows deterministically.

What data types can be passed between workflows and steps?

All arguments and return values must be serializable: primitives, plain objects, arrays, Date, Map, Set, streams, Request, and Response are supported. Functions and Symbols are not; class instances require the @workflow/serde serialization protocol.