"Internal Error" when creating a Workflow immediately after termination within a Durable Object
What versions & operating system are you using?
wrangler version: 4.53.0. We are encountering an internal error when attempting to create a new Workflow immediately after terminating an existing one, specifically when these operations are performed within a Durable Object.
Please provide a link to a minimal reproduction
https://github.com/Kabzeel/cf-workflow-lifecycle-bug
Describe the Bug
Reproduction Steps We have isolated this behavior in a reproduction repository with three variants:
Variant 1 (Fails): A single Durable Object instance terminates an existing workflow and immediately attempts to create a new one. Result: Fails with internal error. Variant 2 (Fails): One Durable Object terminates a workflow, and a separate Durable Object instance immediately attempts to create a new one. Result: Fails with internal error. Variant 3 (Comparison): A Durable Object terminates the workflow, but the creation of the new workflow happens in the Worker's fetch handler. (Note associated with expected behavior vs. actual behavior).
Expected Behavior The workflow creation should succeed regardless of whether it is called from a Durable Object or a Fetch handler, and it should handle the race condition or state update gracefully after a termination.
Actual Behavior The create() call throws an internal error when executed inside the Durable Object immediately following a termination
Please provide any relevant error logs
The error only says - internal error