pnpm add @tanstack/workflow-corepnpm add @tanstack/workflow-coreInstall zod or another Standard Schema library if you use input / output / state / waitForEvent({ schema }) validation.
For registered workflows, schedules, timers, leases, and host sweeps:
pnpm add @tanstack/workflow-core @tanstack/workflow-runtimepnpm add @tanstack/workflow-core @tanstack/workflow-runtimeRun state lives in a RunStore. Ships with one in-memory implementation:
import { inMemoryRunStore } from '@tanstack/workflow-core'
const runStore = inMemoryRunStore({ ttl: 60 * 60 * 1000 }) // 1h, paused runs exemptimport { inMemoryRunStore } from '@tanstack/workflow-core'
const runStore = inMemoryRunStore({ ttl: 60 * 60 * 1000 }) // 1h, paused runs exemptThe production runtime uses a richer WorkflowExecutionStore. For local tests:
import { inMemoryWorkflowExecutionStore } from '@tanstack/workflow-runtime'
const store = inMemoryWorkflowExecutionStore()import { inMemoryWorkflowExecutionStore } from '@tanstack/workflow-runtime'
const store = inMemoryWorkflowExecutionStore()For Postgres:
pnpm add @tanstack/workflow-store-drizzle-postgres drizzle-orm pgpnpm add @tanstack/workflow-store-drizzle-postgres drizzle-orm pgimport { createDrizzlePostgresWorkflowStore } from '@tanstack/workflow-store-drizzle-postgres'
const store = createDrizzlePostgresWorkflowStore({ db })import { createDrizzlePostgresWorkflowStore } from '@tanstack/workflow-store-drizzle-postgres'
const store = createDrizzlePostgresWorkflowStore({ db })Apply the package-owned store migration during setup/deploy:
psql "$DATABASE_URL" -f node_modules/@tanstack/workflow-store-drizzle-postgres/migrations/0000_workflow_store.sqlpsql "$DATABASE_URL" -f node_modules/@tanstack/workflow-store-drizzle-postgres/migrations/0000_workflow_store.sqlFor Cloudflare D1:
pnpm add @tanstack/workflow-store-cloudflare-d1pnpm add @tanstack/workflow-store-cloudflare-d1import { createCloudflareD1WorkflowStore } from '@tanstack/workflow-store-cloudflare-d1'
const store = createCloudflareD1WorkflowStore({ db: env.WORKFLOW_DB })import { createCloudflareD1WorkflowStore } from '@tanstack/workflow-store-cloudflare-d1'
const store = createCloudflareD1WorkflowStore({ db: env.WORKFLOW_DB })Copy or reference the package-owned SQL artifact from node_modules/@tanstack/workflow-store-cloudflare-d1/migrations/0000_workflow_store.sql in your D1 migration flow.
Engine is framework-agnostic. Two entry points:
Use either with TanStack Start server functions, Hono, Express, Cloudflare Workers, AWS Lambda — anything that can receive an HTTP request.
The runtime adds:
For Netlify:
pnpm add @tanstack/workflow-netlifypnpm add @tanstack/workflow-netlifyFor Cloudflare:
pnpm add @tanstack/workflow-cloudflarepnpm add @tanstack/workflow-cloudflareFor Railway:
pnpm add @tanstack/workflow-railwaypnpm add @tanstack/workflow-railwayFor Vercel:
pnpm add @tanstack/workflow-vercelpnpm add @tanstack/workflow-vercelSee the Deployment guide for full setup.
None yet. React / Solid / Vue / Svelte hooks (useWorkflow) ship in follow-up packages.