danielgerlag /workflow-core
Lightweight workflow engine for .NET Standard
★ 5,938⑂ 1,260👁 219⑃ 393● 929▤ 39
+0
日增长
5,938
stars
1,260
forks
219
watchers
393
prs
929
issues
39
releases
README
Workflow Core
Workflow Core is a light weight embeddable workflow engine targeting .NET Standard. Think: long running processes with multiple tasks that need to track state. It supports pluggable persistence and concurrency providers to allow for multi-node clusters.
Announcements
New related project: Conductor
Conductor is a stand-alone workflow server as opposed to a library that uses Workflow Core internally. It exposes an API that allows you to store workflow definitions, track running workflows, manage events and define custom steps and scripts for usage in your workflows.
https://github.com/danielgerlag/conductor
Documentation
See Tutorial here.
Fluent API
Define your workflows with the fluent API.
c
public class MyWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith()
.Then()
.Then();
}
}
JSON / YAML Workflow Definitions
Define your workflows in JSON or YAML, need to install WorkFlowCore.DSL
json
{
"Id": "HelloWorld",
"Version": 1,
"Steps": [
{
"Id": "Hello",
"StepType": "MyApp.HelloWorld, MyApp",
"NextStepId": "Bye"
},
{
"Id": "Bye",
"StepType": "MyApp.GoodbyeWorld, MyApp"
}
]
}
yaml
Id: HelloWorld
Version: 1
Steps:
- Id: Hello
StepType: MyApp.HelloWorld, MyApp
NextStepId: Bye
- Id: Bye
StepType: MyApp.GoodbyeWorld, MyApp
Sample use cases
New user workflow
c
public class MyData
{
public string Email { get; set; }
public string Password { get; set; }
public string UserId { get; set; }
}
public class MyWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith()
.Input(step = step.Email, data = data.Email)
.Input(step = step.Password, data = data.Password)
.Output(data = data.UserId, step = step.UserId)
.Then()
.WaitFor("confirmation", data = data.UserId)
.Then()
.Input(step = step.UserId, data = data.UserId);
}
}
Saga Transactions
c
public class MyWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith()
.Then()
.OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))
.Then()
.OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10));
}
}
c
builder
.StartWith()
.Saga(saga = saga
.StartWith()
.CompensateWith()
.Then()
.CompensateWith()
.Then()
.CompensateWith()
)
.OnError(Models.WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))
.Then();
Persistence
Since workflows are typically long running processes, they will need to be persisted to storage between steps.
There are several persistence providers available as separate Nuget packages.
MemoryPersistenceProvider (Top issues
#1152Can't seem to progress Step with WaitForEvent6 comments · 2023-03-15#1189Strange behavior after Decide/Branch step - seems like interleaved execution5 comments · 2023-07-20#1155NullReferenceException after upgrading 3.4.0 -> 3.8.15 comments · 2023-03-21#1028Workflow slow when the count of the execution point more and more5 comments · 2022-04-08#1352Workflow execution stuck in queue4 comments · 2025-04-15#1246How to achieve a better process rollback workflow4 comments · 2024-03-07#1032`WorkflowHost.Stop()` does not shut down the host gracefully, may lose persistence4 comments · 2022-05-06#1402WorkflowHost Completes Exit Before Steps Within Workload Can Attempt To Stop Gracefully3 comments · 2025-10-13
Discussions
#1456Is there a supported GUI to design the wf?1 comments · 2026-10-23#1442GetWorkflowInstances API deprecation0 comments · 2026-09-07#1420Why is missing InstanceId(WorkflowId) or PersistenceId from Workflow in Event?1 comments · 2026-03-27#1411How to loop back to previous step until condition is met and to stop on a wait event every time?0 comments · 2025-12-29#1410How to use data.Params["paramKey"] in Step Input expression?1 comments · 2025-12-23#1396Parallel step does not finish in a scenario when host is restarted?0 comments · 2025-09-24#1351Waiting for multiple events?0 comments · 2025-04-07#1348DSL vs WorkflowDefinition0 comments · 2025-03-31
Latest release
v3.22.0 v3.22.0 2026-10-30What's Changed - Redis queue provider: choose LIST (default) or ZSET storage; ZSET uses ZADD NX + ZPOPMIN for atomic de-duplicated enqueue (1447) - Quarantine workflow instances that repeatedly fail to load instead of re-polling them forever (1451, 1452) - New package WorkflowCore.AI: ChatClientStep for calling any model through the Microsoft.Extensions.AI IChatClient abstraction (1453) - Flaky test fixes: sync-middleware test, EventOrderScenario event-ordering race, user-action snapshot retry (1455), StopAsyncScenario timing (1458) - Fix unbounded completed-task retention in queue consumers (