Creating the scatter array using inputs

Hello!

I have this Workflow step that scatters on the values of three input parameters so I’ve added an ExpressionTool step to construct the scatter array:

- class: ExpressionTool

  id: arrange_bands 
  
  inputs:
    red:
      type: string
    green:
      type: string
    blue:
      type: string
 
  outputs:
    bands:
      type: string[]

  expression: |
    ${ 
      return { "bands": [ inputs.red, inputs.green, inputs.blue ] } 
    }

And then:

  node_crop:

      run: "#crop-cl"

      in:
        product: product 
        band: node_bands/bands
        bbox: bbox
        epsg: proj

      out:
        - cropped_tif

      scatter: band
      scatterMethod: dotproduct 

Can this be done without an ExpressionTool step?

Try MultipleInputFeatureRequirement + band: [ red, green, blue ]

1 Like

For future reference, here’s how the CWL document extract looks like:

  steps:

    node_crop:

      run: "#crop-cl"

      in:
        product: product 
        band: [ red, green, blue ]
        bbox: bbox
        epsg: proj

      out:
        - cropped_tif

      scatter: band
      scatterMethod: dotproduct
1 Like