I have a lot of parameters in a pipeline, and would like to pass them down through several layers of subworkflows so the system is modular and reusable for different analyses, but it is cumbersome to have to list all of the parameters for each workflow, and also to change all of occurrences of it when one changes.
Is there a way to pass a group of parameters through to a subworkflow, but without explicitly listing all of them?
For example:
(inputs.yaml)
a_bunch_of_params_for_step_1:
param_1: ...
param_2: ...
param_3: ...
param_4: ...
param_5: ...
...
a_bunch_of_params_for_step_2:
param_1: ...
param_2: ...
param_3: ...
param_4: ...
param_5: ...
...
(workflow.yaml)
inputs:
a_bunch_of_params_for_step_1: (record type?)
a_bunch_of_params_for_step_2: (record type?)
steps:
step_1:
inputs:
inputs_1: a_bunch_of_params_for_step_1
step_2:
inputs:
inputs_1: a_bunch_of_params_for_step_2
It seems like this might be possible with record types, but I haven't seen any examples where the fields in the record aren't all explicitly specified as a part of the record.
It's just easier to group the parameters into one input so that you don't have to list them all in each inputs section. It's particularly cumbersome when there are several layers of subworkflows, and all you really want to do is just get the inputs to the underlying tool.
I found that it is indeed possible to pass record types through from workflow to subworkflow, which solves most of the issue. The other part of the issue is getting only the fields from the record that you want for a particular workflow step, and that can be solved with
valueFrom
:Which may not be the best solution. I'm curious what is the
load_contents
feature you're describing?