Back to Conductor

C# SDK

docs/documentation/clientsdks/csharp-sdk.md

2019-04-12-13002.6 KB
Original Source

C# SDK

!!! info "Source" GitHub: conductor-oss/csharp-sdk | Report issues and contribute on GitHub.

⭐ Conductor OSS

Show support for the Conductor OSS. Please help spread the awareness by starring Conductor repo.

Setup Conductor C# Package​

shell
dotnet add package conductor-csharp

Configurations

Authentication Settings (Optional)

Configure the authentication settings if your Conductor server requires authentication.

  • keyId: Key for authentication.
  • keySecret: Secret for the key.
csharp
authenticationSettings: new OrkesAuthenticationSettings(
    KeyId: "key",
    KeySecret: "secret"
)

Access Control Setup

See Access Control for more details on role-based access control with Conductor and generating API keys for your environment.

Configure API Client

csharp
using Conductor.Api;
using Conductor.Client;
using Conductor.Client.Authentication;

var configuration = new Configuration() {
    BasePath = basePath,
    AuthenticationSettings = new OrkesAuthenticationSettings("keyId", "keySecret")
};

var workflowClient = configuration.GetClient<WorkflowResourceApi>();

workflowClient.StartWorkflow(
    name: "test-sdk-csharp-workflow",
    body: new Dictionary<string, object>(),
    version: 1
)

Next: Create and run task workers

Examples

Browse all examples on GitHub: conductor-oss/csharp-sdk/csharp-examples

ExampleType
Examplesdirectory
Humantaskexamplesfile
Programfile
Runnerfile
Testworkerfile
Utilsdirectory
Workflowexamplesfile