conductor-csharp
0.0.1
See the version list below for details.
dotnet add package conductor-csharp --version 0.0.1
NuGet\Install-Package conductor-csharp -Version 0.0.1
<PackageReference Include="conductor-csharp" Version="0.0.1" />
<PackageVersion Include="conductor-csharp" Version="0.0.1" />
<PackageReference Include="conductor-csharp" />
paket add conductor-csharp --version 0.0.1
#r "nuget: conductor-csharp, 0.0.1"
#:package conductor-csharp@0.0.1
#addin nuget:?package=conductor-csharp&version=0.0.1
#tool nuget:?package=conductor-csharp&version=0.0.1
conductor-csharp
Netflix Conductor Client SDK
To find out more about Conductor visit: https://github.com/Netflix/conductor
conductor-csharp repository provides the client SDKs to build Task Workers in C#
Quick Start
Write workers
internal class MyWorkflowTask : IWorkflowTask
{
public MyWorkflowTask(){}
public string TaskType => "test_ctask";
public int? Priority => null;
public async Task<TaskResult> Execute(Conductor.Client.Models.Task task, CancellationToken token)
{
Dictionary<string, object> newOutput = new Dictionary<string, object>();
newOutput.Add("output", "1");
return task.Completed(task.OutputData.MergeValues(newOutput));
}
}
internal class MyWorkflowTask2 : IWorkflowTask
{
public MyWorkflowTask2(){}
public string TaskType => "test_ctask2";
public int? Priority => null;
public async Task<TaskResult> Execute(Conductor.Client.Models.Task task, CancellationToken token)
{
Dictionary<string, object> newOutput = new Dictionary<string, object>();
//Reuse the existing code written in C#
newOutput.Add("output", "success");
return task.Completed(task.OutputData.MergeValues(newOutput));
}
}
Run workers
Create main method that does the following:
- Adds configurations such as metrics, authentication, thread count, Conductor server URL
- Add your workers
- Start the workers to poll for work
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Conductor.Client.Models;
using Conductor.Client.Extensions;
using Conductor.Client.Interfaces;
using Task = System.Threading.Tasks.Task;
namespace SimpleConductorWorker
{
class Program
{
static async Task Main(string[] args)
{
await new HostBuilder()
.ConfigureServices((ctx, services) =>
{
# Conductor server url
services.AddConductorWorker((config) =>
{
config.ServerUrl = new Uri("http://localhost:8080/api/");
});
# Optionally, if you are using Conductor server that requires authentication, setup key_id and secret
config.AuthenticationClient = new Conductor.Client.AuthenticationClient()
{
keyId = "key",
keySecret = "secret"
};
services.AddConductorWorkflowTask<MyWorkflowTask>();
services.AddHostedService<WorkflowsWorkerService>();
})
.ConfigureLogging(logging =>
{
logging.SetMinimumLevel(LogLevel.Debug);
logging.AddConsole();
})
.RunConsoleAsync();
}
}
internal class WorkflowsWorkerService : BackgroundService
{
private readonly IWorkflowTaskCoordinator workflowTaskCoordinator;
private readonly IEnumerable<IWorkflowTask> workflowTasks;
public WorkflowsWorkerService(
IWorkflowTaskCoordinator workflowTaskCoordinator,
IEnumerable<IWorkflowTask> workflowTasks
)
{
this.workflowTaskCoordinator = workflowTaskCoordinator;
this.workflowTasks = workflowTasks;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
foreach (var worker in workflowTasks)
{
workflowTaskCoordinator.RegisterWorker(worker);
}
# start all the workers so that it can poll for the tasks
await workflowTaskCoordinator.Start();
}
}
}
Save above code with workers code in Program.cs and run it using consoleApplication. Alternatively it can also be hosted as windows service.
Running Conductor server locally in 2-minute
More details on how to run Conductor see https://netflix.github.io/conductor/server/
Use the script below to download and start the server locally. The server runs in memory and no data saved upon exit.
export CONDUCTOR_VER=3.5.2
export REPO_URL=https://repo1.maven.org/maven2/com/netflix/conductor/conductor-server
curl $REPO_URL/$CONDUCTOR_VER/conductor-server-$CONDUCTOR_VER-boot.jar \
--output conductor-server-$CONDUCTOR_VER-boot.jar; java -jar conductor-server-$CONDUCTOR_VER-boot.jar
Execute workers
Run above program as console app or windows service
Create your first workflow
Now, let's create a new workflow and see your task worker code in execution!
Create a new Task Metadata for the worker you just created
curl -X 'POST' \
'http://localhost:8080/api/metadata/taskdefs' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '[{
"name": "test_ctask",
"description": "C# task example",
"retryCount": 3,
"retryLogic": "FIXED",
"retryDelaySeconds": 10,
"timeoutSeconds": 300,
"timeoutPolicy": "TIME_OUT_WF",
"responseTimeoutSeconds": 180,
"ownerEmail": "example@example.com"
}]'
Create a workflow that uses the task
curl -X 'POST' \
'http://localhost:8080/api/metadata/workflow' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"name": "workflow_with_csharp_task_example",
"description": "Workflow with C# Task example",
"version": 1,
"tasks": [
{
"name": "test_ctask",
"taskReferenceName": "test_ctask",
"inputParameters": {},
"type": "SIMPLE"
}
],
"inputParameters": [],
"outputParameters": {
"workerOutput": "${test_ctask.output}"
},
"schemaVersion": 2,
"restartable": true,
"ownerEmail": "example@example.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0
}'
Start a new workflow execution
curl -X 'POST' \
'http://localhost:8080/api/workflow/workflow_with_csharp_task_example?priority=0' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{}'
| 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
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Newtonsoft.Json (>= 13.0.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http.Json (>= 6.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on conductor-csharp:
| Package | Downloads |
|---|---|
|
conductor-ai
Durable AI agents SDK for Conductor |
|
|
Agentspan
Agentspan .NET SDK — durable, scalable, observable AI agents |
|
|
conductor-agent-sdk
Conductor Agent .NET SDK — durable, scalable, observable AI agents |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 7,047 | 8/3/2026 |
| 3.0.0-rc3 | 249 | 7/29/2026 |
| 3.0.0-rc2 | 186 | 7/18/2026 |
| 3.0.0-rc1 | 103 | 7/14/2026 |
| 2.0.1 | 3,711 | 7/14/2026 |
| 2.0.0 | 446 | 7/9/2026 |
| 1.2.0 | 13,526 | 6/24/2026 |
| 1.1.4 | 78,678 | 9/11/2025 |
| 1.1.3 | 121,113 | 5/20/2025 |
| 1.1.2 | 2,502 | 4/21/2025 |
| 1.1.1 | 20,495 | 1/17/2025 |
| 1.1.0 | 23,315 | 12/9/2024 |
| 1.0.15 | 47,092 | 6/6/2024 |
| 1.0.14 | 142,231 | 3/19/2024 |
| 1.0.13 | 5,291 | 1/4/2024 |
| 1.0.12 | 43,005 | 8/29/2023 |
| 1.0.11 | 21,232 | 5/11/2023 |
| 1.0.10 | 384 | 5/11/2023 |
| 1.0.9 | 391 | 5/9/2023 |
| 0.0.1 | 762 | 4/6/2022 |