-
Notifications
You must be signed in to change notification settings - Fork 0
Writing project files
When your workflow has finished you probably want to write its results (files or files) back to the enclosing Project directory, typically in the last step of a workflow.
Outputs are declared in the workflow's variables (see Workflow variables).
In order to identify the source of the output file you simply have to refer to an output file variable in a step's "plumbing". This is illustrated by a simple example. In the following workflow's variables section we declare an output file variable called outputFile
. The user is required to provide a value for this variable before they run the workflow, e.g. results.smi
.
variables:
outputs:
type: object
properties:
outputFile:
type: file
If, in our imaginary workflow, step-4
is responsible for producing the file then, in order for the file to be propagated into the enclosing Project directory, we have to declare the connection in step-4's plumbing. Like this: -
steps:
- name: step-4
plumbing:
- variable: resultsFile
from-workflow:
variable: outputFile
When the workflow engine runs step-4 it provides the following step variables: -
{
"resultsFile": "results.smi"
}
This instructs the step's job to create results.smi
file.
When the engine detects that the step is complete it then instructs the DM to link the results.smi
file (in step-4's instance directory) into the Project directory. It does this using the API adapter's realise_outputs()
method.