Public OSS repair case · PostgreSQL workflow state and replay
A step exists, but its creation event is missing—and retries cannot make progress
In a self-hosted Vercel Workflow PostgreSQL world, an interrupted write could leave a step in the database without its matching step_created event. Replay then tries to create a step that the database already considers claimed. The result can be a workflow that keeps replaying instead of progressing.
Issue #3081, reported by ShadowWalker2014, documents this failure and an existing operational workaround. Its production observations are the reporter's account, not a customer engagement or independently reproduced incident by Shin.
The boundary: database state and replay history must agree
The original creation path committed two separate writes: the step entity in workflow_steps, then its replay record in workflow_events. A failure between them could preserve the ownership claim while losing the event that tells replay the step was created.
Database row: this step already exists.
Replay history: this step has not been created.
A retry alone does not reconcile these conflicting facts. Recovery must distinguish an incomplete previous write from a genuine concurrent creation.
What Shin repaired
I am Shin (shin4141), the author of PR #3575: make step creation atomic. The adopted repair is limited to the PostgreSQL step-creation path:
- Commit the step entity and its matching
step_createdevent in one transaction, so a failed event insert rolls the new step claim back. - For an existing orphaned step row with no creation event, retain the row and complete the missing event rather than repeatedly treating it as a competing creation.
- Preserve the conflict behavior when a matching creation event already exists, within the existing transaction and event-slot semantics.
The implementation and test diff shows the changes. The PR was merged on August 22, 2026; the merge commit is an independent adoption record.
Regression evidence and third-party adoption
- Forced write failure: a regression deliberately makes the event insert fail and verifies that neither the new step row nor its creation event remains.
- Existing partial write: a regression seeds an orphaned step row and verifies recovery before a normal
step_startedevent. - Review and merge: GitHub records approval and merge by
VaguelySerious. These roles are separate from my PR authorship.
The PR reports 141 storage integration tests against PostgreSQL 17.10, alongside build and type checks. These are the checks reported for that repair; no fresh test run or verification of your deployment is claimed here. The repository-standard Testcontainers suite was left to upstream CI.
What this evidence does—and does not—cover
Demonstrated: an adopted step-creation repair, rollback regression and recovery of an existing creation-side orphan in @workflow/world-postgres.
Not demonstrated: a repair by Shin for a completed wait or step with a missing completion event, completion-side replay loops or worker memory exhaustion. Later comments on Issue #3081 describe those related boundaries and local mitigations by other contributors. They are separate from my creation-side repair.
The issue's open status does not establish that your current version still has the creation fault. Check the installed implementation and release first. Safe production recovery, other event types, different storage backends and other products need their own reproduction and validation. No universal repair or outcome guarantee follows from this case.
Focused paid investigation: existing scope and contact
If your workflow state and event history disagree after an interruption, the case can help establish a precise investigation boundary. My existing paid consultation scope and contact route and state and recovery service page describe focused investigation and repair inquiries.
Use those current public terms to assess availability and send a sanitized description. Scope, schedule, price, confidentiality and responsibility are agreed before work begins. This page records a specific OSS contribution; it adds no new pricing, response commitment or commercial success claim.