Repository navigation
Conversation
schedule_new_workflow and schedule_new_workflow_with_result, sync and aio, take ordering=WorkflowOrdering(key, on_predecessor_failure) to queue the workflow behind the other workflows of its app started with the same key. OrderingFailurePolicy (CONTINUE, BLOCK, CANCEL) sets what the workflow does when the workflow before it did not complete successfully. Both are exported from dapr.ext.workflow. The request carries an ordering only when one is given. Regenerates the durabletask stubs from durabletask-protobuf 9a0ac7b, the merge of WorkflowOrdering, and records it in PROTO_SOURCE_COMMIT_HASH. That commit also carries the workflow schedule service (workflow_schedule_pb2 and the *WorkflowSchedule RPCs), which had not been generated here yet. Signed-off-by: joshvanl <me@joshvanl.dev>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1391 +/- ##
==========================================
- Coverage 88.72% 88.40% -0.33%
==========================================
Files 166 168 +2
Lines 13632 13744 +112
==========================================
+ Hits 12095 12150 +55
- Misses 1537 1594 +57 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The ordering tests omit the sync and async schedule_new_workflow_with_result paths, leaving request key, failure policy, and returned instance ID and staged flag behavior unverified.
1 open issue
5 files not reviewed
dapr/ext/workflow/_durabletask/internal/backend_service_pb2.py: Generated filedapr/ext/workflow/_durabletask/internal/history_events_pb2.py: Generated filedapr/ext/workflow/_durabletask/internal/orchestration_pb2.py: Generated filedapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.py: Generated filedapr/ext/workflow/_durabletask/internal/workflow_schedule_pb2.py: Generated file
What changed in this PR
Adds optional keyed workflow ordering to the Dapr Python SDK’s synchronous and asynchronous scheduling APIs.
Changes:
- Exports
WorkflowOrderingand failure policies, forwarding ordering through both scheduling variants. - Regenerates durabletask bindings for ordering and workflow schedule services.
- Adds ordering-forwarding and request-presence tests.
| File | Description |
|---|---|
| tests/ext/workflow/test_workflow_client.py | Tests synchronous ordering forwarding. |
| tests/ext/workflow/test_workflow_client_aio.py | Tests asynchronous ordering forwarding. |
| tests/ext/workflow/durabletask/test_client_routing.py | Checks ordering in start requests. |
| dapr/ext/workflow/workflow_ordering.py | Defines ordering options and failure policies. |
| dapr/ext/workflow/dapr_workflow_client.py | Adds ordering to synchronous scheduling APIs. |
| dapr/ext/workflow/aio/dapr_workflow_client.py | Adds ordering to asynchronous scheduling APIs. |
| dapr/ext/workflow/_durabletask/internal/workflow_schedule_pb2.pyi | Adds schedule message type stubs. |
| dapr/ext/workflow/_durabletask/internal/workflow_schedule_pb2.py | Adds generated schedule messages. |
| dapr/ext/workflow/_durabletask/internal/workflow_schedule_pb2_grpc.py | Adds generated gRPC compatibility checks. |
| dapr/ext/workflow/_durabletask/internal/PROTO_SOURCE_COMMIT_HASH | Records the updated protobuf source revision. |
| dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.pyi | Types ordering and instance-prefix fields. |
| dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.py | Updates request and service descriptors. |
| dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2_grpc.py | Adds workflow schedule RPC bindings. |
| dapr/ext/workflow/_durabletask/internal/orchestration_pb2.pyi | Types ordering messages and policies. |
| dapr/ext/workflow/_durabletask/internal/orchestration_pb2.py | Generates ordering messages and policies. |
| dapr/ext/workflow/_durabletask/internal/history_events_pb2.pyi | Types ordering on execution-start events. |
| dapr/ext/workflow/_durabletask/internal/history_events_pb2.py | Adds ordering to execution-start descriptors. |
| dapr/ext/workflow/_durabletask/internal/backend_service_pb2.pyi | Types backend ordering metadata. |
| dapr/ext/workflow/_durabletask/internal/backend_service_pb2.py | Generates backend ordering metadata. |
| dapr/ext/workflow/_durabletask/client.py | Forwards ordering into synchronous start requests. |
| dapr/ext/workflow/_durabletask/aio/client.py | Forwards ordering into asynchronous start requests. |
| dapr/ext/workflow/__init__.py | Exports public ordering types. |
Review effort: Balanced
| instance_id=instance_id, | ||
| start_at=start_at, | ||
| app_id=app_id, | ||
| ordering=ordering.to_proto() if ordering is not None else None, |
v0.8.0 is the first release with WorkflowOrdering. PROTO_SOURCE_COMMIT_HASH records its commit. The release also carries the proto additions after the ordering merge: workflow priority, history propagation scope, the activity completion worker capability and the name and version of a detached instance. Signed-off-by: joshvanl <me@joshvanl.dev>
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.

schedule_new_workflow and schedule_new_workflow_with_result, sync and
aio, take ordering=WorkflowOrdering(key, on_predecessor_failure) to queue
the workflow behind the other workflows of its app started with the same
key. OrderingFailurePolicy (CONTINUE, BLOCK, CANCEL) sets what the
workflow does when the workflow before it did not complete successfully.
Both are exported from dapr.ext.workflow. The request carries an ordering
only when one is given.
Regenerates the durabletask stubs from durabletask-protobuf v0.8.0, the
first release with WorkflowOrdering, and records its commit in
PROTO_SOURCE_COMMIT_HASH. The release also carries the workflow schedule
service (workflow_schedule_pb2 and the *WorkflowSchedule RPCs) and the
other proto additions since the last regeneration, which had not been
generated here yet.