workflow

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

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Chia1104/agent-air --skill workflow-chia1104
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: workflow
Source: https://github.com/Chia1104/agent-air/tree/main/skills/shared/workflow
Command: npx skills add https://github.com/Chia1104/agent-air --skill workflow-chia1104

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building long-running, multi-step operations in TypeScript often breaks when servers restart, APIs rate-limit, or external events arrive late. This Skill guides the creation of durable workflows that survive restarts, pause for external events, retry on failure, and coordinate steps over time using Vercel's Workflow SDK. ## Core Features & Use Cases - Durable orchestration: Uses the "use workflow" and "use step" directives to make async functions resumable, with automatic retry and persisted step results. - Hooks, streaming, and AI agents: Covers createHook/resumeHook for external events, getWritable for namespaced streams, and DurableAgent for stateful AI agents inside workflows. - Testing and observability: Provides Vitest integration testing patterns, World SDK inspection APIs, data hydration, and CLI debugging commands. - Use Case: Imagine building an order-approval pipeline that must wait hours for a manager's response, retry flaky payment API calls, and stream progress to a dashboard. This Skill shows how to implement it with steps, hooks, and sleep without losing state on deploys. ## 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 retries transient API failures.

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 needing full Node.js access. Orchestrate steps inside the workflow function and launch runs with start() from workflow/api.

How to 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 for await...of receives multiple events.

Why does fetch fail inside a workflow function?▼

Workflow functions run in a sandboxed VM without fetch, setTimeout, or Node.js modules. Import fetch from "workflow" and assign globalThis.fetch, use sleep() instead of timers, or move the logic into a "use step" function.

Can I run AI agents inside a durable workflow?▼

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 getWritable() streams output.

How do I test workflows that use sleep and hooks?▼

Use the @workflow/vitest plugin for integration tests, with waitForHook and waitForSleep to reach pause points, then resumeHook or wakeUp to continue. Unit-test plain step functions directly without the plugin.

What are the limitations of the Workflow SDK sandbox?▼

The sandbox blocks fetch, timers, and Node.js modules like fs and crypto, and all data crossing boundaries must be serializable. Class instances require the @workflow/serde protocol with static serialize methods defined inside the class body.