Skip to content

[Backport release-1.18] feat(workflow): align history propagation API with go-sdk#1055

Open
dapr-bot wants to merge 1 commit into
release-1.18from
backport-1047-to-release-1.18
Open

[Backport release-1.18] feat(workflow): align history propagation API with go-sdk#1055
dapr-bot wants to merge 1 commit into
release-1.18from
backport-1047-to-release-1.18

Conversation

@dapr-bot
Copy link
Copy Markdown
Collaborator

Backport 2fd3237 from #1047.

* feat(workflow): align history propagation API with go-sdk

Cassie (durabletask-go author) flagged divergence between python-sdk #1025
and the freshly-renamed go-sdk helpers in durabletask-go #105 (merged
2026-05-19, after #1025 landed). This brings python-sdk's surface back
in line for cross-SDK parity before 1.18 ships.

Read API renames (mirror durabletask-go GetLast*ByName):
- PropagatedHistory.get_workflow_by_name      -> get_last_workflow_by_name
- WorkflowResult.get_activity_by_name         -> get_last_activity_by_name
- WorkflowResult.get_child_workflow_by_name   -> get_last_child_workflow_by_name

Plural variants (get_workflows_by_name, get_activities_by_name,
get_child_workflows_by_name) and the chain-level helpers are unchanged.

Scheduling helpers (mirror go-sdk workflow.PropagateLineage /
workflow.PropagateOwnHistory):
- propagate_lineage()      -> PropagationScope.LINEAGE
- propagate_own_history()  -> PropagationScope.OWN_HISTORY

PropagationScope enum is kept as the underlying value, so both
`propagation=propagate_lineage()` and
`propagation=PropagationScope.LINEAGE` work.

Example, README snippet, and tests updated to use the renamed/new
surface. No runtime/proto changes.

Refs: #1001, dapr/durabletask-go#105, dapr/go-sdk#823
Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>

* refactor(workflow): drop propagate_lineage/propagate_own_history factories

Per review feedback, Go-style factory helpers are not idiomatic Python: they
obscure the actual enum value at the call site and confuse static type
checkers (return annotation only shows PropagationScope, not the specific
member). Use PropagationScope.LINEAGE / PropagationScope.OWN_HISTORY
directly instead.

Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>

---------

Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
(cherry picked from commit 2fd3237)
Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com>
@dapr-bot dapr-bot requested review from a team as code owners May 26, 2026 14:00
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.

2 participants