Skip to content

docs(workflow): demonstrate Select in the purchase-order example - #5378

Open
gomitrah wants to merge 1 commit into
dapr:v1.18from
gomitrah:workflow-select-go-example
Open

gomitrah wants to merge 1 commit into
dapr:v1.18from
gomitrah:workflow-select-go-example

Conversation

@gomitrah

@gomitrah gomitrah commented Oct 9, 2026

Copy link
Copy Markdown

Description

Updates the Go example in the "External system interaction" pattern
(workflow-patterns.md) to demonstrate the new WorkflowContext.Select
combinator added in dapr/durabletask-go #131,
per this review comment
asking for Go workflow docs examples of the new function.

The Go PurchaseOrderWorkflow example previously relied on
WaitForExternalEvent's built-in timeout and returned a vague
"error/cancelled", err on timeout. This brings it to parity with the
Python (when_any) and JavaScript (whenAny) versions of the same
example on this page, which already explicitly race the approval event
against a separate timer and return a clean "Cancelled" string.

While rewriting this function, also fixed two calls to
workflow.ActivityInput(order) -- a function that doesn't exist in the
real durabletask-go workflow package -- to the correct
workflow.WithActivityInput(order). These two calls sit directly
inside the function being rewritten for the Select example; the same
incorrect name still appears in ~13 other places across this repo
(workflow-patterns.md, workflow-features-concepts.md,
howto-author-workflow.md, and sdkdocs/go/.../go-client/_index.md),
which is out of scope for this PR and left for a follow-up.

Issue reference

No dapr/docs issue exists for this. Responds to a review request on
dapr/durabletask-go#131.

Signed-off-by: gomitrah <bala.c@mitrahsoft.in>
@gomitrah
gomitrah requested review from a team as code owners October 9, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant