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

[Workflow] Improvements to Dapr Client APIs for Workflow #1027

Closed
Tracked by #6111
cgillum opened this issue Feb 8, 2023 · 2 comments · Fixed by #1087
Closed
Tracked by #6111

[Workflow] Improvements to Dapr Client APIs for Workflow #1027

cgillum opened this issue Feb 8, 2023 · 2 comments · Fixed by #1087
Milestone

Comments

@cgillum
Copy link
Contributor

cgillum commented Feb 8, 2023

Describe the proposal

I'm proposing we make the following changes to the workflow management APIs in the .NET Dapr client. This is based on the feedback we got from the v1.10 alpha release of the workflow management APIs.

  • In StartWorkflowAsync, make instanceId and input parameters optional.
public abstract Task<WorkflowReference> StartWorkflowAsync(
    string workflowComponent,
    string workflowName,
    string? instanceId = null,
    object? input = null,
    IReadOnlyDictionary<string, string> workflowOptions = default,
    CancellationToken cancellationToken = default);
  • Replace GetWorkflowResponse with WorkflowState from the authoring SDK
  • Add WorkflowFailureDetails property to WorkflowState so that users can obtain more information about a workflow failure.
public record WorkflowFailureDetails(
    string ErrorType,
    string ErrorMessage,
    string? StackTrace,
    WorkflowFailureDetails? InnerFailure)
  • Add the following methods to DaprClient:
// Waits for a workflow to start running and then returns the state associated with that workflow
public WorkflowState WaitForWorkflowStartAsync(
    string instanceId,
    bool fetchPayloads = false,
    CancellationToken cancellationToken = default);

// Wait for workflow the workflow to run to completion, be terminated, or fail
public WorkflowState WaitForWorkflowCompletionAsync(
    string instanceId,
    bool fetchPayloads = true,
    CancellationToken cancellationToken = default);

/cc @nyemade-uversky

@nyemade-uversky nyemade-uversky added this to To do (1.11) in Dapr Workflows Mar 8, 2023
@nyemade-uversky nyemade-uversky moved this from To do to 1.11 Release Backlog in Dapr Workflows Mar 13, 2023
@cgillum cgillum moved this from 1.11 Release Backlog to In progress in Dapr Workflows Apr 10, 2023
@cgillum
Copy link
Contributor Author

cgillum commented May 9, 2023

As part of this work, we should also update the console app sample to use the updated Dapr client instead of workflow engine client. That will help us be confident that the new API surface area is sufficient for real use.

@msfussell
Copy link
Member

I also added this issue in the Quickstarts repo dapr/quickstarts#830

Dapr Workflows automation moved this from In progress to Done May 12, 2023
@halspang halspang added this to the v1.11 milestone Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants