mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
62d3ade7fe
Adds a deterministic postgres repro for the concern that boot-time recovery (`reenqueueActiveRuns`) might re-run steps that are healthily in-flight on another worker: worker B runs a long step, worker A boots while it's running (its instrumentation re-enqueues ALL active runs), and the test counts how many times the step body actually executed (via a shared side-effect log). Result: exactly once. The re-enqueue replays the workflow, but the step's `correlationId` idempotency key means graphile-worker won't run a concurrent duplicate of the locked job, and by the time any re-dispatch could run the original step has completed and the terminal-state guard skips it. So the re-enqueue does NOT override step idempotency. Adds `sideEffectStepWorkflow` (records each execution before sleeping). Gated behind MULTIWORKER_RECOVERY_TEST + the postgres world; not in the default CI gate. Verified locally: VITEST EXIT 0, step executed 1×. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Workbench
These apps are used for testing internally. Refer to Workflow SDK Examples to see some use cases and working examples.