Declarative Workflows¶
Once you have your collection of Routines, you can describe the workflow itself
with a yaml
file.
The YAML file¶
The yaml
file is a collection of descriptions of your routines. There
are three important aspects of a routine description:
- The label. Other routines will refer to it by this label.
- The
data
property. Specifies from which other routine it gets the data it acts on. - The other properties. They will be passed as constructor arguments to the properties.
The Label¶
The label must simply be a valid json label. Alpha-numeric plus underscores, starting with a letter.
The Data Property¶
The data
property has one required sub-property, from
.
from
can name another routine in the yaml workflow, or an external
routine. External routines are detected by the presence of a dot (.
) in
the value.
Aditional sub-properties are allowed on data
. They will be passed as
arguments when the data is accessed. For example, a routine which filters the
data might take a boolean argument when accessed, to toggle whether to provide
rows which were matched or unmatched.
For from
properties containg .
, the following strategy is used
to try and access the routine:
- Look for a
.yaml
files in the current directory with a name matching the label preceding the last.
, with a routine matching the label following the last.
. - Try to import a module using the the part of the label preceding the last
.
, with an importable object matching the label following the last.
.
Additional Properties¶
Any additional properties will tell the routine about itself when created.
Running a Workflow¶
Run the whole thing: timeflow workflow.yaml
Run a routine (and all its dependencies): timeflow workflow.yaml routine
Specifiy what sort of output you want: timeflow workflow -o csv
- The label after the
-o
file will first try to use a builtin timeflow, or try to import an export routine if it contains a dot.