Skip to content
Source
Sign inSign up
TanStack/workflow

Add durable signal buffering, retries, and compensation #19

Opentannerlinsleywants to merge 1 commit intomain fromtaren/durable-recoveryopened

Showing 84 changed files with 33 additions and 3 deletions (loading 81).

x
0 of 84 viewed, 84 left
17 additions and 0 deletions.changeset/durable-signals-retries-compensation.mdAdded
View file
@@ -0,0 +1,17 @@
+---
+'@tanstack/workflow-core': minor
+'@tanstack/workflow-runtime': minor
+'@tanstack/workflow-store-cloudflare-d1': minor
+'@tanstack/workflow-store-drizzle-postgres': minor
+---
+​
+Add opt-in durable signal buffering, persisted automatic step retries, and
+explicit compensation handlers with reverse ordering and recoverable progress.
+Fence runtime persistence writes with per-drive leases, recover missing timer
+scheduling, and acknowledge timers only after their resolution is durable.
+​
+Apply the additive `0001_signal_inbox.sql` migration before deploying the updated
+D1 or Postgres adapter. Existing histories and default retry/signal behavior stay
+compatible. New inbox and timer-acknowledgement methods are optional for custom
+adapters. See the durable recovery guide for rollout, retention, and external
+idempotency responsibilities.
8 additions and 2 deletionsdocs/api/store-adapters.mdModified
View file
@@ -17,8 +17,8 @@
| Run lifecycle | `createRun`, `loadRun`, `loadExecution`, `markRunPaused`, `markRunFinished`, `markRunErrored` |
| Event log | `appendEvents`, `readEvents`, optional `subscribeEvents` |
| Leases | `claimRun`, `heartbeatRunLease`, `releaseRunLease`, `claimStaleRuns` |
-| Timers | `scheduleTimer`, `claimDueTimers` |
-| Signals | `deliverSignal` |
+| Timers | `scheduleTimer`, `claimDueTimers`, optional `completeTimer` |
+| Signals | `deliverSignal`, optional `bufferSignal` and `consumeBufferedSignal` |
| Approvals | `deliverApproval` |
| Schedules | `upsertSchedule`, `claimDueScheduleBuckets`, `markScheduleBucketStarted` |