conductor-csharp
1.2.0
dotnet add package conductor-csharp --version 1.2.0
NuGet\Install-Package conductor-csharp -Version 1.2.0
<PackageReference Include="conductor-csharp" Version="1.2.0" />
<PackageVersion Include="conductor-csharp" Version="1.2.0" />
<PackageReference Include="conductor-csharp" />
paket add conductor-csharp --version 1.2.0
#r "nuget: conductor-csharp, 1.2.0"
#:package conductor-csharp@1.2.0
#addin nuget:?package=conductor-csharp&version=1.2.0
#tool nuget:?package=conductor-csharp&version=1.2.0
Conductor OSS C# SDK
The conductor-csharp repository provides the client SDKs to build task workers in C#.
Building the task workers in C# mainly consists of the following steps:
- Setup
conductor-csharppackage - Create and run task workers
- Create workflows using code
- API Documentation
⭐ Conductor OSS
Show support for the Conductor OSS. Please help spread the awareness by starring Conductor repo.
Start Conductor Server
If you don't already have a Conductor server running, start one with Docker:
docker run --init -p 8080:8080 conductoross/conductor:latest
The UI will be available at http://localhost:8080 and the API at http://localhost:8080/api.
Setup Conductor C# Package
dotnet add package conductor-csharp
Hello World
This quickstart shows the full flow: define a worker, define a workflow, register it, run it.
Step 1: Create a new console project
dotnet new console -n conductor-hello
cd conductor-hello
dotnet add package conductor-csharp
Step 2: Replace Program.cs with the following
using Conductor.Client;
using Conductor.Client.Extensions;
using Conductor.Client.Worker;
using Conductor.Definition;
using Conductor.Definition.TaskType;
using Conductor.Executor;
// Configure the SDK — reads CONDUCTOR_SERVER_URL from the environment,
// or falls back to a local server.
var configuration = new Configuration
{
BasePath = Environment.GetEnvironmentVariable("CONDUCTOR_SERVER_URL")
?? "http://localhost:8080/api"
};
// Define the workflow: one SIMPLE task called "greet".
var workflow = new ConductorWorkflow()
.WithName("greetings")
.WithVersion(1);
var greetTask = new SimpleTask("greet", "greet_ref")
.WithInput("name", workflow.Input("name"));
workflow.WithTask(greetTask);
// Register the workflow definition on the server.
var executor = new WorkflowExecutor(configuration);
executor.RegisterWorkflow(workflow, overwrite: true);
// Start the worker host — it discovers GreetWorker automatically.
var host = WorkflowTaskHost.CreateWorkerHost(
Microsoft.Extensions.Logging.LogLevel.Information,
new GreetWorker());
await host.StartAsync();
// Run the workflow and print the execution ID.
var workflowId = executor.StartWorkflow(new StartWorkflowRequest
{
Name = "greetings",
Version = 1,
Input = new Dictionary<string, object> { ["name"] = "Conductor" }
});
Console.WriteLine($"Started workflow: {workflowId}");
Console.WriteLine($"View execution: http://localhost:8080/execution/{workflowId}");
// Keep the worker running until Ctrl-C.
await host.WaitForShutdownAsync();
Step 3: Add the worker class — create GreetWorker.cs
using Conductor.Client.Extensions;
using Conductor.Client.Interfaces;
using Conductor.Client.Models;
using Conductor.Client.Worker;
using Task = Conductor.Client.Models.Task;
public class GreetWorker : IWorkflowTask
{
public string TaskType => "greet";
public WorkflowTaskExecutorConfiguration WorkerSettings { get; } = new();
public TaskResult Execute(Task task)
{
var name = task.InputData.GetValueOrDefault("name")?.ToString() ?? "World";
var result = task.Completed();
result.OutputData = new Dictionary<string, object>
{
["greeting"] = $"Hello, {name}!"
};
return result;
}
}
Step 4: Run it
dotnet run
Expected output:
Started workflow: <workflow-id>
View execution: http://localhost:8080/execution/<workflow-id>
Open the UI link to see the completed execution and its output.
Configurations
Authentication Settings (Optional)
Configure the authentication settings if your Conductor server requires authentication.
- keyId: Key for authentication.
- keySecret: Secret for the key.
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
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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- JsonSubTypes (>= 2.0.1)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.Hosting (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Newtonsoft.Json (>= 13.0.3)
- OpenTelemetry (>= 1.15.1)
- OpenTelemetry.Exporter.Prometheus.HttpListener (>= 1.15.1-beta.1)
- RestSharp.Serializers.NewtonsoftJson (>= 112.1.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Diagnostics.DiagnosticSource (>= 10.0.0)
- System.Net.Http.Json (>= 6.0.0)
- System.Text.Json (>= 8.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on conductor-csharp:
| Package | Downloads |
|---|---|
|
Agentspan
Agentspan .NET SDK — durable, scalable, observable AI agents |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 78 | 6/24/2026 |
| 1.1.4 | 50,746 | 9/11/2025 |
| 1.1.3 | 96,306 | 5/20/2025 |
| 1.1.2 | 2,454 | 4/21/2025 |
| 1.1.1 | 18,905 | 1/17/2025 |
| 1.1.0 | 15,560 | 12/9/2024 |
| 1.0.15 | 46,658 | 6/6/2024 |
| 1.0.14 | 137,379 | 3/19/2024 |
| 1.0.13 | 5,150 | 1/4/2024 |
| 1.0.12 | 40,676 | 8/29/2023 |
| 1.0.11 | 21,041 | 5/11/2023 |
| 1.0.10 | 356 | 5/11/2023 |
| 1.0.9 | 365 | 5/9/2023 |
| 1.0.8 | 376 | 5/8/2023 |
| 1.0.7 | 1,629 | 3/23/2023 |
| 1.0.6 | 406 | 3/22/2023 |
| 1.0.5 | 423 | 3/22/2023 |
| 1.0.4 | 482 | 3/16/2023 |
| 1.0.3 | 435 | 3/15/2023 |
| 1.0.2 | 442 | 3/15/2023 |