workflow

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

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

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 break when servers restart, requests time out, or external events arrive late. This Skill guides you in building durable workflows with Vercel's Workflow SDK that survive restarts, retry on failure, pause for external events, and resume exactly where they left off. ## Core Features & Use Cases - Durable Orchestration: Mark functions with "use workflow" and "use step" directives to get automatic retries, persisted results, and replay across failures. - Hooks, Sleep, and Streaming: Pause workflows for external events via createHook/resumeHook, wait with sleep(), and stream real-time output with namespaced getWritable() streams. - AI Agents and Observability: Build stateful agents with DurableAgent, inspect runs via the World SDK and CLI, and test workflows in-process with the Vitest plugin. - Use Case: Build an order-approval pipeline that charges a customer, waits up to 48 hours for a manager's approval via a hook, sends a confirmation email, and streams progress updates to the client — all surviving deployments and restarts. ## Quick Start Ask the AI to create a durable workflow using the Workflow SDK that processes an order, waits for an approval hook, and retries failed steps automatically.

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" on functions that need full Node.js access. The workflow function orchestrates steps, which get automatic retries and persisted results for replay.

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. Hooks also implement AsyncIterable, so for await...of loops can receive multiple events over time.

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

Workflow functions run in a sandboxed VM without Node.js APIs. Import fetch from "workflow" and assign it to globalThis.fetch, replace setTimeout with sleep(), and move Node.js-dependent logic into "use step" functions.

Can I run AI agents inside a durable workflow?

Yes, use DurableAgent from @workflow/ai, which handles the sandbox fetch setup automatically. Tool execute functions needing Node.js access should use "use step", and getWritable() streams agent output to the run's stream.

How do I test workflows that use sleep or hooks?

Use the @workflow/vitest plugin for integration tests without a running server. Helpers like waitForHook, waitForSleep, resumeHook, and getRun(runId).wakeUp() let you trigger pause points and assert on run.returnValue.

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, and typed arrays work. Functions and Symbols do not; class instances require the @workflow/serde protocol with static serialize methods.