workflow-core is a free, open source orchestration & scheduling project written in C# and released under MIT. It has 5,926 GitHub stars, 1,262 forks and 133 open issues, and was last pushed yesterday. On this registry it ranks #28 of 64 tracked projects in Orchestration & Scheduling, with 5 head-to-head comparisons available. It gained 1 stars over the last 3 tracked days.

What is workflow-core?

What it is

Workflow Core is a lightweight, embeddable workflow engine targeting .NET Standard, written in C# and released under the MIT license. It lives in the .NET ecosystem, distributed as NuGet packages, and is built around the idea of long-running processes that contain multiple tasks and must track their state between steps. Rather than running as a separate server, it is a library that is hosted inside an application, and it exposes a fluent C# API for defining workflows. Workflows are expressed as a starting step followed by chained steps, and the same class can declare inputs and outputs that move data from one step to the next.

The concrete problem it solves is state management for work that cannot finish in a single request. A process that creates a user, waits for an external confirmation event, and then assigns a resource cannot be held in memory while the wait happens. Workflow Core persists that state between steps through pluggable persistence providers, and it supports pluggable concurrency providers so the engine can run across multi-node clusters. It also handles failures and reversals: steps can be configured with retry policies, and saga transactions let a workflow declare compensating steps that run when something fails, which matters when several side effects must be undone together.

Key capabilities

  • Fluent C# API for defining workflows through an IWorkflow implementation and a builder that chains steps with StartWith, Then, Input, and Output.
  • JSON and YAML workflow definitions through the WorkflowCore.DSL package, for teams that prefer declaring processes as data rather than code.
  • Saga transactions: a saga block can chain steps with matching CompensateWith steps, and an OnError handler applies WorkflowErrorHandling.Retry with a configured delay.
  • Persistence providers published as separate NuGet packages for MongoDB, Cosmos DB, Amazon DynamoDB, SQL Server, PostgreSQL, Sqlite, MySQL, Redis, and Oracle.
  • Pluggable search index providers, with Elasticsearch available as a separate NuGet package, so workflow data and state can be indexed and searched.
  • External event waiting through WaitFor, which suspends a workflow until a named event arrives for a given correlation value.
  • Extensions for Azure AI Foundry and for user, meaning human, workflows, plus a related stand-alone workflow server project named Conductor that uses Workflow Core internally.

Who uses it and how

  • Applications that model a new user signup as a workflow: create the account, wait for a confirmation event keyed on the user ID, then continue to the next step.
  • Systems that need distributed transaction semantics, using saga blocks with compensating steps and retry error handling instead of rolling their own rollback logic.
  • Deployments that run the engine on more than one node, using a shared persistence provider and a concurrency provider so only one node advances a given workflow.
  • Teams that keep workflow definitions out of compiled code, authoring them in JSON or YAML and loading them through the DSL package.
  • Operations that want to query process state, plugging in the Elasticsearch provider to index workflows and search against their data and state.

Getting started

The engine is consumed as a NuGet package from the .NET ecosystem, and each persistence or search provider is installed as its own separate NuGet package. Workflow definitions can be written in C# with the fluent API or supplied as JSON or YAML once the WorkflowCore.DSL package is added; the tutorial lives at

project readme (upstream, from github) — read inline

Workflow Core

Build status

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.

public class MyWorkflow : IWorkflow
{
    public void Build(IWorkflowBuilder<MyData> builder)
    {    
        builder
           .StartWith<Task1>()
           .Then<Task2>()
           .Then<Task3>();
    }
}

JSON / YAML Workflow Definitions

Define your workflows in JSON or YAML, need to install WorkFlowCore.DSL

{
  "Id": "HelloWorld",
  "Version": 1,
  "Steps": [
    {
      "Id": "Hello",
      "StepType": "MyApp.HelloWorld, MyApp",
      "NextStepId": "Bye"
    },        
    {
      "Id": "Bye",
      "StepType": "MyApp.GoodbyeWorld, MyApp"
    }
  ]
}
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
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<MyData> builder)
    {    
        builder
            .StartWith<CreateUser>()
                .Input(step => step.Email, data => data.Email)
                .Input(step => step.Password, data => data.Password)
                .Output(data => data.UserId, step => step.UserId)
           .Then<SendConfirmationEmail>()
               .WaitFor("confirmation", data => data.UserId)
           .Then<UpdateUser>()
               .Input(step => step.UserId, data => data.UserId);
    }
}
  • Saga Transactions
public class MyWorkflow : IWorkflow
{
    public void Build(IWorkflowBuilder<MyData> builder)
    {    
        builder
            .StartWith<CreateCustomer>()
            .Then<PushToSalesforce>()
                .OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))
            .Then<PushToERP>()
                .OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10));
    }
}
builder
    .StartWith<LogStart>()
    .Saga(saga => saga
        .StartWith<Task1>()
            .CompensateWith<UndoTask1>()
        .Then<Task2>()
            .CompensateWith<UndoTask2>()
        .Then<Task3>()
            .CompensateWith<UndoTask3>()
    )
    .OnError(Models.WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))
    .Then<LogEnd>();

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.

Search

A search index provider can be plugged in to Workflow Core, enabling you to index your workflows and search against the data and state of them. These are also available as separate Nuget packages.

Extensions

Samples

Contributors

  • Daniel Gerlag - Initial work
  • Jackie Ja
  • Aaron Scribner
  • Roberto Paterlini

Related Projects

  • Conductor (Stand-alone workflow server built on Workflow Core)

Ports

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Frequently asked questions

Is workflow-core free to use?

workflow-core is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does workflow-core do?

Lightweight workflow engine for .NET Standard

What is workflow-core written in?

workflow-core is primarily written in C#. Its source is publicly available at https://github.com/danielgerlag/workflow-core, and it has 5,926 GitHub stars.