workflow

Creates durable, resumable workflows using Vercel's Workflow SDK with steps, hooks, and streaming.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/sharad07072007/paras --skill workflow-sharad07072007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow
Source: https://github.com/sharad07072007/paras/tree/main/.agents/plugins/vercel/skills/workflow/upstream
Command: npx skills add https://github.com/sharad07072007/paras --skill workflow-sharad07072007

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building long-running, multi-step operations that survive server restarts, retry on failure, and pause for external events is difficult with standard request-response code. This Skill guides you through Vercel's Workflow SDK to create durable workflows that persist state, resume from interruptions, and coordinate complex orchestration over time. ## Core Features & Use Cases - Durable Workflows and Steps: Use the "use workflow" and "use step" directives to build orchestrations where steps get automatic retries, persisted results, and full Node.js access while workflow functions stay sandboxed. - Hooks, Streaming, and AI Agents: Pause workflows with createHook() until external events arrive, stream output with getWritable() including namespaced streams, and build stateful AI agents with DurableAgent. - Testing, Debugging, and Observability: Test workflows in-process with the Vitest plugin, inspect runs via the CLI and web dashboard, and query run state with the World SDK and data hydration utilities. - Use Case: Imagine an order-approval pipeline that must wait for a manager's approval, retry a flaky payment API, and stream progress to a dashboard. This Skill shows you how to model that as a durable workflow with hooks, RetryableError handling, and namespaced streams. ## Quick Start Ask the AI to create a durable workflow using the Workflow SDK that fetches user data in a step, pauses for an approval hook, and streams progress updates.

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 the "use workflow" directive as the first line of an async function to make it durable, and use "use step" for individual units of work. Steps get automatic retries and persisted results, while the workflow function orchestrates them in a sandboxed environment.

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

Use createHook() inside the workflow with a deterministic token, then call resumeHook(token, data) from an API route to deliver the event. Hooks also implement AsyncIterable, so you can use for await...of to receive multiple events in a loop.

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 the workflow package and assign it to globalThis.fetch, replace setTimeout with sleep(), and move Node.js-dependent logic into step functions.

Can I test workflows without running a server?

Yes, the @workflow/vitest plugin runs workflows in-process for integration tests. Use start() to trigger a run, waitForHook() or waitForSleep() to reach pause points, and resumeHook() or wakeUp() to continue, with no HTTP server required.

How do I pass class instances between workflow steps?

Implement the @workflow/serde protocol by adding static WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE methods inside the class body. The SWC plugin auto-registers the class, and methods needing Node.js access should be marked with "use step".

What is the difference between FatalError and RetryableError?

FatalError terminates the workflow immediately without retrying, suited for permanent failures like invalid input or auth denial. RetryableError signals transient failures like rate limits and triggers a retry, optionally with a retryAfter delay.