Skip to content

Conversation

@passuied
Copy link
Contributor

@passuied passuied commented Nov 4, 2025

Description

Added async workflow client implementation, leveraging new durabletask.aio.client implementation

Issue reference

#834

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation - Pending Full async support for WorkflowRuntime

@passuied passuied requested review from a team as code owners November 4, 2025 23:31
…k.aio.client implementation

Signed-off-by: Patrick Assuied <[email protected]>
@passuied passuied force-pushed the feature/async-workflow-sdk branch from d32c9aa to d17b262 Compare November 4, 2025 23:31
Signed-off-by: Patrick Assuied <[email protected]>
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 94.39252% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.49%. Comparing base (bffb749) to head (75f3e7c).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
...workflow/dapr/ext/workflow/aio/workflow_runtime.py 80.00% 11 Missing ⚠️
...flow/dapr/ext/workflow/aio/dapr_workflow_client.py 93.33% 4 Missing ⚠️
...pr-ext-workflow/tests/aio/test_workflow_runtime.py 98.30% 2 Missing ⚠️
...apr-ext-workflow/tests/aio/test_workflow_client.py 98.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #861      +/-   ##
==========================================
+ Coverage   86.63%   87.49%   +0.86%     
==========================================
  Files          84       98      +14     
  Lines        4473     6484    +2011     
==========================================
+ Hits         3875     5673    +1798     
- Misses        598      811     +213     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acroca
Copy link
Member

acroca commented Nov 5, 2025

@passuied I think this other PR covers this same thing, and is a bit more complete because it also have async context, but it's WIP as it has lots of lint changes that are now applied to main. I'll ask for a cleanup. Can you have a look at that PR and confirm it'd work for you after the cleaning? focus on the ext/dapr-ext-workflow changes :)

@filintod
Copy link
Contributor

filintod commented Nov 10, 2025

@acroca actually this is a bit different, as this tackles the client initiating actions against a workflow(schedule workflow, signal events), instead of the internals of the workflow that my PR tackles. He did the PR in durabletask that complements this dapr/durabletask-python#17. The PRs his/mine are complementary and not overlapping

Copy link
Member

@acroca acroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'd follow the same pattern as the DaprClient and not have a suffix Async for the async version.

@passuied passuied requested a review from acroca November 11, 2025 18:20
@acroca
Copy link
Member

acroca commented Nov 12, 2025

@passuied Can you add an example to examples/workflow that uses this new client? Maybe something like https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py but async.
Sorry for adding new items to the review, but I didn't think about it when I reviewed yesterday 🤦

Copy link
Member

@acroca acroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but tests are failing, and copyright headers need to be fixed :)

@passuied passuied requested a review from acroca November 17, 2025 16:10
@passuied passuied requested a review from acroca November 17, 2025 16:18
]


class WorkflowRuntime(WorkflowRuntimeSync):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if wrapping the sync runtime is the best course of action here. Instead, it should be natively supported by durabletask it looks like there's been a lot of work, including async support done there. Are you sure it's not already a resolved problem?

Copy link
Contributor Author

@passuied passuied Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akotsarelation I agree that when I look at @filintod's PR, I'm inclined to wait for his work to be complete so we can replace the whole WorkflowRuntime with his full async implementation...
It wasn't so apparent until I worked on the example @acroca and I had to override WorkflowRuntime (but not in an ideal way as I still need the work from that PR)... While the current solution works it does mix sync and async and comes with performance downsides... If this PR is coming soon, I'm inclined to not publish this one and instead wait for the full blown solution....

Copy link
Contributor

@filintod filintod Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the issue is that you were changing not only the client side (dapr_workflow_client) but also the workflowruntime, that yeah you would need something like what I am doing. Was that needed here? as your durabletask PR only dealt with the client side (schedule workflow, etc) and why I said this PR and the durabletask were complementary but not if mixing workflow runtime too.

Copy link
Contributor

@filintod filintod Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if you remove the workflow_runtime and the test_workflow_runtime files, then this PR would be fine. I was under the impression you wanted asyncio support for the client actions (schedule workflow, wait for workflow, raise events, etc). Try in your example to use the regular sync WorkflowRuntime, but use your asyncio awaitable client methods to start the workflow and raise the events via await

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I only added it because I needed to provide an example and without a 'compatible' runtime, it didn't make sense at all...
If @acroca is ok I can revert workflowruntime, and example and we can bring back the example once we have all the pieces in place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as everything in the PR is tested, I'm happy :P If I understand correctly, you'll remove the test_workflow_runtime but will keep the other right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acroca @filintod I removed all additional commits and only left aio.workflow_client and test_workflow_client.

@passuied passuied force-pushed the feature/async-workflow-sdk branch from 75f3e7c to 6b8d7c8 Compare November 22, 2025 02:38
Signed-off-by: Patrick Assuied <[email protected]>
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.

4 participants