Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET - How to start a workflow - DaprWorkflowComponent #8016

Closed
panagiotiskompis opened this issue Aug 27, 2024 · 5 comments
Closed

.NET - How to start a workflow - DaprWorkflowComponent #8016

panagiotiskompis opened this issue Aug 27, 2024 · 5 comments

Comments

@panagiotiskompis
Copy link

I have a question regarding the Dapr workflows.

Page: https://docs.dapr.io/getting-started/quickstarts/workflow-quickstart/

await daprClient.StartWorkflowAsync(
workflowComponent: DaprWorkflowComponent,
workflowName: nameof(OrderProcessingWorkflow),
input: orderInfo,
instanceId: orderId);

What is the DaprWorkflowComponent? In the other building blocks like state store, that was the name described in the YAML config
e.g. pub sub

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: name here

Based on the page: https://docs.dapr.io/reference/api/workflow_api/

"However, Dapr comes with a built-in dapr workflow component that is built on Dapr Actors. No component file is required to use the built-in Dapr workflow component."

No component file is required. So what is the name that I should add there since I dont have YAML file? Am I missing something?

@panagiotiskompis
Copy link
Author

It seems that "dapr" is the default value. I didn't find any mention about that anywhere, based on an example I discovered it.
Page: https://docs.dapr.io/developing-applications/building-blocks/workflow/howto-manage-workflow/

Why not adding the default value in the method StartWorkflowAsync?

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale Issues and PRs without response label Oct 27, 2024
@WhitWaldo
Copy link
Contributor

WhitWaldo commented Oct 30, 2024

@panagiotiskompis The various workflow methods on the Dapr.Client will be removed in 1.15. You're encouraged to install and use the Dapr.Workflow package.

Further, there is no StartWorkflowAsync method any longer. Rather, use the ScheduleNewWorkflowAsync method on the DaprWorkflowClient which does not have a DaprWorkflowComponent name argument. The first argument on ScheduleNewWorkflowAsync instead has you provide the name of the workflow you want to start.

@dapr-bot dapr-bot removed the stale Issues and PRs without response label Oct 30, 2024
@panagiotiskompis
Copy link
Author

Thank you for your answer!

@WhitWaldo
Copy link
Contributor

WhitWaldo commented Oct 31, 2024

While they haven't yet been merged, I wrote up several PRs yesterday that demonstrate how to approach the various scenarios described in the documentation using the latest .NET APIs:

Task Chaining
Monitor
External interaction
Async operations
Sub-workflows
Fan in/Fan out

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

No branches or pull requests

3 participants