ActFlow 1.0.6
dotnet add package ActFlow --version 1.0.6
NuGet\Install-Package ActFlow -Version 1.0.6
<PackageReference Include="ActFlow" Version="1.0.6" />
<PackageVersion Include="ActFlow" Version="1.0.6" />
<PackageReference Include="ActFlow" />
paket add ActFlow --version 1.0.6
#r "nuget: ActFlow, 1.0.6"
#:package ActFlow@1.0.6
#addin nuget:?package=ActFlow&version=1.0.6
#tool nuget:?package=ActFlow&version=1.0.6
<p align="center"> <img src="https://github.com/user-attachments/assets/e7750a92-fe96-4742-8327-a34978d587fe" width="200" height="200" /> </p>
ActFlow
ActFlow is a simple, no-code, workflow system that takes in a set of activities and strings them together as workflows. The intention for this is to enable you to run complex business logic by means of script files instead of hardwired integrations. This makes it significantly easier to make workflows such as one for waiting and answering emails, keep a database updated with data an LLM found from an email, integrity check data in a database, etc. The ActFlow engine in of itself is very independent and does not require any complex scheduling system to run.
By its core, it consists of a set of workers and activities. Workers execute activities, while activities define some input data for the workers.
All workers and activities are JSON serializable
To make this work, you must add a modifier to the default TypeInfoResolver for a JsonSerializer instance like this: JsonSerializerOptions(){ TypeInfoResolver = new DefaultJsonTypeInfoResolver().WithAddedModifier(JsonExtensions.AddNativePolymorphicTypInfo) }
How to use
Start by installing the nuget package ActFlow into your project.
This package contains the actual engine used to run the workflows.
You can add whichever integration nuget package afterwards, to give you workers and activities (I will assume you have ActFlow.Integrations.Core installed for the following).
You can then setup the ActFlow engine by doing the following:
var engine = new ActFlowEngine(new List<IWorker>()
{
new NoActivityWorker("a"),
new CreateContextWorker("b")
});
This has now defined an engine instance with two workers, NoActivityWorker with the ID a and a CreateContextWorker with the id b.
The IDs are important, since they are used by activities to know what worker to run (this also means you can have multiple workers with different configurations).
You can then run the following script (represented in JSON):
{
"Name":"test workflow",
"Globals":{ "noactivityworker":"a", "createcontextworker":"b" },
"Activities": [
{
"$type":"NoActivity",
"WorkerID":"${{noactivityworker}}"
},
{
"$type":"CreateContextActivity",
"WorkerID":"${{createcontextworker}}",
"Context": {
"$type":"StringContext",
"Text":"abc"
}
}
]
}
You can execute is as:
var state = await engine.Execute(
JsonSerializer.Deserialize<Workflow>(
...,
JsonSerializerOptions() {
TypeInfoResolver =
new DefaultJsonTypeInfoResolver()
.WithAddedModifier(JsonExtensions.AddNativePolymorphicTypInfo)
}
)
);
This will run the script, and return the final state of the execution.
The result of each step will be visible through the ContextStore property.
As an example, the resulting context of the last activity will be accessible through the key b.Text where it will give the result "abc".
Using this simple system syntax, you can combine many different activities to create complex business logic.
Integrations
Here is a list of integrations that you can use in your ActFlow workflows.
Contains some core activities that you typically see used in workflows. Take a look in the Integrations folder under Core to inspect the schema of the activities.
The activities are:
- Conditional If
- Compares two string values against each other. True or false redirects to different activity indexes in the workflow file.
- Conditional (user) If
- Same as the conditional if, but where one of the values is a user input.
- Create Context
- Directly creates a new context.
- Insert Globals
- Insert some global values that can be used across the entire workflow.
- No Action
- A placeholder activity that does nothing.
Integrates DatabaseSharp as activities. Take a look in the Integrations folder under DatabaseSharp to inspect the schema of the activities.
The activities are:
- Fetch Items From Database
- Gets a set of items from a database and returns them as a Dictionary context.
- Insert Item Into Database
- Insert some data into a database.
- Insert Workflow From Databaser
- Fetch a workflow from a database and insert it after this activity.
Integrates Outlook email handling as activities. Take a look in the Integrations folder under EMail to inspect the schema of the activities.
The activities are:
- Reply to Email
- Reply to a given email
- Send Email
- Send a new email
- Wait for Email
- Wait for a reply on a given email
Integrates some JSON handling as activities. Take a look in the Integrations folder under JSON to inspect the schema of the activities.
The activities are:
- Extract Value From JSON
- Given some text, extract some data by means of a JSONPath
Integrates ML.NET handling as activities. Take a look in the Integrations folder under ML.NET to inspect the schema of the activities.
The activities are:
- Train Text Classitifer
- Train a text classifier with some data
- Classify Text
- Classify some text
Integrates DatabaseSharp as activities. Take a look in the Integrations folder under OpenWebUISharp to inspect the schema of the activities.
The activities are:
- Extract Data From Text
- Extract data from text using a LLM
- Extract Data From Text (RAG)
- Extract data from text using a LLM (RAG)
- Query
- Query an LLM
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ToolsSharp (>= 1.1.6)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ActFlow:
| Package | Downloads |
|---|---|
|
ActFlow.Integrations.ML.NET
ML.NET workflow activities for ActFlow |
|
|
ActFlow.Integrations.JSON
JSON workflow activities for ActFlow |
|
|
ActFlow.Integrations.DatabaseSharp
DatabaseSharp workflow activities for ActFlow |
|
|
ActFlow.Integrations.EMail
Email workflow activities for ActFlow |
|
|
ActFlow.Integrations.OpenWebUISharp
OpenWebUISharp workflow activities for ActFlow |
GitHub repositories
This package is not used by any popular GitHub repositories.