workflow: seed the guid namespace from history when the request has n… - #1880
Merged
WhitWaldo merged 7 commits intoAug 14, 2026
Merged
Conversation
…o execution ID The worker seeds the orchestration context's deterministic guid namespace from WorkflowRequest.ExecutionId, falling back to the instance ID when it is unset. Sidecars built on durabletask-go never set it, so the fallback always engaged, and TaskExecutionId derivation (seeded by that namespace) produced identical values across different executions of the same instance ID. That collision is not cosmetic: when a completed instance is recreated with the same instance ID (create-if-completed semantics) and the new execution schedules the same task ID and activity name, the runtime's activity de-duplication sees the same TaskExecutionId as the previous execution's completed activity, treats the new scheduling as a redelivery, and acks it without dispatching. No TaskCompleted is ever produced and the recreated workflow is stuck in Running forever, along with any parent awaiting it. Fix: when the request carries no execution ID, recover the runtime-minted execution ID persisted in the history's ExecutionStartedEvent (workflowInstance.executionId). It is stable across replays of one execution, distinct per execution of a recreated instance, and present in histories written by durabletask-go backends. When neither source provides one, behavior is unchanged. Signed-off-by: joshvanl <me@joshvanl.dev>
There was a problem hiding this comment.
Pull request overview
Seeds deterministic workflow GUID generation from the execution ID stored in history when the request omits it, preventing task execution ID collisions across recreated workflow executions.
Changes:
- Recovers the execution ID from the latest
ExecutionStartedEvent. - Passes the recovered ID into
WorkflowOrchestrationContext. - Adds coverage for distinct IDs across executions and stable IDs during replay.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Dapr.Workflow/Worker/WorkflowWorker.cs |
Recovers and applies the persisted execution ID. |
test/Dapr.Workflow.Test/Worker/WorkflowWorkerTests.cs |
Tests task execution ID uniqueness and replay stability. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: joshvanl <me@joshvanl.dev>
Comment on lines
+109
to
+111
| var taskExecutionSeed = !string.IsNullOrWhiteSpace(executionId) ? executionId | ||
| : !string.IsNullOrWhiteSpace(historyExecutionId) ? historyExecutionId | ||
| : instanceId; |
Contributor
There was a problem hiding this comment.
@JoshVanL This seems reasonable - could you make this change?
Signed-off-by: joshvanl <me@joshvanl.dev>
WhitWaldo
approved these changes
Aug 14, 2026
WhitWaldo
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me - thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…o execution ID
The worker seeds the orchestration context's deterministic guid namespace from WorkflowRequest.ExecutionId, falling back to the instance ID when it is unset. Sidecars built on durabletask-go never set it, so the fallback always engaged, and TaskExecutionId derivation (seeded by that namespace) produced identical values across different executions of the same instance ID.
That collision is not cosmetic: when a completed instance is recreated with the same instance ID (create-if-completed semantics) and the new execution schedules the same task ID and activity name, the runtime's activity de-duplication sees the same TaskExecutionId as the previous execution's completed activity, treats the new scheduling as a redelivery, and acks it without dispatching. No TaskCompleted is ever produced and the recreated workflow is stuck in Running forever, along with any parent awaiting it.
Fix: when the request carries no execution ID, recover the runtime-minted execution ID persisted in the history's ExecutionStartedEvent (workflowInstance.executionId). It is stable across replays of one execution, distinct per execution of a recreated instance, and present in histories written by durabletask-go backends. When neither source provides one, behavior is unchanged.