ActFlow.Integrations.ML.NET
1.0.2
dotnet add package ActFlow.Integrations.ML.NET --version 1.0.2
NuGet\Install-Package ActFlow.Integrations.ML.NET -Version 1.0.2
<PackageReference Include="ActFlow.Integrations.ML.NET" Version="1.0.2" />
<PackageVersion Include="ActFlow.Integrations.ML.NET" Version="1.0.2" />
<PackageReference Include="ActFlow.Integrations.ML.NET" />
paket add ActFlow.Integrations.ML.NET --version 1.0.2
#r "nuget: ActFlow.Integrations.ML.NET, 1.0.2"
#:package ActFlow.Integrations.ML.NET@1.0.2
#addin nuget:?package=ActFlow.Integrations.ML.NET&version=1.0.2
#tool nuget:?package=ActFlow.Integrations.ML.NET&version=1.0.2
<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.
- 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.
- Conditional If
- DatabaseSharp
- Execute STP
- Execute a STP with some parameters and get the result.
- Insert Workflow From Databaser
- Fetch a workflow from a database and insert it after this activity.
- 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
- Reply to Email
- Extract Value From JSON
- Given some text, extract some data by means of a JSONPath
- Extract Value From JSON
- ML.NET
- Train Text Classitifer
- Train a text classifier with some data
- Classify Text
- Classify some text
- OpenWebUISharp
- 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
- Extract Values from XML
- Given some text, extract values to a dictionary
- Extract Values from XML
- Execute Javascript
- Execute some javascript code
- Execute Javascript
- Delay
- Wait for some specified amount of time
- Cron Wait
- Wait for the next occurence from some Cron expression
- Delay
| 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
- ActFlow (>= 1.0.8)
- Microsoft.ML (>= 5.0.0)
- Microsoft.ML.TorchSharp (>= 0.23.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.