[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80312":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":28,"discoverSource":29},80312,"workflow","TanStack\u002Fworkflow","TanStack","🤖 Type-safe durable execution for agents and workflows. Resumable runs, append-only history, and compensable steps for TS\u002FJS, React, Solid, Vue, and Svelte.",null,"TypeScript",169,4,69,2,0,16,95,1,2.1,"MIT License",false,"main",true,[],"2026-06-12 02:04:00","# TanStack Workflow\n\nType-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.\n\n```bash\npnpm add @tanstack\u002Fworkflow-core\n```\n\nInstall `zod` or another Standard Schema-compatible library if you want runtime validation for workflow inputs, outputs, state, or signal payloads.\n\n## Example\n\n```ts\nimport {\n  createWorkflow,\n  inMemoryRunStore,\n  runWorkflow,\n} from '@tanstack\u002Fworkflow-core'\nimport { z } from 'zod'\n\nconst checkout = createWorkflow({\n  id: 'checkout',\n  input: z.object({ userId: z.string(), amount: z.number() }),\n  output: z.object({ status: z.enum(['approved', 'rejected']) }),\n}).handler(async (ctx) => {\n  const charge = await ctx.step('charge-card', (stepCtx) =>\n    stripe.charges.create(\n      { customer: ctx.input.userId, amount: ctx.input.amount },\n      { idempotencyKey: stepCtx.id },\n    ),\n  )\n\n  if (ctx.input.amount > 10_000) {\n    const decision = await ctx.approve({ title: 'Approve large charge?' })\n    if (!decision.approved) return { status: 'rejected' as const }\n  }\n\n  await ctx.step('send-receipt', () => sendReceipt(charge.id))\n  return { status: 'approved' as const }\n})\n\nconst store = inMemoryRunStore()\n\nfor await (const event of runWorkflow({\n  workflow: checkout,\n  input: { userId: 'cus_123', amount: 4200 },\n  runStore: store,\n})) {\n  console.log(event.type, event)\n}\n```\n\n## Core Ideas\n\n- Side effects live inside `ctx.step(id, fn)`, which records results and skips re-execution on replay.\n- `ctx.waitForEvent`, `ctx.approve`, `ctx.sleep`, and `ctx.sleepUntil` pause runs until the host delivers a matching signal or approval.\n- `ctx.now()` and `ctx.uuid()` record deterministic values for replay.\n- Middleware can extend `ctx` with typed dependencies such as users, database handles, or tracing.\n- Storage is pluggable through `RunStore`; the package ships an in-memory store for local development and tests.\n\n## Packages\n\n- `@tanstack\u002Fworkflow-core`: engine, workflow builder, middleware, event types, request parsing helpers, version routing, and in-memory `RunStore`.\n- `@tanstack\u002Fworkflow-runtime`: registered workflows, durable execution store contract, timers, schedules, leases, signals, approvals, and bounded sweeps.\n- `@tanstack\u002Fworkflow-store-drizzle-postgres`: Drizzle\u002FPostgres implementation of the runtime execution store.\n- `@tanstack\u002Fworkflow-vercel`: Vercel route handler and cron config helper for runtime sweeps.\n- `@tanstack\u002Fworkflow-netlify`: Netlify Scheduled Function handler and config helper for runtime sweeps.\n\nFramework bindings and devtools are planned as follow-up packages.\n\n## Development\n\n```bash\npnpm install\npnpm --filter @tanstack\u002Fworkflow-core test:lib\npnpm --filter @tanstack\u002Fworkflow-core test:types\npnpm --filter @tanstack\u002Fworkflow-core build\npnpm test\n```\n\n## Docs\n\n- [Overview](.\u002Fdocs\u002Foverview.md)\n- [Comparison](.\u002Fdocs\u002Fcomparison.md)\n- [Installation](.\u002Fdocs\u002Finstallation.md)\n- [Quick start](.\u002Fdocs\u002Fquick-start.md)\n- [Guide](.\u002Fdocs\u002Fguide\u002Findex.md)\n- [Cookbook](.\u002Fdocs\u002Fcookbook\u002Findex.md)\n- [API reference](.\u002Fdocs\u002Fapi\u002Findex.md)\n- [Primitives](.\u002Fdocs\u002Fconcepts\u002Fprimitives.md)\n- [Replay and resume](.\u002Fdocs\u002Fconcepts\u002Freplay-and-resume.md)\n- [Scheduling](.\u002Fdocs\u002Fconcepts\u002Fscheduling.md)\n\n## License\n\nMIT\n","TanStack\u002Fworkflow 是一个用于 TypeScript 的类型安全持久化执行库，支持异步函数的暂停、进度持久化以及恢复执行。该项目的核心功能包括可恢复运行、追加式历史记录和补偿步骤，适用于需要长时间运行的任务或流程自动化场景。它允许开发者通过简单的API定义工作流，并在特定条件下（如审批、Webhook触发、定时器等）暂停和恢复任务。此外，该库还提供了对中间件的支持，便于扩展上下文依赖项，如用户认证、数据库连接等。存储方案灵活可插拔，默认提供了一个内存存储实现，适合本地开发和测试。此项目非常适合于构建复杂的后端服务流程，特别是那些需要跨多个步骤且可能涉及人工干预的业务逻辑。","2026-06-11 04:00:15","CREATED_QUERY"]