Agent skill

Workflow

by zoonk in zoonk/zoonk

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

MITAuto-check passed

Install Workflow

skills CLI
$ npx skills add zoonk/zoonk --skill workflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zoonk/zoonk workflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zoonk/zoonk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/workflow .claude/skills/workflow && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
workflow
GitHub stars
157
Token cost
~3.1k tokens
SKILL.md length
656 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 2 steps: Find docs: glob… → Search content: grep "your query"…
  • Building workflows that need to survive restarts
  • SKILL.md covers CRITICAL: Always Use Correct…, Prefer Step Functions to Avoid…, Workflow Sandbox Limitations and DurableAgent — AI Agents in…, plus 6 more sections
  • Calls npx

What it does

Workflow is an agent skill from zoonk/zoonk. Creates durable, resumable workflows using Vercel's Workflow DevKit. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow devkit", "queue", "event", "push", "subscribe", or step-based orchestration.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Vercel, Vercel AI SDK and Next.js. The repository describes itself as: Turn any topic into clear, structured lessons. The licence is MIT.

When your agent uses it

  • Building workflows that need to survive restarts
  • Pause for external events
  • Retry on failure
  • Coordinate multi-step operations over time

Example prompts

  • “workflow”
  • “durable functions”
  • “resumable”
  • “/workflow”

Requirements

  • Node.js

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Find docs: glob "node_modules/workflow/docs/**/*.mdx"
  2. Search content: grep "your query" node_modules/workflow/docs/

What it can do on your machine

Read from SKILL.md and the folder at commit e0fe2d6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • useworkflow.dev
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Workflow loads about 3.1k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 656 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zoonk/zoonk at commit e0fe2d6, republished under its MIT licence (© zoonk). 656 words, ~3,079 tokens.

