https://github.com/jaystack/worksmith
Workflow composition library for Task<T> based, non-persisted (in-memory) workflows
https://github.com/jaystack/worksmith
Last synced: 3 months ago
JSON representation
Workflow composition library for Task<T> based, non-persisted (in-memory) workflows
- Host: GitHub
- URL: https://github.com/jaystack/worksmith
- Owner: jaystack
- Created: 2018-05-22T02:07:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-23T11:37:06.000Z (about 7 years ago)
- Last Synced: 2025-01-16T05:55:55.531Z (4 months ago)
- Language: C#
- Size: 17.6 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### WorkSharp
WorkSharp is a task based workflow composition tool. Its main goal is to allow defining complex async process flows via configuration.
This is done by creating the building blocks in C# and defining the workflow in JSON utilzing CSharp Script to glue to pieces together.### Example workflow definitions
```json
{
"_type": "Sequence",
"items": [
{ "_type": "Assign", "name": "Scope.Url", "expression": "\"https://jsonplaceholder.typicode.com/posts\"" },
{
"_type": "HttpGet",
"_resultTo": "Scope.ContentList",
"url": "Scope.Url"
},
{
"_type": "Assign",
"name": "Scope.SelectedContent",
"expression": "Scope.ContentList[0]"
},
{
"_type": "Delay",
"_resultTo": "Scope.DelayTime",
"duration": "1000 * 2 + 42"
},
{
"_type": "ConsoleWrite",
"message": "$\"We were also Delayed {Scope.DelayTime} ms before we could see this -> {Scope.SelectedContent.body}\""
}
]
}
```### How to use
```C#
var jsonText = File.ReadAllText(Directory.GetCurrentDirectory() + "\\wf.json");
ExpandoObject json = JsonConvert.DeserializeObject(jsonText);
var ws = new WorkSharp.WorkSharp();
var wf = ws.CreateFromJSON(json);
var r = await wf.Invoke(((dynamic)new ExpandoObject()));
```