-
Notifications
You must be signed in to change notification settings - Fork 30
Workflow description format
Bartosz Balis edited this page Feb 18, 2021
·
6 revisions
HyperFlow uses a simple JSON format to describe workflows. The graph structure is expressed as follows:
{
"name": "Hello",
"processes": [ { // nodes of the graph
"name": "Node_0",
"ins": [ 0 ], // input edges ("signals") (indexes in the "signals" table)
"outs": [ 1 ] // output edges
}, {
"name": "Node_1",
"ins": [ 1 ],
"outs": [ 2 ]
} ],
"signals": [ { // edges of the graph
"name": "sig_0"
}, {
"name": "sig_1"
}, {
"name": "sig_2"
} ]
}
This describes the following graph:

{
"name": "Sqr",
"type": "dataflow",
"function": "sqr",
"ins": [ "number" ], // instead of array indexes, signal names can also be used
"outs": [ "square" ]
}
{
"name": "number",
"data": [ 1, 2, 3, 4, 5, 6 ]
}
If data is present, it contains a sequence of data elements (instances of that signal) that will be sent to the workflow after it has started.
HyperFlow workflow description supports variable interpolation. You can put {{var_name}} variables in the workflow.json, and provide values for these variables in one of the following ways:
- Through
hflowcommand line parameter--var, e.g.
hflow run <wf_dir> --var="function=command_print" --var="workdir=/home/workdir"
- Through environment variables starting with
HF_VAR_, e.g.
export HF_VAR_function=command_print
This will result in replacing all occurrences of {{function}} in workflow.json with command_print when the workflow is run with the hflow run command.