Download SKILL.mdSave it as .claude/skills/workflow/SKILL.md (or your agent's skills folder).
name
workflow
description
Creates durable, resumable workflows using Vercel's Workflow DevKit. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow devkit", "queue", "event", "push", "subscribe", or step-based orchestration.
metadata.author
Vercel Inc.
metadata.version
1.3

CRITICAL: Always Use Correct workflow Documentation

Your knowledge of workflow is outdated.

The workflow documentation outlined below matches the installed version of the Workflow DevKit. Follow these instructions before starting on any workflow-related tasks:

Search the bundled documentation in node_modules/workflow/docs/:

  1. Find docs: glob "node_modules/workflow/docs/**/*.mdx"
  2. Search content: grep "your query" node_modules/workflow/docs/

Documentation structure in node_modules/workflow/docs/:

  • getting-started/ - Framework setup (next.mdx, express.mdx, hono.mdx, etc.)
  • foundations/ - Core concepts (workflows-and-steps.mdx, hooks.mdx, streaming.mdx, etc.)
  • api-reference/workflow/ - API docs (sleep.mdx, create-hook.mdx, fatal-error.mdx, etc.)
  • api-reference/workflow-api/ - Client API (start.mdx, get-run.mdx, resume-hook.mdx, etc.)
  • ai/ - AI SDK integration docs
  • errors/ - Error code documentation

Related packages also include bundled docs:

  • @workflow/ai: node_modules/@workflow/ai/docs/ - DurableAgent and AI integration
  • @workflow/core: node_modules/@workflow/core/docs/ - Core runtime (foundations, how-it-works)
  • @workflow/next: node_modules/@workflow/next/docs/ - Next.js integration

When in doubt, update to the latest version of the Workflow DevKit.

Official Resources
Quick Reference

Directives:

typescript
"use workflow"; // First line - makes async function durable
"use step"; // First line - makes function a cached, retryable unit

Essential imports:

typescript
// Workflow primitives
import { sleep, fetch, createHook, createWebhook, getWritable } from "workflow";
import { FatalError, RetryableError } from "workflow";
import { getWorkflowMetadata, getStepMetadata } from "workflow";

// API operations
import { start, getRun, resumeHook, resumeWebhook } from "workflow/api";

// Framework integrations
import { withWorkflow } from "workflow/next";
import { workflow } from "workflow/vite";
import { workflow } from "workflow/astro";
// Or use modules: ["workflow/nitro"] for Nitro/Nuxt

// AI agent
import { DurableAgent } from "@workflow/ai/agent";

Prefer Step Functions to Avoid Sandbox Errors

"use workflow" functions run in a sandboxed VM. "use step" functions have full Node.js access. Put your logic in steps and use the workflow function purely for orchestration.

typescript
// Steps have full Node.js and npm access
async function fetchUserData(userId: string) {
  "use step";
  const response = await fetch(`https://api.example.com/users/${userId}`);
  return response.json();
}

async function processWithAI(data: any) {
  "use step";
  // AI SDK works in steps without workarounds
  return await generateText({ model: openai("gpt-4"), prompt: `Process: ${JSON.stringify(data)}` });
}

// Workflow orchestrates steps - no sandbox issues
export async function dataProcessingWorkflow(userId: string) {
  "use workflow";
  const data = await fetchUserData(userId);
  const processed = await processWithAI(data);
  return { success: true, processed };
}

Benefits: Steps have automatic retry, results are persisted for replay, and no sandbox restrictions.

Workflow Sandbox Limitations

When you need logic directly in a workflow function (not in a step), these restrictions apply:

LimitationWorkaround
No fetch()import { fetch } from "workflow" then globalThis.fetch = fetch
No setTimeout/setIntervalUse sleep("5s") from "workflow"
No Node.js modules (fs, crypto, etc.)Move to a step function

Example - Using fetch in workflow context:

typescript
import { fetch } from "workflow";

export async function myWorkflow() {
  "use workflow";
  globalThis.fetch = fetch; // Required for AI SDK and HTTP libraries
  // Now generateText() and other libraries work
}

Note: DurableAgent from @workflow/ai handles the fetch assignment automatically.

DurableAgent — AI Agents in Workflows

Use DurableAgent to build AI agents that maintain state and survive interruptions. It handles the workflow sandbox automatically (no manual globalThis.fetch needed).

typescript
import { DurableAgent } from "@workflow/ai/agent";
import { getWritable } from "workflow";
import { z } from "zod";
import type { UIMessageChunk } from "ai";

async function lookupData({ query }: { query: string }) {
  "use step";
  // Step functions have full Node.js access
  return `Results for "${query}"`;
}

export async function myAgentWorkflow(userMessage: string) {
  "use workflow";

  const agent = new DurableAgent({
    model: "anthropic/claude-sonnet-4-5",
    system: "You are a helpful assistant.",
    tools: {
      lookupData: {
        description: "Search for information",
        inputSchema: z.object({ query: z.string() }),
        execute: lookupData,
      },
    },
  });

  const result = await agent.stream({
    messages: [{ role: "user", content: userMessage }],
    writable: getWritable<UIMessageChunk>(),
    maxSteps: 10,
  });

  return result.messages;
}

Key points:

  • getWritable<UIMessageChunk>() streams output to the workflow run's default stream
  • Tool execute functions that need Node.js/npm access should use "use step"
  • Tool execute functions that use workflow primitives (sleep(), createHook()) should NOT use "use step" — they run at the workflow level
  • maxSteps limits the number of LLM calls (default is unlimited)
  • Multi-turn: pass result.messages plus new user messages to subsequent agent.stream() calls

For more details on DurableAgent, check the AI docs in node_modules/@workflow/ai/docs/.

Starting Workflows & Child Workflows

Use start() to launch workflows from API routes. start() cannot be called directly in workflow context — wrap it in a step function.

typescript
import { start } from "workflow/api";

// From an API route — works directly
export async function POST() {
  const run = await start(myWorkflow, [arg1, arg2]);
  return Response.json({ runId: run.runId });
}

// No-args workflow
const run = await start(noArgWorkflow);

Starting child workflows from inside a workflow — must use a step:

typescript
import { start } from "workflow/api";

// Wrap start() in a step function
async function triggerChild(data: string) {
  "use step";
  const run = await start(childWorkflow, [data]);
  return run.runId;
}

export async function parentWorkflow() {
  "use workflow";
  const childRunId = await triggerChild("some data"); // Fire-and-forget via step
  await sleep("1h");
}

start() returns immediately — it doesn't wait for the workflow to complete. Use run.returnValue to await completion.

Show full SKILL.md (253 more words)Show less

Hooks — Pause & Resume with External Events

Hooks let workflows wait for external data. Use createHook() inside a workflow and resumeHook() from API routes. Deterministic tokens are for createHook() + resumeHook() (server-side) only. createWebhook() always generates random tokens — do not pass a token option to createWebhook().

Single event
typescript
import { createHook } from "workflow";

export async function approvalWorkflow() {
  "use workflow";

  const hook = createHook<{ approved: boolean }>({
    token: "approval-123", // deterministic token for external systems
  });

  const result = await hook; // Workflow suspends here
  return result.approved;
}
Multiple events (iterable hooks)

Hooks implement AsyncIterable — use for await...of to receive multiple events:

typescript
import { createHook } from "workflow";

export async function chatWorkflow(channelId: string) {
  "use workflow";

  const hook = createHook<{ text: string; done?: boolean }>({ token: `chat-${channelId}` });

  for await (const event of hook) {
    await processMessage(event.text);
    if (event.done) break;
  }
}

Each resumeHook(token, payload) call delivers the next value to the loop.

Resuming from API routes
typescript
import { resumeHook } from "workflow/api";

export async function POST(req: Request) {
  const { token, data } = await req.json();
  await resumeHook(token, data);
  return new Response("ok");
}

Error Handling

Use FatalError for permanent failures (no retry), RetryableError for transient failures:

typescript
import { FatalError, RetryableError } from "workflow";

if (res.status >= 400 && res.status < 500) {
  throw new FatalError(`Client error: ${res.status}`);
}
if (res.status === 429) {
  throw new RetryableError("Rate limited", { retryAfter: "5m" });
}

Serialization

All data passed to/from workflows and steps must be serializable.

Supported types: string, number, boolean, null, undefined, bigint, plain objects, arrays, Date, RegExp, URL, URLSearchParams, Map, Set, Headers, ArrayBuffer, typed arrays, Request, Response, ReadableStream, WritableStream.

Not supported: Functions, class instances, Symbols, WeakMap/WeakSet. Pass data, not callbacks.

Streaming

Use getWritable() to stream data from workflows. getWritable() can be called in both workflow and step contexts, but you cannot interact with the stream (call getWriter(), write(), close()) directly in a workflow function. The stream must be passed to step functions for actual I/O, or steps can call getWritable() themselves.

Get the stream in a workflow, pass it to a step:

typescript
import { getWritable } from "workflow";

export async function myWorkflow() {
  "use workflow";
  const writable = getWritable();
  await writeData(writable, "hello world");
}

async function writeData(writable: WritableStream, chunk: string) {
  "use step";
  const writer = writable.getWriter();
  try {
    await writer.write(chunk);
  } finally {
    writer.releaseLock();
  }
}

Call getWritable() directly inside a step (no need to pass it):

typescript
import { getWritable } from "workflow";

async function streamData(chunk: string) {
  "use step";
  const writer = getWritable().getWriter();
  try {
    await writer.write(chunk);
  } finally {
    writer.releaseLock();
  }
}

Debugging

bash
# Check workflow endpoints are reachable
npx workflow health
npx workflow health --port 3001  # Non-default port

# Visual dashboard for runs
npx workflow web
npx workflow web <run_id>

# CLI inspection (use --json for machine-readable output, --help for full usage)
npx workflow inspect runs
npx workflow inspect run <run_id>

# For Vercel-deployed projects, specify backend and project
npx workflow inspect runs --backend vercel --project <project-name> --team <team-slug>
npx workflow inspect run <run_id> --backend vercel --project <project-name> --team <team-slug>

# Open Vercel dashboard in browser for a specific run
npx workflow inspect run <run_id> --web
npx workflow web <run_id> --backend vercel --project <project-name> --team <team-slug>

# Cancel a running workflow
npx workflow cancel <run_id>
npx workflow cancel <run_id> --backend vercel --project <project-name> --team <team-slug>
# --env defaults to "production"; use --env preview for preview deployments

Debugging tips:

  • Use --json (-j) on any command for machine-readable output
  • Use --web to open the Vercel Observability dashboard in your browser
  • Use --help on any command for full usage details
  • Only import workflow APIs you actually use. Unused imports can cause 500 errors.

© zoonk, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/workflow of zoonk/zoonk.

Open the folder on GitHubat commit e0fe2d6

Compare with similar skills

Workflow next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Workflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Workflow this skillzoonk/zoonk157—~3.1kAutomated safety check: PassMIT
AI SDKvercel-labs/ai-facts16821 repos~1.2kAutomated safety check: PassNone
Benchmark Testingvercel/vercel-plugin301—~946Automated safety check: PassCustom licence
Vercel Plugin Evalvercel/vercel-plugin301—~1.2kAutomated safety check: PassCustom licence
Vercel Optimize Auditvercel-labs/agent-skills32k8 repos~4.3kAutomated safety check: PassNone
Vercel React Best Practicessanity-io/sanity6.4k130 repos~1.6kAutomated safety check: PassMIT

Similar skills

  • AI SDK

    vercel-labs/ai-facts

    Official

    Answer questions about the AI SDK and help build AI-powered features.

    168 GitHub starsUsed in 21 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Benchmark Testing

    vercel/vercel-plugin

    Official

    Create and launch benchmark test projects to exercise vercel-plugin skill injection across realistic scenarios.

    301 GitHub stars~946 tokensUpdated today
    Auto-check passed
  • Vercel Plugin Eval

    vercel/vercel-plugin

    Official

    Run live eval sessions against the vercel-plugin to verify hook behavior, skill injection, dedup correctness, and coverage.

    301 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Vercel Optimize Audit

    vercel-labs/agent-skills

    Official

    Runs a metrics-first audit of a deployed Vercel project, gating investigations on real signals to produce ranked, citation-backed cost and performance recommendations.

    32k GitHub starsUsed in 8 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 130 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • Adds persistent memory to Vercel AI SDK apps with the Mem0 provider, using a wrapped model or standalone retrieve and store utilities.

    67k GitHub stars~1.9k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from zoonk/zoonk

All 12 skills in this repo
  • A skill your agent uses when designing, reviewing, or implementing Android UI or features for phones, tablets, foldables, ChromeOS, desktop windowing, Wear OS, Android TV, Android for Cars, Android…

    157 GitHub stars~1.1k tokensUpdated 5 days ago
    Auto-check passed
  • A skill your agent uses when designing, reviewing, or implementing any Apple-platform UI or feature for iOS, iPadOS, macOS, visionOS, tvOS, watchOS, SwiftUI, UIKit, AppKit, WatchKit, app icons, Dark…

    157 GitHub stars~942 tokensUpdated 5 days ago
    Auto-check passed
  • Create or update problem-focused Zoonk GitHub issues and their requested metadata or relationships.

    157 GitHub stars~632 tokensUpdated 5 days ago
    Auto-check passed
  • Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces.

    157 GitHub stars~6.8k tokensUpdated 5 days ago
    Auto-check passed
  • Zoonk Commit

    zoonk/zoonk

    Write Zoonk commit messages and PR titles or descriptions when preparing a commit or pull request.

    157 GitHub stars~578 tokensUpdated 5 days ago
    Auto-check passed
  • Create or refactor reusable Zoonk React UI primitives using flat compound components.

    157 GitHub stars~583 tokensUpdated 5 days ago
    Auto-check passed

Questions about Workflow

What does Workflow do?

Creates durable, resumable workflows using Vercel's Workflow DevKit. Workflow is an agent skill from zoonk/zoonk. Creates durable, resumable workflows using Vercel's Workflow DevKit.

When should I use Workflow?

Workflow fits situations like: building workflows that need to survive restarts; pause for external events; retry on failure; coordinate multi-step operations over time.

How do I install Workflow in Claude Code?

Run `npx skills add zoonk/zoonk --skill workflow -a claude-code`. Or copy the skill folder (.agents/skills/workflow in zoonk/zoonk) into .claude/skills/workflow in your project. Claude Code loads it when a task matches its description.

How do I install Workflow in Codex?

Run `npx skills add zoonk/zoonk --skill workflow -a codex`. Or copy the skill folder (.agents/skills/workflow in zoonk/zoonk) into .agents/skills/workflow in your project. Codex loads it when a task matches its description.

Can I use Workflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zoonk/zoonk --skill workflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/workflow, .gemini/skills/workflow, .github/skills/workflow and .opencode/skills/workflow in your project.

What does Workflow need to run?

Going by SKILL.md and its folder, Workflow needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Workflow access the network?

SKILL.md names 2 domains. As links in the text: useworkflow.dev and github.com. This is read from the text; nothing was executed.

Is Workflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Workflow use?

Workflow is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Workflow use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Workflow?

Skills that share tags, products or a category with Workflow: AI SDK (vercel-labs/ai-facts, 168 stars), Benchmark Testing (vercel/vercel-plugin, 301 stars), Vercel Plugin Eval (vercel/vercel-plugin, 301 stars) and Vercel Optimize Audit (vercel-labs/agent-skills, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Workflow?

zoonk (a GitHub organization) maintains it in zoonk/zoonk, which has 157 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 2, 2026.

Source: zoonk/zoonk on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.