workflow

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

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

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 backend operations that survive server restarts, retry on failure, and pause for external events is complex. This Skill guides the creation of durable workflows with Vercel's Workflow SDK so orchestration logic remains correct and resumable. ## Core Features & Use Cases - Durable Workflow Orchestration: Write workflows with the "use workflow" directive and retryable "use step" functions that persist results across restarts. - Hooks, Webhooks & Sleep: Pause workflows for external events with createHook/resumeHook, and schedule delays with sleep(). - Streaming, AI Agents & Observability: Stream output via getWritable, build stateful agents with DurableAgent, and inspect runs using the World SDK and CLI tools. - Use Case: Imagine building an order-approval pipeline that waits for a manager's approval, retries failed payment calls, and streams progress to a dashboard. This Skill provides the exact patterns and API usage to implement it. ## 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 streams the result.

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

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

Use createHook() inside the workflow with a deterministic token, then call resumeHook(token, data) from an API route to deliver the event. Hooks are async iterable, so for await...of receives multiple events.

Why does fetch or setTimeout fail inside a workflow function?

Workflow functions run in a sandboxed VM without Node.js APIs. Import fetch from "workflow" and assign 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/agent, which handles the sandbox fetch setup automatically. Tool execute functions needing Node.js access should use "use step", and getWritable() streams agent output.

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 drive paused workflows to completion.

How do I inspect and debug running workflows?

Use npx workflow inspect runs or inspect run <run_id> for CLI inspection, npx workflow web for a visual dashboard, and --backend vercel with project and team flags for deployed runs. The World SDK via getWorld() enables programmatic observability.