Writing a simple CWL workflow

I am a total newbie in CWL and I’m struggling to write a simple workflow. I want to write a workflow.cwl which will read all my elementary cwl files, and my elementary cwl files will run my actual python program. This is what I have written so far and encountered with error - (ERROR Tool definition failed validation: mapSubject ‘outputs’ value ‘None’ is not a dict and does not have a mapPredicate.). I would really appreciate your help, Thank you in advance!!
workflow.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: Workflow
label: geoweaver workflow 

inputs:
  code_folder: 
    type: File
 
outputs: []

steps:
  run: HelloWorld.cwl
  type: File
  inputs:
    folder: code_folder
  outputs: []  

HelloWorld.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
label: python files from geoweaver
baseCommand: ["python", "test.py"]

inputs: []
outputs: []

input.yml

code_folder:
  class: File
  path: HelloWorld.cwl

Welcome @amruta_kale !

Try this

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: Workflow
label: geoweaver workflow 

inputs:
  code_folder: 
    type: File
 
outputs: []

steps:
  run: HelloWorld.cwl
  in:
    folder: code_folder
  out: []  

At the workflow step level, we use in and out; not inputs and outputs

https://www.commonwl.org/user_guide/21-1st-workflow/index.html

I recommend using GitHub - rabix/benten: A language server for Common Workflow Language with VS Code (or your favorite text editor) to help you write CWL.

I hope this helps!

1 Like

Thank you for your response! However even after changing it to in and out it is still giving me the same error. I am not sure what this error means “mapSubject ‘out’ value ‘None’ is not a dict and does not have a mapPredicate.”

Can you share the entire error message? There should be a line number

(env) (base) amrutakale@Amrutas-MacBook-Pro demo % cwl-runner tool.cwl input.yml
INFO /Users/amrutakale/env/bin/cwl-runner 3.1.20211020155521
INFO Resolved 'tool.cwl' to 'file:///Users/amrutakale/env/demo/tool.cwl'
ERROR Tool definition failed validation:
mapSubject 'out' value 'None' is not a dict and does not have a mapPredicate.

Ah, the name of the step was missing. That was a really unhelpful error! I opened an issue to fix that.

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: Workflow
label: geoweaver workflow 

inputs:
  code_folder: 
    type: File
 
outputs: []

steps:
  first_step:
    run: HelloWorld.cwl
    in:
      folder: code_folder
    out: []  

I’m so grateful for your assistance!!

I’ve edited my workflow using your remarks, now it works fine. :smile:

1 Like