Skip to content

feat: enable wf to start via just name like go sdk#957

Open
sicoyle wants to merge 2 commits intodapr:mainfrom
sicoyle:fix-name-issue
Open

feat: enable wf to start via just name like go sdk#957
sicoyle wants to merge 2 commits intodapr:mainfrom
sicoyle:fix-name-issue

Conversation

@sicoyle
Copy link
Contributor

@sicoyle sicoyle commented Mar 13, 2026

Description

This PR makes python sdk closer to go sdk in the fact that we can schedule callable workflows as is, in addition to how the go sdk does it via string name for a workflow. see https://github.com/dapr/go-sdk/blob/ff4e5eb454cb837c77fbe5a6648c66d8fa73859f/examples/workflow-parallel/main.go#L46

We need this for dapr agents for users to call to other agents easily.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

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

Signed-off-by: Samantha Coyle <sam@diagrid.io>
@sicoyle sicoyle requested review from a team as code owners March 13, 2026 13:44
Copilot AI review requested due to automatic review settings March 13, 2026 13:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Dapr Workflow Python SDK client to allow starting/scheduling workflows by passing a workflow name string (in addition to passing a workflow callable), aligning the scheduling ergonomics with the Go SDK and enabling simpler cross-agent invocation.

Changes:

  • Extend schedule_new_workflow (sync + aio) to accept workflow: Union[Workflow, str] and resolve the workflow name appropriately.
  • Update docstrings to document the new string-name option.
  • Add unit tests (sync + aio) validating scheduling by workflow name string and that the underlying durabletask client receives the string.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py Accepts a workflow name string and forwards the resolved name into schedule_new_orchestration.
ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py Async equivalent of string-name workflow scheduling.
ext/dapr-ext-workflow/tests/test_workflow_client.py Adds a sync test to ensure scheduling by string name is forwarded correctly.
ext/dapr-ext-workflow/tests/test_workflow_client_aio.py Adds an async test to ensure scheduling by string name is forwarded correctly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.01%. Comparing base (bffb749) to head (58e89c9).
⚠️ Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
...flow/dapr/ext/workflow/aio/dapr_workflow_client.py 83.33% 1 Missing ⚠️
...workflow/dapr/ext/workflow/dapr_workflow_client.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #957      +/-   ##
==========================================
+ Coverage   86.63%   89.01%   +2.38%     
==========================================
  Files          84      103      +19     
  Lines        4473     7367    +2894     
==========================================
+ Hits         3875     6558    +2683     
- Misses        598      809     +211     

☔ 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.

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