danielgerlag /workflow-core

Lightweight workflow engine for .NET Standard

★ 5,938⑂ 1,260👁 219⑃ 393● 929▤ 39
C#MITCreated 2016-11-15
Download: v3.22.0v3.22.0 ↓3.22.02026-10-30
+0
Daily
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

Discussions

Latest release

v3.22.0 v3.22.0 2026-10-30
What'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 (

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON