惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
B
Blog
腾讯CDC
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - Franky
罗磊的独立博客
月光博客
月光博客
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
V
Visual Studio Blog
I
InfoQ
有赞技术团队
有赞技术团队
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale

Workflow SDK Documentation

Patterns for Defining Tools Human-in-the-Loop Building Durable AI Agents Queueing User Messages Resumable Streams Sleep, Suspense, and Scheduling Streaming Updates from Tools API Reference Workflow Globals Changelog Resilient run start Cookbook Building a World Deploying Astro Express Fastify Hono Getting Started NestJS Next.js Nitro Nuxt Python SvelteKit Vite corrupted-event-log fetch-in-workflow hook-conflict Errors
workflow
2026-06-12 · via Workflow SDK Documentation

Configure Vite and Nitro to transform workflow directives.

Returns the Vite plugins that transform workflow code ("use step"/"use workflow" directives) and configure the workflow/nitro module on the Nitro server. It is designed to be used alongside nitro() from nitro/vite, which provides the server framework for API routes and deployment.

To enable "use step" and "use workflow" directives while developing locally or deploying to production, add workflow() to the plugins array of your Vite config, together with nitro().

import { nitro } from "nitro/vite";
import { defineConfig } from "vite";
import { workflow } from "workflow/vite"; 

export default defineConfig({
  plugins: [nitro(), workflow()], 
  nitro: {
    serverDir: "./",
  },
});

Parameters

ParameterTypeDescription
optionsModuleOptionsOptional. Forwarded to the workflow/nitro module as its module options.

ModuleOptions

OptionTypeDefaultDescription
dirsstring[]Directories to scan for workflows and steps. By default, the workflows/ directory is scanned from the project root and all layer source directories.
typescriptPluginbooleanfalseAdds the workflow TypeScript plugin to the generated tsconfig.json for IDE IntelliSense.
runtimestringNode.js runtime version for Vercel Functions (e.g. 'nodejs22.x', 'nodejs24.x'). Only applies when deploying to Vercel.

Returns

Returns an array of Vite Plugin objects. Spread or pass the array directly to the plugins option of your Vite config — Vite flattens nested plugin arrays automatically.