![]() |
VOOZH | about |
dotnet add package ActFlow.Integrations.JSON --version 1.1.0
NuGet\Install-Package ActFlow.Integrations.JSON -Version 1.1.0
<PackageReference Include="ActFlow.Integrations.JSON" Version="1.1.0" />
<PackageVersion Include="ActFlow.Integrations.JSON" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="ActFlow.Integrations.JSON" />Project file
paket add ActFlow.Integrations.JSON --version 1.1.0
#r "nuget: ActFlow.Integrations.JSON, 1.1.0"
#:package ActFlow.Integrations.JSON@1.1.0
#addin nuget:?package=ActFlow.Integrations.JSON&version=1.1.0Install as a Cake Addin
#tool nuget:?package=ActFlow.Integrations.JSON&version=1.1.0Install as a Cake Tool
<p align="center"> <img src="https://github.com/user-attachments/assets/e7750a92-fe96-4742-8327-a34978d587fe" width="200" height="200" /> </p>
👁 Build and Publish
👁 Nuget
👁 Nuget
👁 GitHub last commit (branch)
👁 GitHub commit activity (branch)
👁 Static Badge
👁 Static Badge
👁 Static Badge
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) }
For just using ActFlow, you can install the CLI tool by entering
dotnet tool install ActFlow.CLI -g
You can then call the CLI tool by the actflow command.
You can also choose to use the Docker image.
This requires that you have a config.json config on your computer that contains the IWorker configuration.
Simply change the bind mount in the docker-compose.yaml
After you have set that up, you can start the docker container:
docker compose up -d
This will then start the HTTP server of the CLI, open on port 5523.
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.
Each of the integrations below can be found as NuGet packages by their name.
persistent directory into context.persistent directory.persistent directory.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.