You can define variables:
Using
_exportparameter in YAMLStarting a session with variables
In a YAML file, the _export: directive defines variables. This is useful to load static configurations such as the host name of a database.
If a task has _export directive, the task and its children can use the variables because it defines variables in a scope. With following example, all tasks can use foo=1 but only +step1 (and +analyze) can use bar=.
_export:
foo: 1
+prepare:
py>: tasks.MyWorkflow.prepare
+analyze:
_export:
bar: 2
+step1:
py>: tasks.MyWorkflow.analyze_step1
+dump:
py>: tasks.MyWorkflow.dumpYou can set variables when you start a new workflow session.
To set variables
- Use the
-p KEY=VALUEmultiple times. For example:
$ td wf run -p my_var1=foo -p my_var2=abc