Specifying a relative directory for all outputs

I wrote a nested workflow with cwl, but I want to have all the outputs of all steps (all of them are of type file) in a specific folder. I tried to use --leave-outputs, this and also this one, but I would prefer not to add another step.
Is it possible to add the directory as a part of glob or somewhere else for all of the outputs?

When I add the directory to the glob like:
´´´
glob: $inputs.bet_in_rao.path/bids/derivatives + “*.nii.gz”
´´´
no outputs will be generated.

Hello @sRah_saneE ,

There is no way to transform or organize outputs at the Workflow.outputs level, except to combine separate outputs into an array. So that could give you an array of files, but you want a directory of files.

As you’ve already found, adding an ExpressionTool step will give you want you want. Those typically execute very quickly in most CWL-aware workflow runners.

There is a suggestion for a new feature to be added to a future version of the CWL standards at Grouping outputs from multiple steps into folders/subdirectorys · Issue #870 · common-workflow-language/common-workflow-language · GitHub which fits your request. You could voice your support there and suggest a syntax for how to express file grouping.

1 Like