百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

workflow

> 编程语言
开源

适用于代理和工作流程的类型安全的持久执行。支持可恢复的运行、只可追加的历史记录以及可补偿的步骤,适用于 TS/JS、React、Solid、Vue 和 Svelte。

193 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

适用于代理和工作流程的类型安全的持久执行。支持可恢复的运行、只可追加的历史记录以及可补偿的步骤,适用于 TS/JS、React、Solid、Vue 和 Svelte。

TanStack Workflow

Type-safe durable execution for TypeScript. Workflows are ordinary async functions that can pause, persist progress to an append-only log, and resume after approvals, webhooks, timers, or process restarts.

bash
pnpm add @tanstack/workflow-core

Install zod or another Standard Schema-compatible library if you want runtime validation for workflow inputs, outputs, state, or signal payloads.

Example

…

Core Ideas

  • Side effects live inside ctx.step(id, fn), which records results and skips re-execution on replay.
  • ctx.waitForEvent, ctx.approve, ctx.sleep, and ctx.sleepUntil pause runs until the host delivers a matching signal or approval.
  • ctx.now() and ctx.uuid() record deterministic values for replay.
  • Middleware can extend ctx with typed dependencies such as users, database handles, or tracing.
  • Storage is pluggable through RunStore; the package ships an in-memory store for local development and tests.

Packages

  • @tanstack/workflow-core: engine, workflow builder, middleware, event types, request parsing helpers, version routing, and in-memory RunStore.
  • @tanstack/workflow-runtime: registered workflows, durable execution store contract, timers, schedules, leases, signals, approvals, and bounded sweeps.
  • @tanstack/workflow-store-drizzle-postgres: Drizzle/Postgres implementation of the runtime execution store.
  • @tanstack/workflow-vercel: Vercel route handler and cron config helper for runtime sweeps.
  • @tanstack/workflow-netlify: Netlify Scheduled Function handler and config helper for runtime sweeps.

Framework bindings and devtools are planned as follow-up packages.

Development

bash
pnpm install
pnpm --filter @tanstack/workflow-core test:lib
pnpm --filter @tanstack/workflow-core test:types
pnpm --filter @tanstack/workflow-core build
pnpm test

Docs

  • Overview
  • Comparison
  • Installation
  • Quick start
  • Guide
  • Cookbook
  • API reference
  • Primitives
  • Replay and resume
  • Scheduling

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言