Workflow commands
The workflow commands provide easy ways to perform operations on CWL Workflow files. This features basic CR~~U~~D operations and the possibility to connect and disconnect steps.
Usage
Provides commands to create and work with CWL Workflows
Usage: s4n workflow <COMMAND>
Commands:
create Creates a blank workflow
connect Connects a workflow node
disconnect Disconnects a workflow node
save Saves a workflow
status Shows socket status of workflow
list List all workflows [aliases: ls]
remove Remove a workflow [aliases: rm]
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
workflow create
The s4n workflow create
command creates an empty CWL workflow definition with the given name. An exisiting workflow can be overwritten using the --force
flag.
Usage
Example
will create an empty workflow file in the workflows folder.workflow connect
and workflow disconnect
The workflow connect
and workflow disconnect
commands can be used to connect CWL CommandLineTools, workflow inputs and workflow outputs forming a directed acyclic graph. The connect command establishes a connection and adds in-, outputs and steps if they are not present in the current workflow. The names of the steps slots can be copied from the output of s4n tool ls
. For connections to in- or outputs a @
has to be used es prefix e.g. @inputs/my-file
. The name of the node is constructed by using the tool's name and the name of the tool's node separated by a forward slash: mytool/my-input
. Connections are made using the --from
and --to
arguments together with the name of the workflow.
Usage
Example: Connect to input socket
Will add a new input socketpopulation
and adds the calculation
step if it is not present in the workflow already. The step's input population
will be mapped to the workflow's input.
Connecting to workflow outputs works analogues.
Example: Connecting Tools
Will add a connection between two CWL CommandLineTools mapping theresults
output of the calculation
tool to the results
input of the plot
tool.
The same logic applies for the disconnect command.
Usage
workflow save
The save command simply commits the changes made to a workflow using git.
Usage
``` Saves a workflow
Usage: s4n workflow save [OPTIONS]
Arguments:
Options: -f, --force Overwrites existing workflow -h, --help Print help
```
workflow status
The workflow status
command shows the current connection status of a workflow. Successfully connected sockets are marked in green, a gray icon shows the usage of a tool's default value and the red cross shows unconnected sockets.
Example
s4n workflow status main
# Status report for Workflow workflows/main/main.cwl
# +--------------------------------+------------------+---------------+
# | Tool | Inputs | Outputs |
# +================================+==================+===============+
# | <Workflow> | ✅ speakers | |
# +--------------------------------+------------------+---------------+
# | Steps: | | |
# +--------------------------------+------------------+---------------+
# | ../calculation/calculation.cwl | ✅ speakers | ❌ results |
# | | 🔘 population | |
# +--------------------------------+------------------+---------------+
# ✅ : connected - 🔘 : tool default - ❌ : no connection
Usage
workflow list
s4n workflow list
lists all workflows of the current project. Using the --all
flag more information about steps and in- and outputs can be shown.
Usage
workflow remove
s4n workflow remove
can be used to delete a workflow from the project.