百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

workflow-core

> 编程语言
开源

用于 .NET 标准的轻量级工作流引擎

5.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 .NET 标准的轻量级工作流引擎

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.

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
…
  • 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.

  • MemoryPersistenceProvider (Default provider, for demo and testing purposes)
  • MongoDB
  • Cosmos DB
  • Amazon DynamoDB
  • SQL Server
  • PostgreSQL
  • Sqlite
  • MySQL
  • Redis
  • Oracle

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.

  • Elasticsearch

Extensions

  • Azure AI Foundry
  • User (human) workflows

Samples

  • Hello World

  • Multiple outcomes

  • Passing Data

  • Parallel ForEach

  • Sync ForEach

  • While Loop

  • If Statement

  • Events

  • Activity Workers

  • Parallel Tasks

  • Saga Transactions (with compensation)

  • Scheduled Background Tasks

  • Recurring Background Tasks

  • Dependency Injection

  • Deferred execution & re-entrant steps

  • Human(User) Workflow

  • Looping

  • Exposing a REST API

  • Testing

Contributors

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

Related Projects

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

Ports

  • JWorkflow (Java)
  • workflow-es (Node.js)
  • liteflow (Python)

License

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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#hacktoberfestsagasaga-transactionsworkflow

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言