Accessing record fields in inputs/outputs without expressions

Hi all,
I would like to know if there is a particular syntax to access record fields in input/output ports of workflows without having to resort to javascript expressions.

This is the working example that I was able to create with expressions:

cwlVersion: v1.1
class: Workflow

requirements:
  SubworkflowFeatureRequirement: {}
  InlineJavascriptRequirement: {}
  StepInputExpressionRequirement: {}
  SchemaDefRequirement:
    types:
      - name: test_record
        type: record
        fields:
          - name: fff
            type: string

inputs: []

outputs:
  ooo:
    type: string
    outputSource: step2/output


steps:
  step1:
    in: []
    out: [output]
    run:
      class: ExpressionTool
      requirements:
        InlineJavascriptRequirement: {}
      inputs: []
      outputs:
        output: "#test_record"
      expression: |
        ${
          return {
            output: {
              fff: "asd"
            }
          };
        }
  step2:
    in:
      in1:
        source: step1/output
        valueFrom: $(self.fff)
    out: [output]
    run:
      class: ExpressionTool
      requirements:
        InlineJavascriptRequirement: {}
      inputs:
        in1: string
      outputs:
        output: string
      expression: |
        ${
          return { output: inputs.in1 };
        }

Is there a way to express this bit:

...
  step2:
    in:
      in1:
        source: step1/output
        valueFrom: $(self.fff)
...

without using expressions? I’ve made a couple of tries like in1: step1/output/fff and in1: step1/output.fff but these don’t work.

Thank you.

Cheers!

Hi,
from the radio silence I deduce that there is no way to do what I ask. Am I correct?

Thanks!

Hello! $(self.fff) is a valid CWL Parameter Reference and thus does not require InlineJavascriptRequirenent.

What I meant is being able to specify the field without having to add a separate source: field. Like in the examples before:

in1: step1/output/fff

or

in1: step1/output.fff

Thanks!

I understand now, that would make records much more attractive to use! Alas, that is not a current feature, but I think it would be a great addition to CWL v1.3/v2.0 (whichever comes out first)

Can you make a proposal for what you would like to see at https://github.com/common-workflow-language/common-workflow-language/issues/new ? Thanks!

1 Like

I was going to make a post about this same feature request, I think it would be very valuable for workflows that have many inputs / outputs.

For example:

We would love to be able to minimize the length of the workflow by using record objects to group things together, but have avoided it because of the number of parameter references it would take to extract these fields from the records later on.

Happy to create this proposal if it hasn’t been created already!

1 Like

Hi @ionox0,
I’ve not created the proposal. If you like it please go on.
Otherwise let me know and I will create the proposal instead.

Cheers!