try/finally around steps: replay consumes the finally step while step_created still belongs to the try step
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start from the divergence error text in the replay engine — search the repo for the message fragment 'belongs to' / 'current step consumer is' to find where a step_created event is matched against the current step consumer, then trace how try/catch/finally constructs push the finally step onto the consumer stack while an awaited step inside try is still pending. Check the scheduler's suspension/resume path for steps awaiting completion, and reproduce with a workflow shaped like the one in the issue (step in try, step in finally, a step_created written for the try step). Done means replay keeps consuming the try step's events until step_completed/step_failed and only then runs the finally step, verified by a replay test that previously produced REPLAY_DIVERGENCE / CORRUPTED_EVENT_LOG.
Written by the indexing model from the issue text.
Description
What happened
A production workflow on Vercel ([email protected], Next.js, world-vercel) failed with CORRUPTED_EVENT_LOG after the automatic recovery budget. The divergent event is a step_created for a step inside try, consumed on replay by the step in finally.
Error: Workflow replay diverged 4 times after 3 recovery replays; latest divergent event was evnt_01M47BPBHPG5TAVN1PKD1SNVR6.
Last divergence: Replay divergence: step event step_created for step_01M47BM6V9W4JTDTY2TMM2HR92 belongs to "step//./src/cms-api/generation/durable/pipelineSteps//generateSectionImagesStep", but the current step consumer is "step//./src/cms-api/generation/durable/pipelineSteps//settleBuiltSectionStep"
errorName: CorruptedEventLogError
errorCode: CORRUPTED_EVENT_LOG
Recovery warnings immediately before that, same run, same event, divergenceCount: 3, maxRecoveryReplays: 3, errorCode: REPLAY_DIVERGENCE.
- Corrupted run:
wrun_01M47BM6HBPPBHY286J10MYGM6 - Deployment:
dpl_EbxN86u6K6HSjm5QDbQ8YxARbJki - When: 2026-10-06T01:01:52Z (divergence) → 2026-10-06T01:01:53Z (corrupted)
- Package:
[email protected](latest 4.x at the time of writing is 4.8.12; 5.0.1 is current)
The parent run kept polling a status step for 3 hours and then timed out. The section run itself never reached step_completed for generateSectionImagesStep.
Workflow shape
"use workflow" with three "use step" calls. reusesShared is a workflow argument, stable across replays. On this run it was false, so the images step was reached and its step_created was written.
export async function sectionWorkflow(input: { reusesShared: boolean }) {
"use workflow"
try {
await writeSectionHtmlStep(input)
if (input.reusesShared) return
await generateSectionImagesStep(input)
} catch (error) {
await recordSectionFailureStep(input)
throw error
} finally {
await settleBuiltSectionStep(input)
}
}
writeSectionHtmlStep had already completed. The next recorded event is step_created for generateSectionImagesStep. Replay then tried to run settleBuiltSectionStep from finally instead of consuming that images step.
Expected
try / catch / finally around steps is documented as normal orchestration (including the child-workflow cookbook, which resumes a hook from finally). Suspending inside try on an in-flight step should not run finally until that step settles. Replay should keep consuming generateSectionImagesStep until step_completed or step_failed, and only then run settleBuiltSectionStep.
Actual
One invocation writes step_created for the images step. The next invocation's step consumer is the finally step. Three recovery replays hit the same event, then the run is marked corrupted. The divergence is not catchable inside the workflow, so the catch step never records the failure either.
https://useworkflow.dev/err/replay-divergence asks for the run id when recovery does not clear CORRUPTED_EVENT_LOG. Happy to pull more of the event log if that helps.
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 401
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 201
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/workflow
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
node-module-esbuild-plugin: getImportedIdentifier only checks the first named import when locating a violationPossibly taken @div-cowboy claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel/workflow#5057 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
code-transform.mdx §ID Generation omits the package-shipped `name@version` ID formPossibly taken @Mohith26 claimed this 113 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
Similar issues
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
device-management-toolkit/sample-web-ui#3711 ·
Maintainers usually reply within 1 day
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/kibana#306401 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentes-chat/agentes-chat#927 ·
Maintainers usually reply within 1 day
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabPossibly taken @seenimohamed claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ardia-browser/ardia#2769 ·
Maintainers usually reply within 1 day