An open API service indexing awesome lists of open source software.

https://github.com/thiagomvas/fflow

FFlow is a lightweight, extensible workflow automation library for .NET with fluent, code-first syntax. Built for CI/CD, DevOps, and backend orchestration, it supports dependency injection, branching logic, and step decorators—no XML or DSL required.
https://github.com/thiagomvas/fflow

automation cicd contributions-welcome cqrs csharp developer-tools dotnet fluent-api open-source pipeline workflow workflow-engine

Last synced: 7 months ago
JSON representation

FFlow is a lightweight, extensible workflow automation library for .NET with fluent, code-first syntax. Built for CI/CD, DevOps, and backend orchestration, it supports dependency injection, branching logic, and step decorators—no XML or DSL required.

Awesome Lists containing this project

README

          


FFlow - Code first automations built fluently


















FFlow is a fluent, code-first workflow automation library for .NET. It enables developers to orchestrate automation logic, business rules, and CI/CD pipelines in a fully testable and extensible way.

## Table of Contents
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Quickstart](#quickstart)
- [Features at a glance](#features-at-a-glance)
- [Why it exists](#why-it-exists)
- [Using with Dependency Injection](#using-with-dependency-injection)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

## Installation
You can install FFlow via the Nuget Package Manager or by using the .NET CLI
```bash
dotnet add package FFlow
```

## Quickstart
Getting started with FFlow is easy. Here's an example of how to create a custom step that says 'Hello, FFlow!'. This example includes building a workflow with the builder, configuring it and executing it with an input.
```csharp
public class HelloStep : FlowStep
{
protected override Task ExecuteAsync(IFlowContext context, CancellationToken cancellationToken = default)
{
var input = context.GetInput();
Console.WriteLine($"Hello, {input}!");
return Task.CompletedTask;
}
}

var workflow = new FFlowBuilder()
.StartWith()
.Build();

await workflow.RunAsync("FFlow");
```

## Features at a glance
- **Fluent syntax for flow control:** `StartWith()`, `Then()`, `Finally()`, `If()`, `Fork()`, and more
- **Dependency Injection support:** Inject services into steps via constructor injection
- **Validation utilities:** Write step context validation attributes or steps with the help of `FFlow.Validation`
- **Branching and parallelism:** Run parts of the workflow concurrently with different dispatch strategies
- **Context-aware:** Pass and retrieve dynamic data throughout the workflow
- **Reusable definitions:** Encapsulate workflows into a `IWorkflowDefinition` for factory-like behaviours
- **Lifecycle hooks:** Plug into events like step start, step failure or workflow completion.

## Why it exists
Writing and testing CI/CD pipelines has always been frustrating. It usually went from "waiting to compile" to "waiting for CI/CD", just to realize you missed something, fix it, and rerun the whole thing again. And again.

The feedback loop was too long. Small mistakes led to wasted time, and workflows often lived outside the codebase in YAML files or GUI editors that were hard to test, debug, or reuse.

FFlow was born out of this frustration. **It came from the idea that automation should feel like regular code.** Something you can write fluently, test locally, and plug into your existing services just like anything else in your app.

Tools like `Cake` or `Nuke` solve part of the problem, but I wanted something more structured and flexible. Less about running scripts. More about building flows.

## Using with Dependency Injection
FFlow integrates cleanly with Microsoft.Extensions.DependencyInjection. To enable DI:
```csharp
var services = new ServiceCollection();
services.AddFlow(); // Registers IFlowSteps and IWorkflowDefinitions
services.AddSingleton();

var provider = services.BuildServiceProvider();

var workflow = new FFlowBuilder(provider)
.StartWith()
.Build();
```
Steps can receive services through construction injection:
```csharp
public class StepThatUsesIMyService : FlowStep
{
private readonly IMyService _service;

public StepThatUsesIMyService(IMyService service)
{
_service = service;
}

protected override Task ExecuteAsync(IFlowContext context, CancellationToken ct)
{
var result = _service.DoSomething();
return Task.CompletedTask;
}
}
```

## Testing
FFlow includes unit tests covering key features such as step execution, context flow, branching, validation, and DI integration. All you need to do is run
```
dotnet test
```

## Contributing

Contributions to FFlow are welcome and appreciated. Whether it’s fixing a bug, suggesting an improvement, writing documentation, or proposing a new feature.

If you’ve worked with automation, DevOps, or pipeline tools and thought “this could be easier in code”, you’re in the right place. FFlow is still growing, and there’s a lot of room to help shape what it becomes.

You don’t need to understand the entire codebase to contribute. Most improvements are isolated and straightforward. It's designs allow you to add new steps, small helpers, validation logic, or workflow patterns without knowing everything about the project.

If you have an idea or just want to help, feel free to open an issue, start a discussion, or jump into the code.

## License

FFlow is **free software** and **always will be**, released under the MIT License.
See the [LICENSE](./LICENSE) file for more details.