-
Notifications
You must be signed in to change notification settings - Fork 30
Home
HyperFlow provides a simple but powerful model of computation and execution engine for complex workflow applications. In HyperFlow, a workflow is defined as a set of processes performing well-defined functions and exchanging signals.
This simple workflow demonstrates the concept of task types and explains the workflow format accepted by the engine. The workflow, shown below, computes a sum of squares of three numbers. It is composed of two tasks: the first one computes the squares and is of type foreach: for each of its data inputs, it invokes the function, and emits the result to the corresponding data output. The second task is a "regular" one (type task) which means that it waits for all data inputs, feeds them to the function, and emits all data outputs.

This workflow expressed in a JSON format consumed by the HyperFlow engine is shown below. This is rather a low-level, "executable" format of the engine, not meant to be written directly by a programmer; rather, it should be generated from a high-level workflow description or a workflow programming language.
{
"name": "Wf_sqrsum",
"functions": [ { // functions used by workflow processes
"name": "add",
"module":"functions"
}, {
"name": "sqr",
"module":"functions"
} ],
"processes": [ { // processes of the workflow
"name": "Sqr",
"type": "foreach",
"function": "sqr",
"ins": [ "arg1", "arg2", "arg3" ], // signals consumed by this process
"outs": [ "sqr1", "sqr2", "sqr3" ] // signals emitted by this process
}, {
"name": "Add",
"type": "dataflow",
"function": "add",
"ins": [ "sqr1", "sqr2", "sqr3" ],
"outs": [ "sum" ]
} ],
"signals": [ {
"name": "arg1",
"data": [ { "value": 1 } ] // optional signal instances -- will be emitted upon workflow start
}, {
"name": "arg2",
"data": [ { "value": 2 } ]
}, {
"name": "arg3",
"data": [ { "value": 3 } ]
}, {
"name": "sqr1",
}, {
"name": "sqr2",
}, {
"name": "sqr3",
}, {
"name": "sum",
} ],
"ins": [ "arg1", "arg2", "arg3" ],
"outs": [ "sum" ]
}Read more about available process types.