Skip to content

Commit

Permalink
[docs] Add workflows to .NET client doc (dapr#1019)
Browse files Browse the repository at this point in the history
* add workflows to client page

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
  • Loading branch information
hhunter-ms authored and yash-nisar committed Feb 27, 2023
1 parent 23ba7a2 commit 1cde789
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions daprdocs/content/en/dotnet-sdk-docs/dotnet-client/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,33 @@ await foreach (var items in subscribeConfigurationResponse.Source.WithCancellati
}
```

### Manage workflow instances (Alpha)

```csharp
var daprClient = new DaprClientBuilder().Build();

string instanceId = "MyWorkflowInstance1";
string workflowComponentName = "dapr"; // alternatively, this could be the name of a workflow component defined in yaml
string workflowName = "MyWorkflowDefinition";
var input = new { name = "Billy", age = 30 }; // Any JSON-serializable value is OK
// Start workflow
var startResponse = await daprClient.StartWorkflowAsync(instanceId, workflowComponentName, workflowName, input);

// Terminate workflow
await daprClient.TerminateWorkflowAsync(instanceId, workflowComponentName);

// Get workflow metadata
var getResponse = await daprClient.GetWorkflowAsync(instanceId, workflowComponentName, workflowName);
```

## Sidecar APIs
### Sidecar Health
The .NET SDK provides a way to poll for the sidecar health, as well as a convenience method to wait for the sidecar to be ready.

#### Poll for health
This health endpoint returns true when both the sidecar and your application are up (fully initialized).

```csharp
var client = new DaprClientBuilder().Build();

Expand Down

0 comments on commit 1cde789

Please sign in to comment.