workflow

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

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill workflow-alwahdi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow
Source: https://github.com/Alwahdi/mikrotik-whisperer/tree/main/.agents/skills/workflow
Command: npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill workflow-alwahdi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building long-running, multi-step backend processes that survive server restarts, pause for external events, and retry on failure is complex. This Skill guides the creation of durable workflows with Vercel's Workflow DevKit so operations resume correctly after interruptions. ## Core Features & Use Cases - Durable Workflow Orchestration: Uses "use workflow" and "use step" directives to build resumable functions with automatic retries and persisted step results. - Hooks, Webhooks & Streaming: Pause workflows for external events with createHook/resumeHook, and stream output via getWritable with namespaced streams. - AI Agent Integration: Build stateful AI agents with DurableAgent from @workflow/ai that survive interruptions. - Use Case: Imagine an approval pipeline that must wait hours for a manager's decision, then call an AI model and notify users. This Skill helps you implement it as a durable workflow that suspends on a hook, resumes via an API route, and streams progress to clients. ## Quick Start Ask the AI to create a durable workflow using the Workflow DevKit that fetches user data in a step, pauses 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 Vercel Workflow DevKit?

Add the "use workflow" directive as the first line of an async function to make it durable, and use "use step" for individual retryable units. Start the workflow from an API route with start() from workflow/api, which returns a run ID immediately.

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

Why does fetch or setTimeout fail inside a workflow function?

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

Can I use AI SDK 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", while those using workflow primitives like sleep or createHook should run at the workflow level.

How do I test workflows that use sleep or hooks?

Use the @workflow/vitest plugin for integration tests, which runs workflows in-process without a server. Helpers like waitForHook, waitForSleep, resumeHook, and getRun(runId).wakeUp() let you control pause points and assert on run.returnValue.

What data types can be passed to workflow and step functions?

All arguments and return values must be serializable: strings, numbers, booleans, plain objects, arrays, Date, Map, Set, URL, Headers, streams, and typed arrays are supported. Functions, class instances, Symbols, and WeakMap/WeakSet are not supported.