diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index 1c67fe4191987e7e13a880192093711613926bf8..005ac10fc653f5891eb96b475f29a38172ebbd11 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -1,13 +1,14 @@
 FROM lofareosc/lofar-pipeline:latest
 USER root
+
+RUN apt update && apt install -y vim wget casacore-tools && rm -rf /var/cache/apt 
+RUN pip3 install --upgrade pip && pip3 install --upgrade numpy scipy
 COPY prefactor/scripts/* /opt/lofar/scripts/
 COPY prefactor/skymodels/* /data/skymodels/
 COPY prefactor/rfistrategies/* /data/rfistrategies/
-COPY prefactor/solutions/ /data/solutions/*
-RUN apt update && apt install -y vim 
-RUN pip3 install --upgrade pip && pip3 install --upgrade numpy scipy
-RUN ln -sf /opt/lofar/scripts/* /usr/local/bin/
+COPY prefactor/solutions/* /data/solutions/
 
+RUN ln -sf /opt/lofar/scripts/* /usr/local/bin/
 RUN chmod +rx /usr/local/bin/*
 ENV PYTHONPATH="/opt/lofar/scripts:${PYTHONPATH}"
 ENTRYPOINT ["/home/lofaruser/.entrypoint"]
diff --git a/Docker/build_docker.sh b/Docker/build_docker.sh
index 58f6f1ae776d7c828c871fee958d87bb7cde738a..4e2638aa04f839a7e81c5fdfbe2374148f38f6f5 100755
--- a/Docker/build_docker.sh
+++ b/Docker/build_docker.sh
@@ -17,11 +17,9 @@ Prefactor_TAG=production
 
 # FETCHES Prefactor
 git_clone_or_pull https://github.com/lofar-astron/prefactor.git ${Prefactor_TAG} prefactor
-
 SCRIPT_PATH=$(realpath ${BASH_SOURCE[0]})
 
 DOCKER_PATH=$(dirname ${SCRIPT_PATH})
 
 docker build ${DOCKER_PATH} -t lofareosc/prefactor
-
 docker build ${DOCKER_PATH} -f ${DOCKER_PATH}/Dockerfile_ci -t lofareosc/prefactor-ci
diff --git a/lofar-cwl/steps/AOFlagger.cwl b/lofar-cwl/steps/AOFlagger.cwl
index b2e3eff72e50058b45bb05ee8f39fe290112cd8c..eac08767ec755c8c97fc141e931977f25cdaa72b 100644
--- a/lofar-cwl/steps/AOFlagger.cwl
+++ b/lofar-cwl/steps/AOFlagger.cwl
@@ -13,7 +13,7 @@ requirements:
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 baseCommand:
   - aoflagger
diff --git a/lofar-cwl/steps/Ateamclipper.cwl b/lofar-cwl/steps/Ateamclipper.cwl
new file mode 100755
index 0000000000000000000000000000000000000000..0276008ef13c5626bf3edadb912c896eb9ed603e
--- /dev/null
+++ b/lofar-cwl/steps/Ateamclipper.cwl
@@ -0,0 +1,41 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: check_ateam_separation
+baseCommand:
+  - python3
+  - /usr/local/bin/Ateamclipper.py
+inputs:
+  - id: msin
+    type:
+      - Directory
+      - type: array
+        items: Directory
+    inputBinding:
+      position: 0
+    doc: Input measurement set
+outputs:
+  - id: msout
+    doc: Output MS
+    type: Directory
+    outputBinding:
+      glob: $(inputs.msin.basename)
+  - id: logfile
+    type: 'File[]'
+    outputBinding:
+      glob: Ateamclipper.log
+  - id: output
+    type: File
+    outputBinding:
+      glob: Ateamclipper.txt
+label: Ateamclipper
+hints:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+  - class: InlineJavascriptRequirement
+stdout: Ateamclipper.log
diff --git a/lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl b/lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
index 04e013599b67f0fa18b22afd81f889b0fcc888db..2850b977dcfc984b3bebf38f19d35166707e0b7d 100755
--- a/lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+++ b/lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
@@ -14,7 +14,7 @@ inputs:
     default: applycal
 
   - id: parmdb
-    type: string
+    type: File
     doc: Path of parmdb in which the parameters are stored. This can also be an H5Parm file, in that case the filename has to end in '.h5'
   - id: solset
     type: string?
@@ -36,6 +36,10 @@ inputs:
        - scalaramplitude
        - rotationmeasure
        - fulljones
+       - polalign
+       - bandpass
+       - RMextract
+       - phaseOrig
     doc: |
       Type of correction to perform, can be one of 'gain', 'tec', 'clock',
       '(common)rotationangle' / 'rotation', '(common)scalarphase',
@@ -88,8 +92,6 @@ steps:
     in:
       - id: step_type
         default: 'applycal'
-      - id: output_files
-        default: ["parmdb"]
       - id: step_id
         source: step_name
       - id: steps
diff --git a/lofar-cwl/steps/DP3.AveragerStepGenerator.cwl b/lofar-cwl/steps/DP3.AveragerStepGenerator.cwl
index d5424919111a6c38f65053bfec5f2e299a98c076..47861182c3c60b1d24f5189334dabb7bb36f0e4d 100755
--- a/lofar-cwl/steps/DP3.AveragerStepGenerator.cwl
+++ b/lofar-cwl/steps/DP3.AveragerStepGenerator.cwl
@@ -41,7 +41,7 @@ inputs:
       zero, it overrides <step>.timestep
     default: 0
   - id: freqresolution
-    type: float
+    type: string
     doc: >-
       Target frequency resolution, in Hz (or append "MHz" or "kHz" to specify it
       in those units). If this is given, and bigger than zero, it overrides
diff --git a/lofar-cwl/steps/DP3.Execute.cwl b/lofar-cwl/steps/DP3.Execute.cwl
index e1f3bbfd445ec81cfb820afd4fc8a52800d402be..a18021373b04553b9cde5e84ca8ab531ac14854a 100644
--- a/lofar-cwl/steps/DP3.Execute.cwl
+++ b/lofar-cwl/steps/DP3.Execute.cwl
@@ -41,6 +41,18 @@ outputs:
     type: Directory
     'sbg:x': 224.60113525390625
     'sbg:y': 130
+  - id: logfile
+    outputSource:
+      - dppp/logfile
+    type: 'File[]'
+    'sbg:x': 185.1875
+    'sbg:y': 334.5
+  - id: parset
+    outputSource:
+      - generic_step/parset
+    type: File
+    'sbg:x': 11.1875
+    'sbg:y': -299.5
 steps:
   - id: generic_step
     in:
diff --git a/lofar-cwl/steps/DP3.FilterStepGenerator.cwl b/lofar-cwl/steps/DP3.FilterStepGenerator.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..0a582b27c0d351d3b8a2f1fa2a2805094dc94ad3
--- /dev/null
+++ b/lofar-cwl/steps/DP3.FilterStepGenerator.cwl
@@ -0,0 +1,50 @@
+#!/usr/bin/env cwl-runner
+
+class: Workflow
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: dp3-filter-step-generator
+
+inputs:
+  - id: steps
+    type: Any[]?
+    default: []
+  - id: step_name
+    type: string
+    doc: unique name for the step
+    default: filter
+  - id: baseline
+    type: string
+    doc: baseline to keeps
+  - id: remove
+    type: boolean
+    doc: Remove or flag
+outputs:
+- id: augmented_steps
+  outputSource:
+    - DP3_GenericStep/augmented_steps
+  type: Any[]
+
+steps:
+  - id: DP3_GenericStep
+    in:
+    - id: steps
+      source: steps
+    - id: parameters
+      valueFrom: $(inputs)
+    - id: step_id
+      source: step_name
+    - id: step_type
+      default: 'filter'
+    - id: baseline
+      source: baseline
+    - id: remove
+      source: remove
+    out:
+      - augmented_steps
+    run: ../steps/DP3.GenericStep.cwl
+requirements:
+  - class: StepInputExpressionRequirement
+  - class: InlineJavascriptRequirement
+  - class: MultipleInputFeatureRequirement
\ No newline at end of file
diff --git a/lofar-cwl/steps/DP3.GenericStep.cwl b/lofar-cwl/steps/DP3.GenericStep.cwl
index 38829da42ed0deaac51bcf92c7c105e9139d4108..3c1a3031ced711121601e381e73ca08303a07a6f 100755
--- a/lofar-cwl/steps/DP3.GenericStep.cwl
+++ b/lofar-cwl/steps/DP3.GenericStep.cwl
@@ -39,7 +39,7 @@ expression: |-
    delete inputs.parameters.steps;
    delete inputs.parameters.parameters;
    delete inputs.parameters.steps;
-
+   delete inputs.parameters.output_files;
 
    var new_step = {'step_type': step_type,
                    'step_id': step_id,
diff --git a/lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl b/lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
index 03f6c11d6f16db4d72a38666e4a294a2f568fb28..64cd85154761c971cb2e86655fbcfe4355a19824 100755
--- a/lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
+++ b/lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
@@ -133,39 +133,31 @@ inputs:
       31*nchan/32..nchan-1] to flag the first and last 2 or 8 channels
       (depending on 64 or 256 channels in the observation).
   - id: amplmin
-    default: -1e+30
-    type: float
+    type: float?
     doc: >-
       Correlation data with amplitude < amplmin will match. It can be given per
       correlation. For example, amplmin=[100,,,100] matches data points with XX
       or YY amplitude < 100. The non-specified amplitudes get the default value.
   - id: amplmax
-    default: 1e+30
-    type: float
+    type: float?
     doc: Correlation data with amplitude > amplmax will match.
   - id: phasemin
-    default: -1e+30
-    type: float
+    type: float?
     doc: Correlation data with phase < phasemin (in radians) will match.
   - id: phasemax
-    default: 1e+30
-    type: float
+    type: float?
     doc: Correlation data with phase > phasemax (in radians) will match.
   - id: realmin
-    default: -1e+30
-    type: float
+    type: float?
     doc: Correlation data with real complex part < realmin will match.
   - id: realmax
-    default: 1e+30
-    type: float
+    type: float?
     doc: Correlation data with real complex part > realmax will match.
   - id: imagmin
-    default: -1e+30
-    type: float
+    type: float?
     doc: Correlation data with imaginary complex part < imagmin will match.
   - id: imagmax
-    default: 1e+30
-    type: float
+    type: float?
     doc: Correlation data with imaginary complex part > imagmax will match.
 outputs:
 - id: augmented_steps
diff --git a/lofar-cwl/steps/DPPP.cwl b/lofar-cwl/steps/DPPP.cwl
index a756093a275e63decbec9ed6425628dfb5efedb9..8cd5a42291642598cd7fc2884a491b254246c476 100755
--- a/lofar-cwl/steps/DPPP.cwl
+++ b/lofar-cwl/steps/DPPP.cwl
@@ -17,7 +17,7 @@ inputs:
       prefix: msin=
       separate: false
     doc: Input Measurement Set
-  - default: out.MS
+  - default: "."
     id: msout_name
     type: string
     inputBinding:
@@ -37,23 +37,61 @@ inputs:
   - id: output_directory_names
     type: Any
     doc: Expected output file names
-  - id: autoweight
+  - default: false
+    id: autoweight
     type: boolean
-    default: true
     inputBinding:
-      prefix: -msin.autoweight=True
-  - id: baseline
+      position: 0
+      prefix: 'msin.autoweight=True'
+  - default: ''
+    id: baseline
     type: string
-    default: ""
     inputBinding:
-      prefix: -msin.baseline=
+      position: 0
+      prefix: 'msin.baseline='
+      separate: false
+  - default: DATA
+    id: output_column
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: 'msout.datacolumn='
+      separate: false
+  - default: DATA
+    id: input_column
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: 'msin.datacolumn='
       separate: false
+  - id: writefullresflag
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.writefullresflag=True
+  - id: overwrite
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.overwrite=True
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+       prefix: msout.storagemanager=
+       separate: false
+  - id: databitrate
+    type: int
+    default: 0
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
 outputs:
   - id: msout
     doc: Output Measurement Set
     type: Directory
     outputBinding:
-      glob: '$(inputs.msout_name=="."?inputs.msin:inputs.msout_name)'
+      glob: '$(inputs.msout_name=="." ? inputs.msin.basename : inputs.msout_name)'
   - id: secondary_output_files
     doc: Secondary output files
     type: Any
@@ -89,12 +127,20 @@ outputs:
           return output
         }
   - id: logfile
-    type: File?
+    type: File[]
     outputBinding:
-      glob: DPPP.log
+      glob: 'DPPP*.log'
 hints:
   - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 stdout: DPPP.log
+stderr: DPPP_err.log
 requirements:
   - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+      - entry: $(inputs.secondary_files)
+      - entry: $(inputs.secondary_directories)
+      
diff --git a/lofar-cwl/steps/H5ParmCollector.cwl b/lofar-cwl/steps/H5ParmCollector.cwl
index 338109c750a0aab4ed2968134f2e58f798f35c7a..5b6a2dcdd0f11d241b367abbfd6465b8f8569c0f 100755
--- a/lofar-cwl/steps/H5ParmCollector.cwl
+++ b/lofar-cwl/steps/H5ParmCollector.cwl
@@ -12,7 +12,9 @@ baseCommand:
   - H5parm_collector.py
 inputs:
   - id: h5parmFiles
-    type: 'File[]'
+    type:
+      - 'File[]'
+      - File
     format: lofar:#H5Parm
     inputBinding:
       position: 0
@@ -24,10 +26,26 @@ inputs:
       position: 0
       prefix: '--insolset'
     doc: Input solset name
+  - default: sol000
+    id: outsolset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--outsolset'
+    doc: Output solset name
+  - id: insoltab
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--insoltab'
+    doc: Output solset name
   - default: output.h5
     id: outh5parmname
     type: string
     doc: Output h5parm name
+    inputBinding:
+      position: 0
+      prefix: '--outh5parm'
   - id: squeeze
     type: boolean
     default: false
@@ -49,6 +67,7 @@ inputs:
       position: 0
       prefix: '-c'
     doc: overwrite output
+    
 outputs:
   - id: outh5parm
     doc: Output h5parm
@@ -57,14 +76,14 @@ outputs:
     outputBinding:
       glob: $(inputs.outh5parmname)
   - id: log
-    type: File
+    type: File[]
     outputBinding:
-      glob: $(inputs.outh5parmname)-parm_collector_output.log
+      glob: '$(inputs.outh5parmname)-parm_collector_output*.log'
 label: H5parm_collector
 hints:
   - class: DockerRequirement
-    dockerPull: 'lofareosc/lofar-pipeline-ci:latest'
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
 stdout: $(inputs.outh5parmname)-parm_collector_output.log
+stderr: $(inputs.outh5parmname)-parm_collector_output_err.log
 requirements:
-  - class: InlineJavascriptRequirement
-
+  - class: InlineJavascriptRequirement
\ No newline at end of file
diff --git a/lofar-cwl/steps/LoSoTo.Abs.cwl b/lofar-cwl/steps/LoSoTo.Abs.cwl
index 69ec253b41b480632695627d4280b966581a946d..4ce89e2b5da2f907508e68d757ebc5bfd9d0c178 100755
--- a/lofar-cwl/steps/LoSoTo.Abs.cwl
+++ b/lofar-cwl/steps/LoSoTo.Abs.cwl
@@ -25,12 +25,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Clip.cwl b/lofar-cwl/steps/LoSoTo.Clip.cwl
index 867699dac1e0c2c43eef644a1ebced30aa34d104..d9cda24586263c8c703b2947ddd9da43327bda55 100644
--- a/lofar-cwl/steps/LoSoTo.Clip.cwl
+++ b/lofar-cwl/steps/LoSoTo.Clip.cwl
@@ -26,12 +26,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.ClockTec.cwl b/lofar-cwl/steps/LoSoTo.ClockTec.cwl
index a328b6bef5d6e5fe25a636b50417220397c5f460..a02a92a0988dbde0e074d8f4ceaf89813bccbdab 100644
--- a/lofar-cwl/steps/LoSoTo.ClockTec.cwl
+++ b/lofar-cwl/steps/LoSoTo.ClockTec.cwl
@@ -26,12 +26,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -52,14 +53,14 @@ inputs:
   - id: tec3rdsoltabOut
     doc: output soltab name for tec3rd offset
     type: string?
-  - id: flagBadChannels
+  - id: FlagBadChannels
     type: boolean?
     doc: Detect and remove bad channel before fitting, by default True.
   - id: flagCut
     type: float?
   - id: chi2cut
     type: float?
-  - id: combinePol
+  - id: CombinePol
     type: boolean?
     doc: |
       Find a combined polarization solution, by default False.
@@ -67,11 +68,11 @@ inputs:
     type: boolean?
     doc: |
       Detect and remove phase wraps, by default True.
-  - id: fit3rdorder
+  - id: Fit3rdOrder
     type: boolean?
     doc: |
       Fit a 3rd order ionospheric ocmponent (usefult <40 MHz). By default False.
-  - id: circular
+  - id: Circular
     type: boolean?
     doc: |
       Assume circular polarization with FR not removed. By default False.
@@ -91,5 +92,16 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: parset
+    type: File
+    outputBinding:
+      glob: parset.config
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Duplicate.cwl b/lofar-cwl/steps/LoSoTo.Duplicate.cwl
index 2219758c2eca17fc20d12b65453c3073bf5948e3..55208333d750c4e8354289712e076cb428ba5bbb 100644
--- a/lofar-cwl/steps/LoSoTo.Duplicate.cwl
+++ b/lofar-cwl/steps/LoSoTo.Duplicate.cwl
@@ -25,12 +25,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -48,8 +49,13 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
 
-
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $namespaces:
   lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
 $schema:
diff --git a/lofar-cwl/steps/LoSoTo.Faraday.cwl b/lofar-cwl/steps/LoSoTo.Faraday.cwl
index e3092536fcd656d83dabc303c343ed9900689e3e..c015e412fe54b1e5d17af3d33a33dabfcba58309 100644
--- a/lofar-cwl/steps/LoSoTo.Faraday.cwl
+++ b/lofar-cwl/steps/LoSoTo.Faraday.cwl
@@ -27,12 +27,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -41,6 +42,9 @@ inputs:
   - id: soltab
     type: string
     doc: "Solution table"
+  - id: soltabout
+    type: string?
+    doc: output table name (same solset)
   - id: refAnt
     type: string?
     doc:  Reference antenna, by default the first.
@@ -57,5 +61,13 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
+
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Flag.cwl b/lofar-cwl/steps/LoSoTo.Flag.cwl
index 30dbd1645e993d8cfebc2566629f68c2bc2910ed..302bc82554260d55d604b122dc5440c6fae7fcbf 100644
--- a/lofar-cwl/steps/LoSoTo.Flag.cwl
+++ b/lofar-cwl/steps/LoSoTo.Flag.cwl
@@ -27,12 +27,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -101,5 +102,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.FlagStation.cwl b/lofar-cwl/steps/LoSoTo.FlagStation.cwl
index 1c67c12fa1fdeb7cd2e2cd3f9a16ebb6fc2a5a8b..be98dbb4dcfd3867838bffc81957a34345c5f5c8 100644
--- a/lofar-cwl/steps/LoSoTo.FlagStation.cwl
+++ b/lofar-cwl/steps/LoSoTo.FlagStation.cwl
@@ -26,12 +26,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -76,7 +77,7 @@ inputs:
     type: string?
     doc: Specifies the telescope if mode = 'bandpass'.
   - id: skipInternational
-    type: string?
+    type: boolean?
     doc: |
       If True, skip flagging of international LOFAR stations (only used if
        telescope = 'lofar')
@@ -100,5 +101,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Flagextend.cwl b/lofar-cwl/steps/LoSoTo.Flagextend.cwl
index 330b2fb9b127c8f8e745d259e50bfbbed312e580..c64fae492a36b11aa871d0e77f11415db15af38a 100644
--- a/lofar-cwl/steps/LoSoTo.Flagextend.cwl
+++ b/lofar-cwl/steps/LoSoTo.Flagextend.cwl
@@ -28,12 +28,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -67,5 +68,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Interpolate.cwl b/lofar-cwl/steps/LoSoTo.Interpolate.cwl
index aa956ebff87c5e84f349fb1263432687346a13df..f2fee5dc730b44d34c6cdd90bb9ca2f9348ed489 100644
--- a/lofar-cwl/steps/LoSoTo.Interpolate.cwl
+++ b/lofar-cwl/steps/LoSoTo.Interpolate.cwl
@@ -29,12 +29,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -78,5 +79,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Lofarbeam.cwl b/lofar-cwl/steps/LoSoTo.Lofarbeam.cwl
index ce421868086c89c66db41c7ce23ce485bfbb3ac5..ffdc5dcc1db43c0c3ab15ae7ee5e3b87bdb95f43 100644
--- a/lofar-cwl/steps/LoSoTo.Lofarbeam.cwl
+++ b/lofar-cwl/steps/LoSoTo.Lofarbeam.cwl
@@ -25,12 +25,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Norm.cwl b/lofar-cwl/steps/LoSoTo.Norm.cwl
index e9cadbd666d9e2e9c65aabd3c0d757c5d4b04e99..f193e64cafc715019f6cd94294aebfbcb4290ce4 100644
--- a/lofar-cwl/steps/LoSoTo.Norm.cwl
+++ b/lofar-cwl/steps/LoSoTo.Norm.cwl
@@ -26,12 +26,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Plot.cwl b/lofar-cwl/steps/LoSoTo.Plot.cwl
index d3d077433b5262e300b6d837911c25ff53f3320a..abfc909b4dedeeb9a9a797290cbd3731364ab18f 100644
--- a/lofar-cwl/steps/LoSoTo.Plot.cwl
+++ b/lofar-cwl/steps/LoSoTo.Plot.cwl
@@ -15,29 +15,44 @@ requirements:
   InitialWorkDirRequirement:
     listing:
       - entryname: 'parset.config'
-        entry: $(get_losoto_config().join('\n'))
+        entry: $(get_losoto_config('PLOT').join('\n'))
       - entryname: $(inputs.input_h5parm.basename)
         entry: $(inputs.input_h5parm)
         writable: true
+      - entryname: run_losoto_plot.sh
+        entry: |
+          #!/bin/bash
+          set -e
+          
+          INPUT_H5PARM=$(inputs.input_h5parm.basename)
+          DO_PLOTS=$(inputs.execute)
+          if [ DO_PLOT ]; then
+            losoto --verbose $INPUT_H5PARM parset.config
+          else
+            echo Skipped plotting 3rd order tec solutions
+          fi
 
 
-baseCommand: "losoto"
+baseCommand: "bash"
 
 arguments:
-  - $(inputs.input_h5parm.basename)
-  - parset.config
+  - run_losoto_plot.sh
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
     type: File
     format: lofar:#H5Parm
+  - id: execute
+    type: boolean?
+    default: true
   - id: soltab
-    type: string[]
+    type: string
     doc: "Tabs to plot"
+    
 
   - id: axesInPlot
     type: string[]?
@@ -78,6 +93,10 @@ inputs:
     type: float[]?
     doc: |
       Min max value for the independent variable (0 means automatic).
+  - id: time.minmaxstep
+    type: float[]?
+    doc: |
+      Step size in time for subsequent plotting
   - id: log
     type: string?
     doc: |
@@ -125,6 +144,17 @@ outputs:
     type: File[]
     outputBinding:
       glob: "$(inputs.prefix)*.png"
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+  - id: parset
+    type: File
+    outputBinding:
+      glob: parset.config
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log      
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log    
 
 
 $namespaces:
diff --git a/lofar-cwl/steps/LoSoTo.Polalign.cwl b/lofar-cwl/steps/LoSoTo.Polalign.cwl
index a6a65068192cc1ce192f864364af6387dc44b453..fa4bfe34becb68bfc02c8acb0dd6f3e62a0288ce 100755
--- a/lofar-cwl/steps/LoSoTo.Polalign.cwl
+++ b/lofar-cwl/steps/LoSoTo.Polalign.cwl
@@ -43,12 +43,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -88,5 +89,10 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
 
-
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
diff --git a/lofar-cwl/steps/LoSoTo.PrefactorBandpass.cwl b/lofar-cwl/steps/LoSoTo.PrefactorBandpass.cwl
index c81efdab366125e0c818a211e7dd3c06dda39dec..021adf8b37dd3cb23b8c8d3f5feed7e44ef8434a 100644
--- a/lofar-cwl/steps/LoSoTo.PrefactorBandpass.cwl
+++ b/lofar-cwl/steps/LoSoTo.PrefactorBandpass.cwl
@@ -1,101 +1,131 @@
-#!/usr/bin/env cwl-runner
-
 class: CommandLineTool
 cwlVersion: v1.0
-id: losoto_prefactor_bandpass
-
 $namespaces:
-  lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
-doc: |
-  This operation for LoSoTo implements the Prefactor bandpass operation
-  WEIGHT: flag-only compliant, no need for weight
-
-
-requirements:
-  InlineJavascriptRequirement:
-    expressionLib:
-      - { $include: utils.js}
-  InitialWorkDirRequirement:
-    listing:
-      - entryname: 'parset.config'
-        entry: $(get_losoto_config('PREFACTOR_BANDPASS').join('\n'))
-
-      - entryname: $(inputs.input_h5parm.basename)
-        entry: $(inputs.input_h5parm)
-        writable: true
-
-baseCommand: "losoto"
-
-arguments:
-  - $(inputs.input_h5parm.basename)
-  - parset.config
-
-hints:
-  DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
-
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: losoto_prefactor_bandpass
+baseCommand:
+  - losoto
 inputs:
-  - id: input_h5parm
+  - format: 'lofar:#H5Parm'
+    id: input_h5parm
     type: File
-    format: lofar:#H5Parm
   - id: soltab
     type: string
-    doc: "Solution table"
+    doc: Solution table
   - id: chanWidth
     type: string?
-    doc: |
-      the width of each channel in the data from which solutions were obtained. Can be
-      either a string like "48kHz" or a float in Hz. If interpolate = True, chanWidth
-      must be specified
+    doc: >
+      the width of each channel in the data from which solutions were obtained.
+      Can be
+
+      either a string like "48kHz" or a float in Hz. If interpolate = True,
+      chanWidth
 
+      must be specified
   - id: BadSBList
     type: string?
     doc: a list of bad subbands that will be flagged
-
   - id: outSoltabName
     type: string?
-    doc: |
-      Name of the output bandpass soltab. An existing soltab with this name will be
+    doc: >
+      Name of the output bandpass soltab. An existing soltab with this name will
+      be
+
       overwritten
-  - id: interpolate
+  - default: false
+    id: interpolate
     type: boolean?
-    default: false
-    doc: |
-      If True, interpolate to a regular frequency grid and then smooth, ignoring bad
-      subbands. If False, neither interpolation nor smoothing is done and the output
-      frequency grid is the same as the input one. If interpolate = True, chanWidth
+    doc: >
+      If True, interpolate to a regular frequency grid and then smooth, ignoring
+      bad
+
+      subbands. If False, neither interpolation nor smoothing is done and the
+      output
+
+      frequency grid is the same as the input one. If interpolate = True,
+      chanWidth
+
       must be specified
   - id: removeTimeAxis
     type: boolean?
-    doc: |
-      If True, the time axis of the output bandpass soltab is removed by doing a median
+    doc: >
+      If True, the time axis of the output bandpass soltab is removed by doing a
+      median
+
       over time. If False, the output time grid is the same as the input one
   - id: autoFlag
     type: boolean?
-    doc: If True, automatically flag bad frequencies and stations
-
+    doc: 'If True, automatically flag bad frequencies and stations'
   - id: nSigma
     type: float?
-    doc: Number of sigma for autoFlagging. Amplitudes outside of nSigma*stddev are flagged
-
+    doc: >-
+      Number of sigma for autoFlagging. Amplitudes outside of nSigma*stddev are
+      flagged
   - id: maxFlaggedFraction
     type: float?
-    doc: |
-      Maximum allowable fraction of flagged frequencies for autoFlagging. Stations with
+    doc: >
+      Maximum allowable fraction of flagged frequencies for autoFlagging.
+      Stations with
+
       higher fractions will be completely flagged
   - id: maxStddev
     type: float?
     doc: Maximum allowable standard deviation for autoFlagging
-
   - id: ncpu
     type: int?
     doc: Number of CPUs to use during autoFlagging (0 = all)
-
 outputs:
   - id: output_h5parm
     type: File
-    format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+    format: 'lofar:#H5Parm'
+doc: |
+  This operation for LoSoTo implements the Prefactor bandpass operation
+  WEIGHT: flag-only compliant, no need for weight
+arguments:
+  - $(inputs.input_h5parm.basename)
+  - parset.config
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: parset.config
+        entry: $(get_losoto_config('PREFACTOR_BANDPASS').join('\n'))
+        writable: false
+      - entryname: $(inputs.input_h5parm.basename)
+        entry: $(inputs.input_h5parm)
+        writable: true
+  - class: InlineJavascriptRequirement
+    expressionLib:
+      - |
+        function get_losoto_config(step_name) {
+            var par = ['soltab = ' + inputs.soltab]
+            if (inputs.ncpu !== null && inputs.ncpu !== undefined) par.push('ncpu='+inputs.ncpu);
+            console.log(inputs, par)
+            par.push("[" + step_name + "]")
+            par.push('operation=' + step_name)
+            for(var field_name in inputs){
+                if(field_name === 'input_h5parm' ||
+                   field_name === 'soltab' ||
+                   field_name === 'ncpu' || 
+                   field_name === 'execute') continue;
+
+                if(inputs[field_name] === null ||
+                   inputs[field_name] === 'null') continue;
+                
+                if(inputs[field_name]["class"] !== undefined &&
+                   (inputs[field_name]["class"] ==="Directory" ||
+                    inputs[field_name]["class"] ==="File")){
+                    par.push(field_name+'='+inputs[field_name].path)
+                } else {
+                    par.push(field_name+'='+inputs[field_name])
+                }
+            }
+            return par
+        }
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
 $schema:
-  - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/lofar-cwl/steps/LoSoTo.PrefactorXYoffset.cwl b/lofar-cwl/steps/LoSoTo.PrefactorXYoffset.cwl
index 49e072c3e00168540f0551dc35c4a183aa582a1d..2fd707f650e0f820db15c7dce9ce62d32ecc11a2 100644
--- a/lofar-cwl/steps/LoSoTo.PrefactorXYoffset.cwl
+++ b/lofar-cwl/steps/LoSoTo.PrefactorXYoffset.cwl
@@ -1,53 +1,73 @@
-#!/usr/bin/env cwl-runner
-
 class: CommandLineTool
 cwlVersion: v1.0
-id: losoto_prefactor_xyoffset
-
 $namespaces:
-  lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
-
-requirements:
-  InlineJavascriptRequirement:
-    expressionLib:
-      - { $include: utils.js}
-  InitialWorkDirRequirement:
-    listing:
-      - entryname: 'parset.config'
-        entry: $(get_losoto_config('PREFACTOR_XYOFFSET').join('\n'))
-
-      - entryname: $(inputs.input_h5parm.basename)
-        entry: $(inputs.input_h5parm)
-        writable: true
-
-baseCommand: "losoto"
-
-arguments:
-  - $(inputs.input_h5parm.basename)
-  - parset.config
-
-hints:
-  DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
-
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: losoto_prefactor_xyoffset
+baseCommand:
+  - losoto
 inputs:
-  - id: input_h5parm
+  - format: 'lofar:#H5Parm'
+    id: input_h5parm
     type: File
-    format: lofar:#H5Parm
   - id: soltab
     type: string
-    doc: "Solution table"
+    doc: Solution table
   - id: chanWidth
     type: string
-    doc: |
-      the width of each channel in the data from which solutions were obtained. Can be
+    doc: >
+      the width of each channel in the data from which solutions were obtained.
+      Can be
+
       either a string like "48kHz" or a float in Hz.
-      
 outputs:
   - id: output_h5parm
     type: File
-    format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+    format: 'lofar:#H5Parm'
+arguments:
+  - $(inputs.input_h5parm.basename)
+  - parset.config
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: parset.config
+        entry: $(get_losoto_config('PREFACTOR_XYOFFSET').join('\n'))
+        writable: false
+      - entryname: $(inputs.input_h5parm.basename)
+        entry: $(inputs.input_h5parm)
+        writable: true
+  - class: InlineJavascriptRequirement
+    expressionLib:
+      - |
+        function get_losoto_config(step_name) {
+            var par = ['soltab = ' + inputs.soltab]
+            if (inputs.ncpu !== null && inputs.ncpu !== undefined) par.push('ncpu='+inputs.ncpu);
+            console.log(inputs, par)
+            par.push("[" + step_name + "]")
+            par.push('operation=' + step_name)
+            for(var field_name in inputs){
+                if(field_name === 'input_h5parm' ||
+                   field_name === 'soltab' ||
+                   field_name === 'ncpu' || 
+                   field_name === 'execute') continue;
+
+                if(inputs[field_name] === null ||
+                   inputs[field_name] === 'null') continue;
+                
+                if(inputs[field_name]["class"] !== undefined &&
+                   (inputs[field_name]["class"] ==="Directory" ||
+                    inputs[field_name]["class"] ==="File")){
+                    par.push(field_name+'='+inputs[field_name].path)
+                } else {
+                    par.push(field_name+'='+inputs[field_name])
+                }
+            }
+            return par
+        }
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
 $schema:
-  - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/lofar-cwl/steps/LoSoTo.Replicateonaxis.cwl b/lofar-cwl/steps/LoSoTo.Replicateonaxis.cwl
index f7512ea67e95e9d24eb11a0811e5fa593756afcd..3f953a16409b5b72b63dcc1e464ad5dbeb794c18 100644
--- a/lofar-cwl/steps/LoSoTo.Replicateonaxis.cwl
+++ b/lofar-cwl/steps/LoSoTo.Replicateonaxis.cwl
@@ -42,7 +42,7 @@ arguments:
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Reset.cwl b/lofar-cwl/steps/LoSoTo.Reset.cwl
index 887b0b81b4bddd5e8c43962975924e56700ce93e..ea6e06cbee986d4ba62ff23ab1b1625c3f788bbd 100644
--- a/lofar-cwl/steps/LoSoTo.Reset.cwl
+++ b/lofar-cwl/steps/LoSoTo.Reset.cwl
@@ -24,12 +24,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Residual.cwl b/lofar-cwl/steps/LoSoTo.Residual.cwl
index 9dd82a8a9cc3d57005c7c3d9093ee0711479fe7e..6642f7ec096493896668094eb5d4912b9a0806c9 100644
--- a/lofar-cwl/steps/LoSoTo.Residual.cwl
+++ b/lofar-cwl/steps/LoSoTo.Residual.cwl
@@ -24,12 +24,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -49,9 +50,16 @@ inputs:
 outputs:
   - id: output_h5parm
     type: File
-    format: lofar#H5Parm
+    format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 
 $namespaces:
   lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Reweight.cwl b/lofar-cwl/steps/LoSoTo.Reweight.cwl
index abe16e2c611af5d5bd82cd9c56e03e9af6b0a486..e8f027619f73bfe800559ab70e45a5a4cd512562 100644
--- a/lofar-cwl/steps/LoSoTo.Reweight.cwl
+++ b/lofar-cwl/steps/LoSoTo.Reweight.cwl
@@ -27,12 +27,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
@@ -77,5 +78,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Smooth.cwl b/lofar-cwl/steps/LoSoTo.Smooth.cwl
index cdf67851ae10b6274dbfe52f45c425f4b7c3ff34..7f0d07e3186b46075b2523f97a1b094d96cdc6d3 100644
--- a/lofar-cwl/steps/LoSoTo.Smooth.cwl
+++ b/lofar-cwl/steps/LoSoTo.Smooth.cwl
@@ -22,25 +22,38 @@ requirements:
     listing:
       - entryname: 'parset.config'
         entry: $(get_losoto_config('SMOOTH').join('\n'))
-
       - entryname: $(inputs.input_h5parm.basename)
         entry: $(inputs.input_h5parm)
         writable: true
+      - entryname: run_losoto_smooth.sh
+        entry: |
+          #!/bin/bash
+          set -e
+          
+          INPUT_H5PARM=$(inputs.input_h5parm.basename)
+          DO_SMOOTH=$(inputs.execute)
+          if [ DO_SMOOTH ]; then
+            losoto --verbose $INPUT_H5PARM parset.config
+          else
+            echo Skipped smoothing.
+          fi
 
-baseCommand: "losoto"
+baseCommand: "bash"
 
 arguments:
-  - $(inputs.input_h5parm.basename)
-  - parset.config
+  - run_losoto_smooth.sh
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
     type: File
     format: lofar:#H5Parm
+  - id: execute
+    type: boolean?
+    default: true
   - id: soltab
     type: string
     doc: "Solution table"
@@ -82,5 +95,12 @@ outputs:
     format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.input_h5parm.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: '$(inputs.input_h5parm.basename)-losoto*.log'
+
+stdout: $(inputs.input_h5parm.basename)-losoto.log
+stderr: $(inputs.input_h5parm.basename)-losoto_err.log
 $schema:
   - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/lofar-cwl/steps/LoSoTo.Splitleak.cwl b/lofar-cwl/steps/LoSoTo.Splitleak.cwl
index 3405937529f95ab615be2ebdc6c572f3041bbbc9..c29e1da65f87a3918bf812746a5ba0f1c836e764 100644
--- a/lofar-cwl/steps/LoSoTo.Splitleak.cwl
+++ b/lofar-cwl/steps/LoSoTo.Splitleak.cwl
@@ -24,12 +24,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/LoSoTo.Structure.cwl b/lofar-cwl/steps/LoSoTo.Structure.cwl
index cdf29c2f61d88dfad58c78ed5c5ada0993ccb121..639a7e7da1695a70a0aff53486706d385848633d 100644
--- a/lofar-cwl/steps/LoSoTo.Structure.cwl
+++ b/lofar-cwl/steps/LoSoTo.Structure.cwl
@@ -27,12 +27,13 @@ requirements:
 baseCommand: "losoto"
 
 arguments:
+  - '--verbose'
   - $(inputs.input_h5parm.basename)
   - parset.config
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 inputs:
   - id: input_h5parm
diff --git a/lofar-cwl/steps/applybeam.cwl b/lofar-cwl/steps/applybeam.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..00f3f3914b572778f869d3fbe96c662b05255a12
--- /dev/null
+++ b/lofar-cwl/steps/applybeam.cwl
@@ -0,0 +1,100 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: applycal
+baseCommand:
+  - DPPP
+inputs:
+  - id: msin
+    type: Directory
+    inputBinding:
+      position: 0
+      prefix: msin=
+      separate: false
+    doc: Input Measurement Set
+  - default: DATA
+    id: msin_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msin.datacolumn=
+      separate: false
+    doc: Input data Column
+  - id: msout_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msout.datacolumn=
+      separate: false
+    doc: Output data column
+  - default: applybeam
+    id: type
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applybeam.type=
+      separate: false
+    doc: >
+      Type of correction to perform. When using H5Parm, this is for now the name
+      of the soltab; the type will be deduced from the metadata in that soltab,
+      except for full Jones, in which case correction should be 'fulljones'.
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+      prefix: msout.storagemanager=
+  - id: databitrate
+    type: int?
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
+  - id: updateweights
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applybeam.updateweights=
+      separate: false
+  - id: usechannelfreq
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applybeam.usechannelfreq=
+      separate: false
+  - id: invert
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applybeam.invert=
+      separate: false
+  - id: beammode
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applybeam.beammode=
+      separate: false
+  
+outputs:
+  - id: msout
+    doc: Output Measurement Set
+    type: Directory
+    outputBinding:
+      glob: $(inputs.msin.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'applycal_$(inputs.type)*.log'
+stdout: applycal_$(inputs.type).log
+stderr: applycal_$(inputs.type)_err.log
+arguments:
+  - 'steps=[applybeam]'
+  - msout=.
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
diff --git a/lofar-cwl/steps/applycal.cwl b/lofar-cwl/steps/applycal.cwl
index 748029f85ade072e5bed2419133931070a17c6a6..49b2f718cf4eff4e31cc21f86f5cc019efb15608 100644
--- a/lofar-cwl/steps/applycal.cwl
+++ b/lofar-cwl/steps/applycal.cwl
@@ -48,17 +48,34 @@ inputs:
       Type of correction to perform. When using H5Parm, this is for now the name
       of the soltab; the type will be deduced from the metadata in that soltab,
       except for full Jones, in which case correction should be 'fulljones'.
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+      prefix: msout.storagemanager=
+  - id: databitrate
+    type: int?
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
   - id: updateweights
-    type: boolean?
+    type: string?
     inputBinding:
       position: 0
-      prefix: applycal.updateweights=True
+      prefix: applycal.updateweights=
+      separate: false
 outputs:
   - id: msout
     doc: Output Measurement Set
     type: Directory
     outputBinding:
       glob: $(inputs.msin.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'applycal_$(inputs.correction)*.log'
+stdout: applycal_$(inputs.correction).log
+stderr: applycal_$(inputs.correction)_err.log
 arguments:
   - 'steps=[applycal]'
   - msout=.
@@ -70,4 +87,4 @@ requirements:
   - class: InlineJavascriptRequirement
 hints:
   - class: DockerRequirement
-    dockerPull: 'lofareosc/lofar-pipeline-ci:latest'
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
diff --git a/lofar-cwl/steps/applytarget.cwl b/lofar-cwl/steps/applytarget.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..a079023d05e1ff8491a2444f8cb01b7e1f4ee85a
--- /dev/null
+++ b/lofar-cwl/steps/applytarget.cwl
@@ -0,0 +1,105 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: applytarget
+baseCommand:
+  - DPPP
+inputs:
+  - id: msin
+    type: Directory
+    inputBinding:
+      position: 0
+      prefix: msin=
+      separate: false
+    doc: Input Measurement Set
+  - id: msout_name
+    type: string
+    default: '.'
+    inputBinding:
+      position: 0
+      prefix: msout=
+      separate: false
+    doc: Name of output MS
+  - default: DATA
+    id: msin_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msin.datacolumn=
+      separate: false
+    doc: Input data Column
+  - id: parmdb
+    type: File
+    inputBinding:
+      position: 0
+      prefix: applycal.parmdb=
+      separate: false
+    doc: >-
+      Path of parmdb in which the parameters are stored. This can also be an
+      H5Parm file, in that case the filename has to end in '.h5'
+  - id: msout_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msout.datacolumn=
+      separate: false
+    doc: Output data column
+  - default: gain
+    id: correction
+    type: string
+    inputBinding:
+      position: 0
+      prefix: applycal.correction=
+      separate: false
+    doc: >
+      Type of correction to perform. When using H5Parm, this is for now the name
+      of the soltab; the type will be deduced from the metadata in that soltab,
+      except for full Jones, in which case correction should be 'fulljones'.
+  - default: 'sol000'
+    id: solset
+    type: string
+    inputBinding:
+      position: 0
+      prefix: applycal.solset=
+      separate: false
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+      prefix: msout.storagemanager=
+      separate: false
+  - id: databitrate
+    type: int?
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
+  - id: updateweights
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: applycal.updateweights=
+      separate: false
+outputs:
+  - id: msout
+    doc: Output Measurement Set
+    type: Directory
+    outputBinding:
+      glob: '$(inputs.msout_name=="."?inputs.msin.basename:inputs.msout_name)'
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'applycal_$(inputs.correction).log'
+stdout: applycal_$(inputs.correction).log
+stderr: applycal_$(inputs.correction)_err.log
+arguments:
+  - 'steps=[applycal]'
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
diff --git a/lofar-cwl/steps/calib_rot_diag.cwl b/lofar-cwl/steps/calib_rot_diag.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..f57c1a88952b2ea079fe83086359f145aaef9ba9
--- /dev/null
+++ b/lofar-cwl/steps/calib_rot_diag.cwl
@@ -0,0 +1,107 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: calib_rot_diag
+baseCommand:
+  - DPPP
+inputs:
+  - id: msin
+    type: Directory?
+    inputBinding:
+      position: 0
+      prefix: msin=
+      separate: false
+    doc: Input Measurement Set
+  - default: DATA
+    id: msin_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msin.datacolumn=
+      separate: false
+    doc: Input data Column
+  - default: MODEL_DATA
+    id: msin_modelcolum
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msin.modelcolumn=
+      separate: false
+    doc: Model data Column
+  - default: instrument.h5
+    id: output_name_h5parm
+    type: string
+    inputBinding:
+      position: 0
+      prefix: ddecal.h5parm=
+      separate: false
+  - default: out.MS
+    id: msout_name
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msout=
+      separate: false
+    doc: Output Measurement Set
+  - default: true
+    id: propagate_solutions
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: propagatesolutions=True
+  - default: false
+    id: flagunconverged
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: flagdivergedonly=True
+    doc: |
+      Flag unconverged solutions (i.e., those from solves that did not converge
+      within maxiter iterations).
+  - default: false
+    id: flagdivergedonly
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: flagdivergedonly=True
+    doc: |
+      Flag only the unconverged solutions for which divergence was detected.
+      At the moment, this option is effective only for rotation+diagonal
+      solves, where divergence is detected when the amplitudes of any station
+      are found to be more than a factor of 5 from the mean amplitude over all
+      stations.
+      If divergence for any one station is detected, all stations are flagged
+      for that solution interval. Only effective when flagunconverged=true
+      and mode=rotation+diagonal.
+outputs:
+  - id: msout
+    doc: Output Measurement Set
+    type: Directory
+    outputBinding:
+      glob: '$(inputs.msout_name=="."?inputs.msin:inputs.msout_name)'
+  - id: h5parm
+    doc: Filename of output H5Parm (to be read by e.g. losoto)
+    type: File
+    outputBinding:
+      glob: $(inputs.output_name_h5parm)
+    format: 'lofar:#H5Parm'
+arguments:
+  - 'steps=[ddecal]'
+  - ddecal.mode=rotation+diagonal
+  - ddecal.uvlambdamin=300
+  - ddecal.maxiter=50
+  - ddecal.nchan=1
+  - ddecal.solint=1
+  - ddecal.propagateconvergedonly=True
+  - ddecal.flagdivergedonly=True
+  - ddecal.tolerance=1.e-3
+  - ddecal.usemodelcolumn=True
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+requirements:
+  - class: InlineJavascriptRequirement
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/lofar-cwl/steps/check_ateam_separation.cwl b/lofar-cwl/steps/check_ateam_separation.cwl
index 1c383d46dc104cca27c070d63c0d3f076794197e..c8d801c94a6e32aac1ea6ba83a8d2687448baf22 100755
--- a/lofar-cwl/steps/check_ateam_separation.cwl
+++ b/lofar-cwl/steps/check_ateam_separation.cwl
@@ -1,7 +1,5 @@
 class: CommandLineTool
 cwlVersion: v1.0
-$namespaces:
-  sbg: 'https://www.sevenbridges.com/'
 id: check_ateam_separation
 baseCommand:
   - python3
@@ -39,6 +37,6 @@ outputs:
 label: check_Ateam_separation
 hints:
   - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline
+    dockerPull: lofareosc/prefactor:HBAcalibrator
   - class: InlineJavascriptRequirement
 stdout: Ateam_separation.log
diff --git a/lofar-cwl/steps/ddecal.cwl b/lofar-cwl/steps/ddecal.cwl
index cc54a6cda7892c991213dc11cbe3769fc8b55085..b0493198b5c1380b448c87442e422883786fd52a 100644
--- a/lofar-cwl/steps/ddecal.cwl
+++ b/lofar-cwl/steps/ddecal.cwl
@@ -7,10 +7,14 @@ baseCommand: [DPPP]
 
 requirements:
   InlineJavascriptRequirement: {}
+  InitialWorkDirRequirement:
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
 
 arguments:
   - steps=[ddecal]
@@ -18,15 +22,14 @@ arguments:
   - ddecal.maxiter=50
   - ddecal.nchan=1
   - ddecal.solint=1
-  - ddecal.propagateconvergedonly=True
-  - ddecal.flagdivergedonly=True
   - ddecal.tolerance=1.e-3
   - ddecal.usemodelcolumn=True
-
+  - ddecal.flagdivergedonly=True
+  - ddecal.propagateconvergedonly=True
 
 inputs:
   - id: msin
-    type: Directory?
+    type: Directory
     doc: Input Measurement Set
     inputBinding:
       prefix: msin=
@@ -57,7 +60,7 @@ inputs:
   - id: msout_name
     type: string
     doc: Output Measurement Set
-    default: out.MS
+    default: "OUT.MS"
     inputBinding:
       prefix: msout=
       separate: false
@@ -67,7 +70,7 @@ inputs:
     type: boolean
     default: true
     inputBinding:
-      prefix: propagatesolutions=True
+      prefix: ddecal.propagatesolutions=True
   - id: flagunconverged
     type: boolean
     default: false
@@ -75,7 +78,7 @@ inputs:
       Flag unconverged solutions (i.e., those from solves that did not converge
       within maxiter iterations).
     inputBinding:
-      prefix: flagdivergedonly=True
+      prefix: ddecal.flagdivergedonly=True
   - id: flagdivergedonly
     default: false
     type: boolean
@@ -89,8 +92,13 @@ inputs:
       for that solution interval. Only effective when flagunconverged=true
       and mode=rotation+diagonal.
     inputBinding:
-      prefix: flagdivergedonly=True
-
+      prefix: ddecal.flagdivergedonly=True
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+      prefix: msout.storagemanager=
+      separate: false
   - id: mode
     type:
       type: enum
@@ -116,15 +124,21 @@ outputs:
     doc: Output Measurement Set
     type: Directory
     outputBinding:
-      glob: $(inputs.msout_name=="."?inputs.msin:inputs.msout_name)
+      glob: $(inputs.msin.basename)
 
   - id: h5parm
     doc: Filename of output H5Parm (to be read by e.g. losoto)
     type: File
-    format: lofar:#H5Parm
+    format: 'lofar:#H5Parm'
     outputBinding:
       glob: $(inputs.output_name_h5parm)
-
+      
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'ddecal*.log'
+stdout: ddecal.log
+stderr: ddecal_err.log
 $namespaces:
   lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
 $schema:
diff --git a/lofar-cwl/steps/dpppconcat.cwl b/lofar-cwl/steps/dpppconcat.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e4570f06b1db4bb7acb293e838ce4497d39ec9cf
--- /dev/null
+++ b/lofar-cwl/steps/dpppconcat.cwl
@@ -0,0 +1,141 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: dpppconcat
+baseCommand:
+  - DPPP
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    inputBinding:
+      position: 0
+      prefix: msin=
+      separate: false
+      itemSeparator: ','
+      valueFrom: $(concatenate_path(self))
+    doc: Input Measurement Set
+  - id: msout_name
+    type: string
+    inputBinding:
+      prefix: msout=
+      separate: false
+      shellQuote: false
+      position: 0
+  - id: msin_datacolumn
+    type: string
+    inputBinding:
+      prefix: msin.datacolumn=
+      separate: false
+      shellQuote: false
+      position: 0
+    doc: Input data Column
+    default: DATA
+  - id: msout_datacolumn
+    type: string
+    inputBinding:
+      prefix: msout.datacolumn=
+      separate: false
+      shellQuote: false
+      position: 0
+    default: DATA
+  - id: filter_baselines
+    type: string
+    inputBinding:
+      prefix: filter.baseline=
+      separate: false
+      shellQuote: true
+      position: 0
+      valueFrom: $(self)
+    default: null
+  - id: filter_remove
+    type: boolean
+    inputBinding:
+      prefix: filter.remove=True
+      shellQuote: false
+      position: 0
+    default: false
+  - id: writefullresflag
+    type: boolean
+    inputBinding:
+      prefix: msout.writefullresflag=True
+      shellQuote: false
+      position: 0
+    default: false
+  - id: overwrite
+    type: boolean
+    inputBinding:
+      prefix: msout.overwrite=True
+      shellQuote: false
+      position: 0
+    default: false
+  - id: storagemanager
+    type: string
+    inputBinding:
+      prefix: msout.storagemanager=
+      separate: false
+      shellQuote: false
+      position: 0
+    default: ''
+  - id: databitrate
+    type: int?
+    inputBinding:
+      prefix: msout.storagemanager.databitrate=
+      separate: false
+      shellQuote: false
+      position: 0
+  - id: missingdata
+    type: boolean
+    inputBinding:
+      prefix: msout.missingdata=True
+      separate: false
+      shellQuote: false
+      position: 0
+  - id: baseline
+    type: string?
+    inputBinding:
+      prefix: msin.baseline=
+      separate: false
+      shellQuote: true
+      position: 0
+    default: '*'
+  - id: avg_timeresolution
+    type: int?
+    inputBinding:
+      prefix: avg.timeresolution=
+      separate: false
+      shellQuote: false
+      position: 0
+    default: 1
+  - id: avg_freqresolution
+    type: string?
+    inputBinding:
+      prefix: avg.freqresolution=
+      separate: false
+      shellQuote: false
+      position: 0
+    default: 12.205kHz
+outputs:
+  - id: msout
+    doc: Output Measurement Set
+    type: Directory
+    outputBinding:
+      glob: $(inputs.msout_name)
+  - id: logfile
+    type: 'File[]'
+    outputBinding:
+      glob: concat*.log
+arguments:
+  - 'steps=[filter,avg]'
+  - msout.orderms=False
+  - avg.type=average
+requirements:
+  - class: ShellCommandRequirement
+  - class: InlineJavascriptRequirement
+    expressionLib:
+      - { $include: 'utils.js' }
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+stdout: concat.log
+stderr: concat_err.log
diff --git a/lofar-cwl/steps/filter_predict.cwl b/lofar-cwl/steps/filter_predict.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..35e182e29facec80f1313e2e824279a74008fa03
--- /dev/null
+++ b/lofar-cwl/steps/filter_predict.cwl
@@ -0,0 +1,118 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: predict
+baseCommand:
+  - DPPP
+inputs:
+  - id: msin
+    type: Directory
+    inputBinding:
+      position: 0
+      prefix: msin=
+      separate: false
+    doc: Input Measurement Set
+  - default: DATA
+    id: msin_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msin.datacolumn=
+      separate: false
+    doc: Input data Column
+  - default: MODEL_DATA
+    id: msout_datacolumn
+    type: string
+    inputBinding:
+      position: 0
+      prefix: msout.datacolumn=
+      separate: false
+  - id: sources_db
+    type: File
+    inputBinding:
+      position: 0
+      prefix: predict.sourcedb=
+      separate: false
+  - default: null
+    id: sources
+    type: 'string[]'
+    inputBinding:
+      position: 0
+      prefix: predict.sources=
+      separate: false
+      itemSeparator: ','
+      valueFrom: "[$(self.join(','))]"
+  - default: false
+    id: usebeammodel
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: predict.usebeammodel=True
+  - default: false
+    id: onebeamperpatch
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: predict.onebeamperpatch=True
+  - default: null
+    id: filter_baselines
+    type: string
+    inputBinding:
+      position: 0
+      prefix: filter.baseline=
+      separate: false
+      valueFrom: '$(self)'
+  - default: false
+    id: filter_remove
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: filter.remove=True
+  - id: writefullresflag
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.writefullresflag=True
+  - id: overwrite
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.overwrite=True
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+       prefix: msout.storagemanager=
+       separate: false
+  - id: databitrate
+    type: int?
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
+outputs:
+  - id: msout
+    doc: Output Measurement Set
+    type: Directory
+    outputBinding:
+      glob: $(inputs.msin.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'filter_predict*.log'
+arguments:
+  - 'steps=[filter,predict]'
+  - predict.beammode=array_factor
+  - predict.usechannelfreq=False
+  - msout=.
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: filter_predict.log
+stderr: filter_predict_err.log
\ No newline at end of file
diff --git a/lofar-cwl/steps/gaincal.cwl b/lofar-cwl/steps/gaincal.cwl
index e017373e0bfe4a6ef68930d4f380dbfbc8cb65e7..3d668b023f5ed4f621d4aeecd4bd893cd311aa42 100644
--- a/lofar-cwl/steps/gaincal.cwl
+++ b/lofar-cwl/steps/gaincal.cwl
@@ -1,114 +1,181 @@
-#!/usr/bin/env cwl-runner
-
 class: CommandLineTool
 cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
 id: gaincal
-baseCommand: [DPPP]
-
-requirements:
-  InlineJavascriptRequirement: {}
-
-hints:
-  DockerRequirement:
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
-
-arguments:
-  - steps=[gaincal]
-
-
+baseCommand:
+  - DPPP
 inputs:
   - id: msin
-    type: Directory?
-    doc: Input Measurement Set
+    type: Directory
     inputBinding:
-        prefix: msin=
-        separate: false
+      position: 0
+      prefix: msin=
+      separate: false
+    doc: Input Measurement Set
   - id: caltype
+    type:
+      type: enum
+      symbols:
+        - diagonal
+        - fulljones
+        - phaseonly
+        - scalarphase
+        - amplitude
+        - scalaramplitude
+        - tec
+        - tecandphase
+      name: caltype
+    inputBinding:
+      position: 0
+      prefix: gaincal.caltype=
+      separate: false
     doc: |
       The type of calibration that needs to be performed.
-    type:
-        type: enum
-        symbols:
-            - diagonal
-            - fulljones
-            - phaseonly
-            - scalarphase
-            - amplitude
-            - scalaramplitude
-            - tec
-            - tecandphase
-    inputBinding:
-        prefix: gaincal.caltype=
-        separate: false
   - id: sourcedb
     type: File
     inputBinding:
-        prefix: gaincal.sourcedb=
-        separate: false
-  - id: usebeammodel
+      position: 0
+      prefix: gaincal.sourcedb=
+      separate: false
+  - default: true
+    id: usebeammodel
     type: boolean
-    default: true
     inputBinding:
-        prefix: gaincal.usebeammodel=true
-        separate: false
-  - id: solint
+      position: 0
+      prefix: gaincal.usebeammodel=true
+      separate: false
+  - default: 1
+    id: solint
     type: int
-    default: 1
-    doc: |
-        Number of time slots on which a solution is assumed to be constant (same as CellSize.Time in BBS).
-        0 means all time slots. Note that for larger settings of solint, and specially for solint = 0,
-        the memory usage of gaincal will be large (all visibilities for a solint should fit in memory).
-  - id: msin_datacolumn
+    doc: >
+      Number of time slots on which a solution is assumed to be constant (same
+      as CellSize.Time in BBS).
+
+      0 means all time slots. Note that for larger settings of solint, and
+      specially for solint = 0,
+
+      the memory usage of gaincal will be large (all visibilities for a solint
+      should fit in memory).
+  - default: DATA
+    id: msin_datacolumn
     type: string?
-    default: DATA
-    doc: Input data Column
     inputBinding:
-        prefix: msin.datacolumn=
-        separate: false
-  - id: onebeamperpatch
-    type: boolean
+      position: 0
+      prefix: msin.datacolumn=
+      separate: false
     doc: Input data Column
-    default: true
+  - default: false
+    id: onebeamperpatch
+    type: boolean
     inputBinding:
-        prefix: gaincal.onebeamperpatch=True
-        separate: false
-  - id: msin_modelcolum
+      position: 0
+      prefix: gaincal.onebeamperpatch=True
+      separate: false
+    doc: Input data Column
+  - default: MODEL_DATA
+    id: msin_modelcolum
     type: string
-    default: MODEL_DATA
-    doc: Model data Column
     inputBinding:
-        prefix: msin.modelcolumn=
-        separate: false
-
-  - id: output_name_h5parm
+      position: 0
+      prefix: msin.modelcolumn=
+      separate: false
+    doc: Model data Column
+  - default: instrument.h5
+    id: output_name_h5parm
     type: string
-    default: instrument.h5
     inputBinding:
-        prefix: gaincal.parmdb=
-        separate: false
-  - id: msout_name
+      position: 0
+      prefix: gaincal.parmdb=
+      separate: false
+  - default: out.MS
+    id: msout_name
     type: string
+    inputBinding:
+      position: 0
+      prefix: msout=
+      separate: false
     doc: Output Measurement Set
-    default: out.MS
+  - default: true
+    id: propagatesolutions
+    type: boolean
     inputBinding:
-        prefix: msout=
-        separate: false
-
+      position: 0
+      prefix: gaincal.propagatesolutions=True
+      separate: false
+  - default: true
+    id: usechannelfreq
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: gaincal.usechannelfreq=True
+      separate: false
+  - default: array_factor
+    id: beammode
+    type: string
+    inputBinding:
+      position: 0
+      prefix: gaincal.beammode=
+      separate: false
+  - default: 0
+    id: nchan
+    type: int
+    inputBinding:
+      position: 0
+      prefix: gaincal.nchan=
+      separate: false
+  - default: 50
+    id: maxiter
+    type: int
+    inputBinding:
+      position: 0
+      prefix: gaincal.maxiter=
+      separate: false
+  - default: 1e-3
+    id: tolerance
+    type: float
+    inputBinding:
+      position: 0
+      prefix: gaincal.tolerance=
+      separate: false
+  - default: null
+    id: blrange
+    type: 'int[]'
+    inputBinding:
+      position: 0
+      prefix: filter.blrange=
+      separate: false
+      itemSeparator: ','
+      valueFrom: "[$(self.join(','))]"
 outputs:
   - id: msout
     doc: Output Measurement Set
     type: Directory
     outputBinding:
-      glob: $(inputs.msout_name=="."?inputs.msin:inputs.msout_name)
-
+      glob: '$(inputs.msout_name=="."?inputs.msin.basename:inputs.msout_name)'
   - id: h5parm
     doc: Filename of output H5Parm (to be read by e.g. losoto)
     type: File
-    format: lofar:#H5Parm
     outputBinding:
       glob: $(inputs.output_name_h5parm)
-
-$namespaces:
-  lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
+    format: 'lofar:#H5Parm'
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'gaincal*.log'
+stdout: gaincal.log
+stderr: gaincal_err.log
+arguments:
+  - 'steps=[filter,gaincal]'
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+  - class: InlineJavascriptRequirement
 $schema:
-  - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/lofar-cwl/steps/interpolate_visibilities.cwl b/lofar-cwl/steps/interpolate_visibilities.cwl
index 7d7c97f932ab6fa0d122544332e6d870a385923f..f59288857c81a6935fba6464f40c6be170af1f47 100644
--- a/lofar-cwl/steps/interpolate_visibilities.cwl
+++ b/lofar-cwl/steps/interpolate_visibilities.cwl
@@ -3,50 +3,52 @@ cwlVersion: v1.0
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 id: interpolate_visibilities
-
 baseCommand:
   - DPPP
-arguments:
-  - msout.datacolumn=INTERP_DATA
-  - msout=.
-  - msin.datacolumn=DATA
-  - steps=[interpolate]
 inputs:
   - id: msin
     type: Directory
     inputBinding:
-      prefix: 'msin='
+      position: 0
+      prefix: msin=
       separate: false
-  - id: storage_manager
+  - default: Dysco
+    id: storage_manager
     type: string
-    default: Dysco
     inputBinding:
+      position: 0
+      prefix: msout.storagemanager=
       separate: false
-      prefix: 'msout.storagemanager='
-  - id: storage_manager_databitrate
+  - default: 0
+    id: storage_manager_databitrate
     type: int
-    default: 0
     inputBinding:
-      prefix: 'msout.storagemanager.databitrate='
+      position: 0
+      prefix: msout.storagemanager.databitrate=
       separate: false
   - id: window_size
     type: int
     inputBinding:
-      prefix: 'interpolate.windowsize='
+      position: 0
+      prefix: interpolate.windowsize=
       separate: false
-
 outputs:
   - id: msout
     type: Directory
     outputBinding:
       glob: $(inputs.msin.basename)
 label: interpolate_visibilities
-hints:
-  - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
-
+arguments:
+  - msout.datacolumn=INTERP_DATA
+  - msout=.
+  - msin.datacolumn=DATA
+  - 'steps=[interpolate]'
 requirements:
   - class: InitialWorkDirRequirement
     listing:
       - entry: $(inputs.msin)
         writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
diff --git a/lofar-cwl/steps/makesourcedb.cwl b/lofar-cwl/steps/makesourcedb.cwl
index fec1acf4708bbd8857e01b840a51cb93cd8fc60a..97b23e5f5e9cc7d16c11bec60c29dc9ff0ca32c1 100755
--- a/lofar-cwl/steps/makesourcedb.cwl
+++ b/lofar-cwl/steps/makesourcedb.cwl
@@ -10,6 +10,7 @@ inputs:
     type:
       - File
       - string
+    default: '/data/skymodels/Ateam_LBA_CC.skymodel'
     inputBinding:
       position: 0
       prefix: in=
@@ -21,7 +22,7 @@ inputs:
       position: 1
       prefix: out=
       separate: false
-      valueFrom: Ateam.sourcedb
+      valueFrom: $(inputs.output_file_name)
   - default: blob
     id: outtype
     type: string?
@@ -36,6 +37,9 @@ inputs:
       position: 3
       prefix: format=
       separate: false
+  - default: make_sourcedb.log
+    id: logname
+    type: string?
 outputs:
   - id: sourcedb
     type:
@@ -46,11 +50,11 @@ outputs:
   - id: log
     type: File?
     outputBinding:
-      glob: make_sourcedb_ateam.log
+      glob: $(inputs.logname)
 label: make_sourcedb_ateam
 hints:
   - class: DockerRequirement
-    dockerPull: 'lofareosc/lofar-pipeline:latest'
-stdout: make_sourcedb_ateam.log
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+stdout: $(inputs.logname)
 requirements:
   - class: InlineJavascriptRequirement
diff --git a/lofar-cwl/steps/ms_concat.cwl b/lofar-cwl/steps/ms_concat.cwl
index c374f67951bfc9d73f0e8049636bf29541edc8c6..e52cb633efc76310b182afbf2abbb44416f8ef36 100644
--- a/lofar-cwl/steps/ms_concat.cwl
+++ b/lofar-cwl/steps/ms_concat.cwl
@@ -3,14 +3,13 @@ cwlVersion: v1.0
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 id: ms_concat
-
-
 baseCommand:
-  - concat_MS.py
+  - python3
+  - /usr/local/bin/concat_MS_CWL.py
 inputs:
-  - id: min_length
+  - default: 50
+    id: min_length
     type: int?
-    default: 50
     inputBinding:
       position: 0
       prefix: '--min_length'
@@ -35,25 +34,25 @@ inputs:
       position: 2
 outputs:
   - id: concat_meta_ms
-    type: Directory[]
+    type: 'Directory[]'
     outputBinding:
-      glob: >
+      glob: |
         $(inputs.msout)_[0-9*]
   - id: concat_additional_ms
-    type: Directory[]
+    type: 'Directory[]'
     outputBinding:
       glob: $(inputs.msout)_*_CONCAT
   - id: ms_outs
-    type: Directory[]
+    type: 'Directory[]'
     outputBinding:
       outputEval: $(inputs.msin)
 label: ms_concat
 requirements:
   - class: ShellCommandRequirement
   - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
-  - class: InlineJavascriptRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
   - class: InitialWorkDirRequirement
     listing:
       - entry: $(inputs.msin)
         writable: true
+  - class: InlineJavascriptRequirement
diff --git a/lofar-cwl/steps/predict.cwl b/lofar-cwl/steps/predict.cwl
index d9facbb83d6430dcde76caf49490e711afe14952..dcd0781c256c0ed5c88d0a3ba41d7f80ece813af 100644
--- a/lofar-cwl/steps/predict.cwl
+++ b/lofar-cwl/steps/predict.cwl
@@ -49,12 +49,37 @@ inputs:
     inputBinding:
       position: 0
       prefix: predict.usebeammodel=True
+  - id: writefullresflag
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.writefullresflag=True
+  - id: overwrite
+    type: boolean
+    default: false
+    inputBinding:
+       prefix: msout.overwrite=True
+  - id: storagemanager
+    type: string
+    default: ""
+    inputBinding:
+       prefix: msout.storagemanager=
+       separate: false
+  - id: databitrate
+    type: int?
+    inputBinding:
+       prefix: msout.storagemanager.databitrate=
+       separate: false
 outputs:
   - id: msout
     doc: Output Measurement Set
     type: Directory
     outputBinding:
       glob: $(inputs.msin.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'predict_cal*.log'
 arguments:
   - 'steps=[predict]'
   - predict.beammode=array_factor
@@ -68,4 +93,6 @@ requirements:
   - class: InlineJavascriptRequirement
 hints:
   - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: predict_cal.log
+stderr: predict_cal_err.log
\ No newline at end of file
diff --git a/lofar-cwl/steps/utils.js b/lofar-cwl/steps/utils.js
index 2077e7bab63619084d2d767fd3603f464f4c319b..711c00ab03dfc1af230f3e891dde819da5775431 100644
--- a/lofar-cwl/steps/utils.js
+++ b/lofar-cwl/steps/utils.js
@@ -1,13 +1,13 @@
 function get_losoto_config(step_name) {
     var par = ['soltab = ' + inputs.soltab]
     if (inputs.ncpu !== null && inputs.ncpu !== undefined) par.push('ncpu='+inputs.ncpu);
-    console.log(inputs, par)
     par.push("[" + step_name + "]")
     par.push('operation=' + step_name)
     for(var field_name in inputs){
         if(field_name === 'input_h5parm' ||
            field_name === 'soltab' ||
-           field_name === 'ncpu') continue;
+           field_name === 'ncpu' || 
+           field_name === 'execute') continue;
 
         if(inputs[field_name] === null ||
            inputs[field_name] === 'null') continue;
@@ -22,3 +22,9 @@ function get_losoto_config(step_name) {
     }
     return par
 }
+
+function concatenate_path(object_list){
+    object_list.forEach(function (x, index, arr) {arr[index] = x.path;});
+    return '[' + object_list.join(',') + ']'
+    
+}
\ No newline at end of file
diff --git a/lofar-cwl/steps/wsclean.cwl b/lofar-cwl/steps/wsclean.cwl
index b1ab1734c56bf7af9f1efb30a6a94c9e77dd3ad4..08d1e3d6596529d97a9ff5f718a983676afd748c 100644
--- a/lofar-cwl/steps/wsclean.cwl
+++ b/lofar-cwl/steps/wsclean.cwl
@@ -1,42 +1,47 @@
 class: CommandLineTool
 cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
 id: wsclean
 baseCommand:
   - wsclean
 inputs:
-  - id: image_size
-    type: int[]
-    default: [1000, 1000]
+  - default:
+      - 1000
+      - 1000
+    id: image_size
+    type: 'int[]'
     inputBinding:
       position: 1
-      prefix: -size
-  - id: image_scale
+      prefix: '-size'
+  - default: 0.01
+    id: image_scale
     type: float
-    default: 0.01
     inputBinding:
       position: 1
-      prefix: -scale
+      prefix: '-scale'
       valueFrom: $(self)deg
-  - id: image_name
-    default: image
+  - default: image
+    id: image_name
     type: string
     inputBinding:
       position: 1
-      prefix: -name
+      prefix: '-name'
   - id: msin
     type: Directory
     inputBinding:
       position: 2
 outputs:
-  dirty_image:
+  - id: dirty_image
     type: File
     outputBinding:
       glob: $(inputs.image_name)-dirty.fits
-  image:
+  - id: image
     type: File
     outputBinding:
       glob: $(inputs.image_name)-image.fits
 label: WSClean
 requirements:
   - class: DockerRequirement
-    dockerPull: lofareosc/lofar-pipeline-ci:latest
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+  - class: InlineJavascriptRequirement
diff --git a/steps/add_missing_stations.cwl b/steps/add_missing_stations.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..d2258e1771c70c2055aaf01b9b0ead31285cc0ae
--- /dev/null
+++ b/steps/add_missing_stations.cwl
@@ -0,0 +1,89 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: add_missing_stations
+baseCommand:
+  - python3
+  - /usr/local/bin/add_missing_stations.py
+inputs:
+  - default: output.h5
+    id: h5parm
+    type: File
+    inputBinding:
+      position: 1
+    doc: H5parm to which this action should be performed.
+  - id: refh5parm
+    type: File
+    inputBinding:
+      position: 0
+      prefix: '--refh5'
+    doc: External H5parm from which the full list of antennas is used from.
+  - id: solset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--solset'
+    default: 'sol000'
+    doc: Input calibration solutions
+  - id: refsolset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--refsolset'
+    doc: Input calibration solutions of the reference h5parm file
+    default: 'sol000'
+  - id: soltab_in
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--soltab_in'
+    doc: Input solution table
+    default: 'phase000'
+  - id: soltab_out
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--soltab_out'
+    doc: Output solution table (has to be different from input solution table)
+    default: 'GSMphase'
+  - id: filter
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--filter'
+    doc: Filter these antenna string from the processing
+    default: '[CR]S*&'
+  - id: bad_antennas
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--bad_antennas'
+    doc: Antenna string to be processed
+    default: '[CR]S*&'
+outputs:
+  - id: outh5parm
+    type: File
+    outputBinding:
+      glob: $(inputs.h5parm.basename)
+    format: 'lofar:#H5Parm'
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: 'add_missing_stations*.log'
+
+stdout: add_missing_stations.log
+stderr: add_missing_stations_err.log
+label: add_missing_stations
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.h5parm)
+        writable: true
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/steps/blsmooth.cwl b/steps/blsmooth.cwl
index ccce108ee515d21d5c22202ea074d63d564fde93..47d6c59a1af6a835f6ff6e3bb0d1c467f31e1ce3 100644
--- a/steps/blsmooth.cwl
+++ b/steps/blsmooth.cwl
@@ -22,8 +22,9 @@ inputs:
     type: boolean
     doc: 'If true performs smoothing'
     inputBinding:
-      prefix: '--smooth=SMOOTH'
-
+      prefix: -S
+      valueFrom: "$(self ? 'True': 'False')"
+      separate: true
   - default: 0.5
     id: bscalefactor
     type: float
@@ -81,12 +82,17 @@ outputs:
     type: Directory
     outputBinding:
       glob: $(inputs.msin.basename)
+  - id: logfile
+    type: File
+    outputBinding:
+      glob: BLsmooth.log
 hints:
  - class: DockerRequirement
-   dockerPull: lofareosc/prefactor-ci:master
+   dockerPull: lofareosc/prefactor:HBAcalibrator
 requirements:
  - class: InitialWorkDirRequirement
    listing:
     - entry: $(inputs.msin)
       writable: true
  - class: InlineJavascriptRequirement
+stderr: BLsmooth.log
diff --git a/steps/bulk_rename.cwl b/steps/bulk_rename.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..9102a16c2b80e11c577082a1b0f2498319eb2779
--- /dev/null
+++ b/steps/bulk_rename.cwl
@@ -0,0 +1,39 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: bulk_rename
+baseCommand:
+  - bash 
+  - bulk_rename.sh
+inputs:
+  - id: file_list
+    type: 'File[]'
+    inputBinding:
+      position: 0
+  - id: file_prefix
+    type: string
+  - id: file_suffix
+    type: string?
+outputs:
+  - id: output
+    type: 'File[]'
+    outputBinding:
+      glob: "tmp/$(inputs.file_prefix)*"
+label: bulk_rename
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: bulk_rename.sh
+        entry: |
+          #!/bin/bash
+          set -e
+          FILE_LIST=("\${@}")
+          FILE_PREFIX=$(inputs.file_prefix)
+          FILE_SUFFIX=$(inputs.file_suffix === null ? '' : inputs.file_suffix)
+          mkdir tmp
+          for i in "\${!FILE_LIST[@]}"; do 
+            cp "\${FILE_LIST[\$i]}" "tmp/\${FILE_PREFIX}_\${i}\${FILE_SUFFIX}"
+          done
+        writable: false
+  - class: InlineJavascriptRequirement
\ No newline at end of file
diff --git a/steps/check_ateam_separation.cwl b/steps/check_ateam_separation.cwl
old mode 100755
new mode 100644
index 977d9f86e63f3b003833aee677d330f1f188253d..516beb6100f9e73b06cef498a05fc64ae74bd101
--- a/steps/check_ateam_separation.cwl
+++ b/steps/check_ateam_separation.cwl
@@ -39,6 +39,6 @@ outputs:
 label: check_Ateam_separation
 hints:
   - class: DockerRequirement
-    dockerPull: lofareosc/prefactor
+    dockerPull: lofareosc/prefactor:HBAcalibrator
   - class: InlineJavascriptRequirement
 stdout: Ateam_separation.log
diff --git a/steps/check_unflagged_fraction.cwl b/steps/check_unflagged_fraction.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..0a42b9ff12519530c2abf7c49d1479d8be50ec95
--- /dev/null
+++ b/steps/check_unflagged_fraction.cwl
@@ -0,0 +1,74 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: check_unflagged_fraction
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory
+      doc: MS to check
+      inputBinding:
+        position: 0
+    - id: min_fraction
+      type: float?
+      default: 0.5
+      doc: Fraction of flagged data in a MS to be acceptable
+
+label: check_unflagged_fraction
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    import shutil
+    import os
+
+    from check_unflagged_fraction import main as check_unflagged_fraction
+
+    ms = sys.argv[1]
+    min_fraction = float($(inputs.min_fraction))
+    
+    output = check_unflagged_fraction(ms, min_fraction=min_fraction, print_fraction=True)
+
+    filename           = os.path.basename(output['flagged'])
+    unflagged_fraction = output['unflagged_fraction']
+
+    if filename != 'None':
+        shutil.move(filename, filename.lstrip('out_'))
+        
+    cwl_output = {}
+    cwl_output['unflagged_fraction'] = unflagged_fraction
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: msout
+    type: Directory[]
+    outputBinding:
+        glob: 'L*.dpppconcat'
+  - id: unflagged_fraction
+    type: float
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).unflagged_fraction)
+  - id: logfile
+    type: File[]?
+    outputBinding:
+      glob: 'check_unflagged_fraction*.log'
+        
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: check_unflagged_fraction.log
+stderr: check_unflagged_fraction_err.log
\ No newline at end of file
diff --git a/steps/collectlog.cwl b/steps/collectlog.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..ab5987b158461486c26fd1c3f6066c54c4136ffa
--- /dev/null
+++ b/steps/collectlog.cwl
@@ -0,0 +1,49 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: collectlog
+baseCommand:
+  - bash
+  - collect_logs.sh
+inputs:
+  - id: start_directory
+    type: Directory?
+  - id: log_files
+    type:
+      - File
+      - type: array
+        items:
+           - File
+           - Directory
+    inputBinding:
+      position: 0
+  - id: sub_directory_name
+    type: string
+outputs: 
+  - id: log_dir
+    type: Directory
+    outputBinding:
+        glob: |
+          $(inputs.start_directory === null ? inputs.sub_directory_name: inputs.start_directory.basename)
+label: CollectLog
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: collect_logs.sh
+        entry: |
+          #!/bin/bash
+          set -e
+          BASE_DIR="$(inputs.start_directory === null ? "" : inputs.start_directory.basename)"
+          SUB_DIR="$(inputs.sub_directory_name)"
+          if [ -z "$BASE_DIR" ]
+          then
+          OUTPUT_PATH=$SUB_DIR
+          else
+          OUTPUT_PATH=$BASE_DIR/$SUB_DIR
+          fi
+          echo $OUTPUT_PATH
+          mkdir -p $OUTPUT_PATH
+          cp -rL $* $OUTPUT_PATH
+        writable: false
+  - class: InlineJavascriptRequirement
diff --git a/steps/compare_station_list.cwl b/steps/compare_station_list.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..21e18c5f8aeec2430e1ebbd850a297d69575c5c0
--- /dev/null
+++ b/steps/compare_station_list.cwl
@@ -0,0 +1,65 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: compare_station_list
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory[]
+      doc: MS to compare with
+      inputBinding:
+        position: 0
+    - id: h5parmdb
+      type: File
+      doc: H5parm database to compare with
+    - id: solset_name
+      type: string?
+      doc: Name of the H5parm solset
+      default: 'sol000'
+    - id: filter
+      type: string?
+      default: '*&'
+      doc: Filter these baselines for the comparison
+
+label: compareStationList.py
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    from compareStationList import main as compareStationList
+    
+    mss = sys.argv[1:]
+    h5parmdb = $(inputs.h5parmdb)['path']
+    solset_name = '$(inputs.solset_name)'
+    filter = '$(inputs.filter)'
+
+    output = compareStationList(mss, h5parmdb, solset_name, filter)
+
+    filter_out = output['filter']
+    cwl_output = {"filter_out": filter_out}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+outputs:
+  - id: filter_out
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).filter_out)
+  - id: logfile
+    type: File[]?
+    outputBinding:
+      glob: 'compareStationList*.log'
+        
+requirements:
+  - class: InlineJavascriptRequirement
+
+hints:
+  DockerRequirement:
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: compareStationList.log
+stderr: compareStationList_err.log
\ No newline at end of file
diff --git a/steps/concatenate_files.cwl b/steps/concatenate_files.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e3f5bdac0a5e03c744726b23699baf0c3834a212
--- /dev/null
+++ b/steps/concatenate_files.cwl
@@ -0,0 +1,37 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: concatfiles
+baseCommand:
+  - bash 
+  - bulk_rename.sh
+inputs:
+  - id: file_list
+    type: 'File[]'
+    inputBinding:
+      position: 0
+  - id: file_prefix
+    type: string
+  - id: file_suffix
+    type: string?
+    default: log
+outputs:
+  - id: output
+    type: File
+    outputBinding:
+      glob: "$(inputs.file_prefix).$(inputs.file_suffix)"
+label: concatfiles
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: bulk_rename.sh
+        entry: |
+          #!/bin/bash
+          set -e
+          FILE_LIST=("\${@}")
+          FILE_PREFIX=$(inputs.file_prefix)
+          FILE_SUFFIX=$(inputs.file_suffix === null ? '' : inputs.file_suffix)
+          cat "\${FILE_LIST[@]}" > $FILE_PREFIX.$FILE_SUFFIX
+        writable: false
+  - class: InlineJavascriptRequirement
diff --git a/steps/createRMh5parm.cwl b/steps/createRMh5parm.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..d79ceaa783f93cf1dee382d2c398319b5f5ed019
--- /dev/null
+++ b/steps/createRMh5parm.cwl
@@ -0,0 +1,123 @@
+class: CommandLineTool
+cwlVersion: v1.0
+id: createRMh5parm
+label: createRMh5parm
+baseCommand:
+  - python3
+  - /usr/local/bin/createRMh5parm.py
+inputs:
+  - id: msin
+    type:
+      - Directory
+      - type: array
+        items: Directory
+    inputBinding:
+      position: 1
+    doc: Input measurement set
+  - id: h5parm
+    type: File
+    inputBinding:
+      position: 2
+    doc: Input h5parm solutions file
+  - id: ionex_server
+    type: string
+    doc: IONEX Server path
+    default: 'ftp://ftp.aiub.unibe.ch/CODE/'
+    inputBinding:
+      prefix: '--server'
+      position: 0
+  - id: ionex_prefix
+    type: string
+    doc: IONEX Prefix
+    default: 'CODG'
+    inputBinding:
+      prefix: '--prefix'
+      position: 0
+  - id: ionex_path
+    type: string
+    doc: IONEX path
+    default: './'
+    inputBinding:
+      prefix: '--path'
+      position: 0
+  - id: solset
+    type: string
+    doc: solset in which IONEX solution are put
+    default: 'sol000'
+    inputBinding:
+      prefix: '--solsetName'
+      position: 0
+  - id: timestep
+    type: float
+    doc: timestep in seconds
+    default: 300.
+    inputBinding:
+      prefix: '-t'
+      position: 0
+  - id: smart_interpol
+    type: float
+    doc: float parameter describing how much of Earth rotation is taken in to account in interpolation of the IONEX files. 1.0 means time interpolation assumes ionosphere rotates in opposite direction of the Earth
+    default: 0.
+    inputBinding:
+      prefix: '-e'
+      position: 0
+  - id: proxyserver
+    type: string
+    doc: Specify proxy server if necessary
+    default: null
+    inputBinding:
+      prefix: '--proxyserver'
+      position: 0
+  - id: proxyport
+    type: int
+    doc: Specify proxy port if necessary
+    default: null
+    inputBinding:
+      prefix: '--proxyport'
+      position: 0
+  - id: proxytype
+    type: string
+    doc: Specify proxy type if necessary
+    default: null
+    inputBinding:
+      prefix: '--proxytype'
+      position: 0
+  - id: proxyuser
+    type: string
+    doc: Specify proxy user name if necessary
+    default: null
+    inputBinding:
+      prefix: '--proxyuser'
+      position: 0
+  - id: proxypass
+    type: string
+    doc: Specify proxy server password if necessary
+    default: null
+    inputBinding:
+      prefix: '--proxypass'
+      position: 0
+outputs:
+  - id: h5parmout
+    doc: h5parm output
+    type: File
+    format: 'lofar:#H5Parm'
+    outputBinding:
+      glob: $(inputs.h5parm.basename)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'createh5parm*.log'
+hints:
+ - class: DockerRequirement
+   dockerPull: lofareosc/prefactor:HBAcalibrator
+ - class: InitialWorkDirRequirement
+   listing:
+     - entry: $(inputs.h5parm)
+       writable: true
+   
+stdout: createh5parm.log
+stderr: createh5parm_err.log
+$namespaces:
+  lofar: https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
+$schema:
+  - https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl
diff --git a/steps/create_workflow_input.cwl b/steps/create_workflow_input.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..505eecf6aa537f5e59391e59a1e3d46f7deaec71
--- /dev/null
+++ b/steps/create_workflow_input.cwl
@@ -0,0 +1,42 @@
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: create_workflow_input
+label: create_workflow_input
+class: CommandLineTool
+cwlVersion: v1.0
+inputs: 
+  - id: msin
+    type: Directory[]
+    inputBinding:
+      position: 0
+    
+outputs: 
+  - id: output
+    type: File
+    outputBinding:
+      glob: workflow_input.json
+      
+baseCommand: 
+  - python3
+  - script.py
+doc: ''
+requirements:
+  InitialWorkDirRequirement:
+    listing:
+      - entryname: script.py
+        entry: | 
+          #!/usr/bin/env python3
+          
+          import sys
+          import json
+          import os
+          dir_list = sys.argv[1:]
+          rendered_leafs = []
+          
+          for dir in dir_list:
+              file_name = dir.split(os.path.sep)[-1]
+              rendered_leaf = {'class': 'Directory', 'path': file_name}
+              rendered_leafs.append(rendered_leaf)  
+            
+          with open('workflow_input.json', 'w') as fp:
+              json.dump({'msin': rendered_leafs}, fp, indent=4)
\ No newline at end of file
diff --git a/steps/filter_ms_group.cwl b/steps/filter_ms_group.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..d51dcf695a9e51a0b748b14c56842b4e76d64284
--- /dev/null
+++ b/steps/filter_ms_group.cwl
@@ -0,0 +1,58 @@
+class: CommandLineTool
+cwlVersion: v1.0
+id: filter_ms_group
+baseCommand:
+  - python3
+arguments:
+    - position: 0
+      valueFrom: script.py
+inputs:
+  - id: group_id
+    type: string
+  - id: groups_specification
+    type: File
+    inputBinding:
+      position: 1
+  - id: measurement_sets
+    type: 'Directory[]'
+    inputBinding:
+      position: 2
+outputs:
+  - id: output
+    type: Directory[]
+    outputBinding:
+      loadContents: true
+      glob: selected_ms.json
+      outputEval: '$(JSON.parse(self[0].contents))'
+label: filter_ms_group
+
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+     - entryname: script.py
+       entry: |
+        import sys
+        import json
+        import os
+
+        group_id = "$(inputs.group_id)"
+        json_file = sys.argv[1]
+        ms_list = sys.argv[2:]
+        
+        ms_by_name = { ms.split(os.path.sep)[-1]:
+                       {'class':'Directory', 'path': ms} for ms in ms_list}
+        
+        output_file = 'selected_ms.json'
+        
+        with open(json_file, 'r') as f_stream:
+            selected_ms = json.load(f_stream)[group_id]
+        print(selected_ms, ms_by_name)
+        selected_ms = [ms_by_name[os.path.basename(ms_name)] for ms_name in selected_ms]
+            
+        
+        with open(output_file, 'w') as f_stream:
+            json.dump(selected_ms, f_stream)
+               
+        
+    
diff --git a/steps/findRefAnt.cwl b/steps/findRefAnt.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e6562e0f61183e65d7046c146915940877264a61
--- /dev/null
+++ b/steps/findRefAnt.cwl
@@ -0,0 +1,54 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: findRefAnt
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory
+      doc: MS to compare with
+      inputBinding:
+        position: 0
+
+label: findRefAnt.py
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    from findRefAnt import main as findRefAnt
+    
+    ms = sys.argv[1]
+
+    flagged_fraction_dict = str(findRefAnt(ms))
+
+    cwl_output  = {"flagged_fraction_dict": flagged_fraction_dict}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: flagged_fraction_dict
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).flagged_fraction_dict)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: findRefAnt.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: findRefAnt.log
+stderr: findRefAnt_err.log
\ No newline at end of file
diff --git a/steps/findRefAnt_join.cwl b/steps/findRefAnt_join.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..11636573f7705c50ca1e783ec862e133cc2dfb11
--- /dev/null
+++ b/steps/findRefAnt_join.cwl
@@ -0,0 +1,80 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: findRefAnt_join
+baseCommand:
+  - python3
+inputs:
+    - id: flagged_fraction_dict
+      type: string[]?
+      default: []
+      doc: list of flagged antennas per MS
+    - id: filter_station
+      type: string?
+      default: '*&'
+      doc: Filter these baselines for the comparison
+      
+label: findRefAnt_join
+arguments:
+  - '-c'
+  - |
+  
+    import sys
+    import json
+    import re
+    import ast
+    
+    flagged_fraction_dict_list = $(inputs.flagged_fraction_dict)
+    filter_station = '$(inputs.filter_station)'
+    
+    flagged_fraction_data = {}
+    for flagged_fraction_dict in flagged_fraction_dict_list:
+        entry = ast.literal_eval(flagged_fraction_dict)
+        antennas = entry.keys()
+        selected_stations = [ station_name for station_name in antennas if re.match(filter_station, station_name) ]
+        if len(selected_stations) == 0:
+            raiseError('No stations left after filtering.')
+        for antenna in selected_stations:
+            try:
+                flagged_fraction_data[antenna].append(float(entry[antenna]))
+            except KeyError:
+                flagged_fraction_data[antenna] = [float(entry[antenna])]
+
+    flagged_fraction_list = []
+    sorted_stations = sorted(flagged_fraction_data.keys())
+
+    for antenna in sorted_stations:
+        flagged_fraction = sum(flagged_fraction_data[antenna]) / len(flagged_fraction_data[antenna])
+        flagged_fraction_list.append(flagged_fraction)
+        try:
+            flagged_fraction_data[flagged_fraction].append(antenna)
+        except KeyError:
+            flagged_fraction_data[flagged_fraction] = [antenna]
+
+    min_flagged_fraction = min(flagged_fraction_list)
+    refant = flagged_fraction_data[min_flagged_fraction][0]
+    print('Selected station ' + str(refant) + ' as reference antenna. Fraction of flagged data is ' + '{:>3}'.format('{:.1f}'.format(min_flagged_fraction) + '%'))
+
+    cwl_output = {'refant': str(refant)}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+
+outputs:
+  - id: refant
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).refant)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: findRefAnt.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+
+stdout: findRefAnt.log
+stderr: findRefAnt_err.log
\ No newline at end of file
diff --git a/steps/find_skymodel_cal.cwl b/steps/find_skymodel_cal.cwl
index 4bfe9b81deb56d97c324a10c4d156a08bd63bee4..4d0956951eda01b2d626f12344c73209f97de776 100644
--- a/steps/find_skymodel_cal.cwl
+++ b/steps/find_skymodel_cal.cwl
@@ -7,53 +7,90 @@ baseCommand:
   - python3
 inputs:
     - id: msin
-      type: Directory
+      type: 
+       - Directory
+       - Directory[]
       doc: MS containing the calibrator
       inputBinding:
         position: 0
     - id: skymodels
-      type: Directory
-      doc: Directory containing the sky models
+      type:
+        - Directory?
+        - File?
+      doc: Directory or file containing the sky models
     - id: skymodels_extension
       type: string?
       doc: path extension of the sky models
+    - id: max_separation_arcmin
+      type: float?
+      doc: max separation in arc minutes
 
 label: find_skymodel_cal.py
 arguments:
-  - '-c'
-  - |
-    import sys
-
-    from unittest.mock import MagicMock
-    sys.modules['lofarpipe.support.data_map'] = MagicMock()
-
-
-    from find_skymodel_cal import main as find_skymodel
-    import json
-    mss = sys.argv[1:]
-    skymodels = "$(inputs.skymodels.path)"
-
-    extension = "$(inputs.skymodels_extension)"
-    output = {}
-    if extension != 'null':
-        output = find_skymodel(mss, skymodels, extension)
-    else:
-        output = find_skymodel(mss, skymodels )
-
-    cwl_output = {'class': 'File', 'path': output['SkymodelCal']}
-    with open('./out.json', 'w') as fp:
-        json.dump(cwl_output, fp)
+  - find_sky.py
 outputs:
   - id: output_models
     type: File
     outputBinding:
         loadContents: true
         glob: 'out.json'
-        outputEval: $(JSON.parse(self[0].contents))
+        outputEval: $(JSON.parse(self[0].contents).file)
 
+  - id: model_name
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).skymodel_name)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: find_skymodel_cal.log    
+        
 requirements:
   - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entryname: 'find_sky.py'
+        entry: |
+            import sys
+            import os
+            import shutil
+            null = None
+            
+            from unittest.mock import MagicMock
+            sys.modules['lofarpipe.support.data_map'] = MagicMock()
+            
+            
+            from find_skymodel_cal import main as find_skymodel
+            import json
+            mss = sys.argv[1:]
+            
+            skymodels = $(inputs.skymodels)
+            max_separation_arcmin = $(inputs.max_separation_arcmin)
+            max_separation_arcmin = 1.0 if max_separation_arcmin else max_separation_arcmin
+            extension = "$(inputs.skymodels_extension)"
+            if skymodels is None:
+                skymodels = "/data/skymodels"
+            else:
+                skymodels = skymodels["path"]
+            output = {}
+            if extension != 'null':
+                output = find_skymodel(mss, skymodels, extension, max_separation_arcmin=max_separation_arcmin)
+            else:
+                output = find_skymodel(mss, skymodels, max_separation_arcmin=max_separation_arcmin)
+            
+            skymodel_path = output['SkymodelCal']
+            skymodel_name = output['SkymodelName']
+            skymodel_path = shutil.copy(skymodel_path, os.getcwd())
+            cwl_output = {"file":{'class': 'File', 'path': skymodel_path},
+                          "skymodel_name": skymodel_name}
+            
+            with open('./out.json', 'w') as fp:
+                json.dump(cwl_output, fp)
+
 
 hints:
   DockerRequirement:
-    dockerPull: lofareosc/prefactor-ci:master
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: find_skymodel_cal.log
diff --git a/steps/find_skymodel_target.cwl b/steps/find_skymodel_target.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..36191f1c6d89c1fa6240eb81698c211f4c8f481b
--- /dev/null
+++ b/steps/find_skymodel_target.cwl
@@ -0,0 +1,74 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: find_skymodel_target_py
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory[]
+      doc: MS containing the target
+      inputBinding:
+        position: 0
+    - id: SkymodelPath
+      type: File?
+      doc: File containing or putting the skymodel
+    - id: Radius
+      type: float?
+      doc: Radius of the skymodel
+      default: 5.0
+    - id: Source
+      type: string?
+      doc: Source of the skymodel
+      default: 'TGSS'
+    - id: DoDownload
+      type: boolean?
+      doc: Download a new skymodel if given path is empty
+      default: true
+
+label: find_skymodel_target.py
+arguments:
+  - '-c'
+  - |
+    import sys
+    import shutil
+    import os
+    null = None
+
+    from download_skymodel_target import main as download_skymodel_target
+
+    mss = sys.argv[1:]
+
+    SkymodelPath = $(inputs.SkymodelPath)
+    if SkymodelPath is None:
+        SkymodelPath = os.getcwd() + "/target.skymodel"
+    else:
+        SkymodelPath = SkymodelPath["path"]
+
+    Radius = $(inputs.Radius)
+    Source = "$(inputs.Source)"
+    DoDownload = "$(inputs.DoDownload)"
+    
+    output = download_skymodel_target(mss, SkymodelPath, Radius, DoDownload, Source)
+    
+    if "target.skymodel" not in SkymodelPath:
+       shutil.copyfile(SkymodelPath, "target.skymodel")
+   
+outputs:
+  - id: skymodel
+    type: File?
+    outputBinding:
+      glob: target.skymodel
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: find_skymodel_target.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+
+hints:
+  DockerRequirement:
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: find_skymodel_target.log
\ No newline at end of file
diff --git a/steps/get_targetname.cwl b/steps/get_targetname.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..9c999be81045fae929190a57bcb4ce20ebb009ae
--- /dev/null
+++ b/steps/get_targetname.cwl
@@ -0,0 +1,55 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: get_targetname
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory[]
+      doc: MS to compare with
+      inputBinding:
+        position: 0
+
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    from getTargetName import main as getTargetName
+    
+    mss = sys.argv[1:]
+
+    output = getTargetName(mss)
+
+    targetName = output['targetName']
+    cwl_output = {"targetName": targetName}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: targetname
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).targetName)
+  - id: logfile
+    type: File[]
+    outputBinding:
+      glob: 'get_targetname*.log'
+        
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: get_targetname.log
+stderr: get_targetname_err.log
diff --git a/steps/h5parm_pointingname.cwl b/steps/h5parm_pointingname.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..30ecb0cf1940c57d0b9fae3167980bf646a68f96
--- /dev/null
+++ b/steps/h5parm_pointingname.cwl
@@ -0,0 +1,55 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: h5parm_pointingname
+baseCommand:
+  - python3
+  - /usr/local/bin/h5parm_pointingname.py
+inputs:
+  - format: 'lofar:#H5Parm'
+    id: h5parmFile
+    type: File
+    inputBinding:
+      position: 0
+    doc: List of h5parm files
+  - default: 'target'
+    id: solsetName
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--solsetName'
+    doc: Input solset name
+  - default: 'POINTING'
+    id: pointing
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--pointing'
+    doc: Name of the pointing
+outputs:
+  - id: outh5parm
+    doc: Output h5parm
+    type: File
+    outputBinding:
+      glob: $(inputs.h5parmFile.basename)
+    format: lofar:#H5Parm
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: 'h5parm_pointingname*.log'
+label: h5parm_pointingname
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.h5parmFile)
+        writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: h5parm_pointingname.log
+stderr: h5parm_pointingname_err.log
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/steps/h5parmcat.cwl b/steps/h5parmcat.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..2770fc827f22878db2d626da6f0ff81fa6189535
--- /dev/null
+++ b/steps/h5parmcat.cwl
@@ -0,0 +1,96 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: h5parm_cat
+baseCommand:
+  - H5parm_collector.py
+inputs:
+  - format: 'lofar:#H5Parm'
+    id: h5parmFile
+    type: File
+    inputBinding:
+      position: 0
+    doc: List of h5parm files
+  - default: sol000
+    id: insolset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--insolset'
+    doc: Input solset name
+  - default: sol000
+    id: outsolset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--outsolset'
+    doc: Output solset name
+  - id: insoltab
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--insoltab'
+    doc: Output solset name
+  - default: output.h5
+    id: input_file
+    type: File
+    doc: Output h5parm name
+  - default: false
+    id: squeeze
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: '-q'
+    doc: removes all axes with the length of 1
+  - default: true
+    id: verbose
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: '-v'
+    doc: verbose output
+  - default: false
+    id: clobber
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: '-c'
+    doc: overwrite output
+  - default: false
+    id: history
+    type: boolean
+    inputBinding:
+      position: 0
+      prefix: '-H'
+    doc: Keep history of the export soltabs
+outputs:
+  - id: outh5parm
+    doc: Output h5parm
+    type: File
+    outputBinding:
+      glob: $(inputs.input_file.basename)
+    format: lofar:#H5Parm
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: 'h5parm_collector_output*.log'
+label: h5parm_cat
+arguments:
+  - position: 0
+    prefix: '-o'
+    valueFrom: $(inputs.input_file.basename)
+requirements:
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.input_file)
+        writable: true
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: h5parm_collector_output.log
+stderr: h5parm_collector_output_err.log
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/steps/identify_bad_antennas.cwl b/steps/identify_bad_antennas.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..0fa09ff11bd4a10d481a196c4fd3441d37ca8b6e
--- /dev/null
+++ b/steps/identify_bad_antennas.cwl
@@ -0,0 +1,55 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: identify_bad_antennas
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory
+      doc: MS to compare with
+      inputBinding:
+        position: 0
+
+label: identifyBadAntennas.py
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    from identifyBadAntennas_CWL import main as identifyBadAntennas
+    
+    ms = sys.argv[1]
+
+    output = identifyBadAntennas(ms)
+
+    flaggedants = output['flaggedants']
+    cwl_output  = {"flaggedants": flaggedants}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: flaggedants
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).flaggedants)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: identifyBadAntennas.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.msin)
+        writable: true
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: identifyBadAntennas.log
+stderr: identifyBadAntennas_err.log
\ No newline at end of file
diff --git a/steps/identify_bad_antennas_join.cwl b/steps/identify_bad_antennas_join.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..03a3c2e5b9b6548c9325bbd9eaf18fcd96b5c514
--- /dev/null
+++ b/steps/identify_bad_antennas_join.cwl
@@ -0,0 +1,57 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: identify_bad_antennas_join
+baseCommand:
+  - python3
+inputs:
+    - id: flaggedants
+      type: string[]?
+      default: []
+      doc: list of flagged antennas
+    - id: filter
+      type: string?
+      default: '*&'
+      doc: Filter these baselines for the comparison
+      
+label: identifyBadAntennas_join
+arguments:
+  - '-c'
+  - |
+  
+    import sys
+    import json
+    
+    flaggedants = $(inputs.flaggedants)
+    filter = '$(inputs.filter)'
+
+    
+    flaggedants_list = [ flaggedant.split(',') for flaggedant in flaggedants ]
+    flagged_antenna_list = set.intersection(*map(set, flaggedants_list)) 
+
+    for flagged_antenna in flagged_antenna_list:
+        filter += ';!' + flagged_antenna + '*&&*'
+
+    cwl_output  = {"filter": filter}
+
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: filter_out
+    type: string
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).filter)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: identifyBadAntennas.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+
+stdout: identifyBadAntennas.log
+stderr: identifyBadAntennas_err.log
\ No newline at end of file
diff --git a/steps/merge_array.cwl b/steps/merge_array.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..7d8fef0a75749789ad62c9fdd4840fc9ce17a986
--- /dev/null
+++ b/steps/merge_array.cwl
@@ -0,0 +1,31 @@
+id: merge_array
+label: merge_array
+class: ExpressionTool
+
+cwlVersion: v1.0
+inputs: 
+    - id: input
+      type:
+        - type: array
+          items:
+            - type: array
+              items: Directory
+outputs: 
+    - id: output
+      type: Directory[]
+
+expression: |
+  ${
+    var out_dir = []
+    for(var i=0; i<inputs.input.length; i++){
+        var item = inputs.input[i]
+        if(item != null){
+            out_dir = out_dir.concat(item)
+        }
+    }
+    return {'output': out_dir}
+  }
+
+
+requirements:
+  - class: InlineJavascriptRequirement
\ No newline at end of file
diff --git a/steps/merge_array_files.cwl b/steps/merge_array_files.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..c4c5c6122e03f690e2bcf14307ec052f4d846f86
--- /dev/null
+++ b/steps/merge_array_files.cwl
@@ -0,0 +1,31 @@
+id: merge_array_files
+label: merge_array_files
+class: ExpressionTool
+
+cwlVersion: v1.0
+inputs: 
+    - id: input
+      type:
+        - type: array
+          items:
+            - type: array
+              items: File
+outputs: 
+    - id: output
+      type: File[]
+
+expression: |
+  ${
+    var out_file = []
+    for(var i=0; i<inputs.input.length; i++){
+        var item = inputs.input[i]
+        if(item != null){
+            out_file = out_file.concat(item)
+        }
+    }
+    return {'output': out_file}
+  }
+
+
+requirements:
+  - class: InlineJavascriptRequirement
\ No newline at end of file
diff --git a/steps/plot_Ateamclipper.cwl b/steps/plot_Ateamclipper.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..6d5f88253ec404b3418b2e5934ce7b3240d8be7b
--- /dev/null
+++ b/steps/plot_Ateamclipper.cwl
@@ -0,0 +1,28 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: plot_Ateamclipper
+baseCommand:
+  - python3
+  - /usr/local/bin/plot_Ateamclipper.py
+inputs:
+  - id: clipper_output
+    type: File
+    inputBinding:
+      position: 1
+  - id: outputimage
+    type: string?
+    default: Ateamclipper.png
+    inputBinding:
+      position: 2
+outputs:
+  - id: output_imag
+    doc: Output image
+    type: File
+    outputBinding:
+      glob: $(inputs.outputimage)
+label: plot_Ateamclipper
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
diff --git a/steps/plot_unflagged.cwl b/steps/plot_unflagged.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..290636c556f95452422d22151eee4620996094dc
--- /dev/null
+++ b/steps/plot_unflagged.cwl
@@ -0,0 +1,52 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: plot_unflagged
+baseCommand:
+  - python3
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    inputBinding:
+      position: 1
+  - id: unflagged_fraction
+    type: float[]
+    inputBinding:
+      position: 2
+      
+label: plot_unflagged
+arguments:
+  - '-c'
+  - |
+    import sys
+    import os
+
+    from plot_unflagged_fraction import main as plot_unflagged_fraction
+
+    center = int((len(sys.argv) - 1) / 2 + 1)
+    
+    mss = sys.argv[1:center]
+    unflagged_fraction = sys.argv[center:]
+    
+    output = plot_unflagged_fraction(ms_list = mss, frac_list = unflagged_fraction, outfile = os.getcwd() + '/unflagged_fraction.png')
+
+outputs:
+  - id: output_imag
+    doc: Output image
+    type: File
+    outputBinding:
+      glob: 'unflagged_fraction.png'
+  - id: logfile
+    type: File[]?
+    outputBinding:
+      glob: 'plot_unflagged_fraction*.log'
+
+    
+hints:
+  - class: DockerRequirement
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
+requirements:
+  - class: InlineJavascriptRequirement
+stdout: plot_unflagged_fraction.log
+stderr: plot_unflagged_fraction_err.log
\ No newline at end of file
diff --git a/steps/read_surl_list.cwl b/steps/read_surl_list.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..b1527d08845a46d2bc037dc98084d4fb8b7a85b3
--- /dev/null
+++ b/steps/read_surl_list.cwl
@@ -0,0 +1,23 @@
+class: ExpressionTool
+cwlVersion: v1.0
+id: read_surl_file
+inputs:
+  - id: surl_list
+    type: File
+    doc: input surl file
+    inputBinding:
+      loadContents: True
+outputs:
+  - id: surls
+    type: string[]
+
+expression: |
+  ${
+    var surl_list = inputs.surl_list.contents.split("\n");
+    surl_list = surl_list.filter(function (el) { return el != ''; } );
+    return {'surls': surl_list}
+  }
+label: ReadSurlList
+
+requirements:
+  - class: InlineJavascriptRequirement
diff --git a/steps/selectfirstdirectory.cwl b/steps/selectfirstdirectory.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..c4ecb01874588d841d2080a853e0ee6f8d716619
--- /dev/null
+++ b/steps/selectfirstdirectory.cwl
@@ -0,0 +1,25 @@
+id: selectfirstdirectory
+label: selectfirstdirectory
+class: ExpressionTool
+
+cwlVersion: v1.0
+inputs: 
+    - id: input
+      type: Directory[]
+outputs: 
+    - id: output
+      type: Directory
+
+requirements:
+
+    - class: InlineJavascriptRequirement
+    - class: InitialWorkDirRequirement
+      listing:
+        - $(inputs.input)
+      
+
+expression: |
+  ${
+    return {'output': inputs.input[0]}
+  }
+
diff --git a/steps/selectfirstfile.cwl b/steps/selectfirstfile.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..b928a3ffdc95e6ded6dfa0bd9f11db36500900bd
--- /dev/null
+++ b/steps/selectfirstfile.cwl
@@ -0,0 +1,19 @@
+class: ExpressionTool
+cwlVersion: v1.0
+id: select_first_file
+inputs:
+  - id: inputs
+    type: File[]
+    doc: input files
+outputs:
+  - id: output
+    type: File
+
+expression: |
+  ${
+    return {'output': inputs.inputs[0]}
+  }
+label: FileSelector
+
+requirements:
+  - class: InlineJavascriptRequirement
diff --git a/steps/separate_results_directory.cwl b/steps/separate_results_directory.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..a5e1389e9b7498126e78973a4f8637e41eecf55b
--- /dev/null
+++ b/steps/separate_results_directory.cwl
@@ -0,0 +1,31 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: separate_results_directory
+baseCommand:
+  - echo "exploding directory"
+inputs:
+  - id: input
+    type: Directory
+    inputBinding:
+      shellQuote: false
+      position: 0
+outputs:
+  - id: quality_plots
+    type: 'File[]'
+    outputBinding:
+      glob: $(inputs.input)/inspections/*
+  - id: calibrated_ms
+    type: 'Directory[]'
+    outputBinding:
+      glob: $(inputs.input)/out_*
+  - id: calibrator_solutions
+    type: File
+    outputBinding:
+      glob: |
+        $(inputs.input)/cal_values/*
+label: separate_results_directory
+requirements:
+  - class: ShellCommandRequirement
+  - class: InlineJavascriptRequirement
diff --git a/steps/sort_times_into_freqGroups.cwl b/steps/sort_times_into_freqGroups.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..c2dffe021efe70adbb703250dba0c80a6130e48f
--- /dev/null
+++ b/steps/sort_times_into_freqGroups.cwl
@@ -0,0 +1,94 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: sort_times_into_freqGroups
+baseCommand:
+  - python3
+inputs:
+    - id: msin
+      type: Directory[]
+      doc: MS to sort
+      inputBinding:
+        position: 0
+    - id: numbands
+      type: int?
+      default: 10
+      doc: Number of how many files should be grouped together in frequency.
+    - id: NDPPPfill
+      type: boolean?
+      default: True
+      doc: Add dummy file-names for missing frequencies, so that NDPPP can fill the data with flagged dummy data.
+    - id: stepname
+      type: string?
+      default: '.ms'
+      doc: Add this step-name into the file-names of the output files.
+    - id: firstSB
+      type: int?
+      default: null
+      doc: If set, then reference the grouping of files to this station-subband. As if a file with this station-subband would be included in the input files.
+    - id: mergeLastGroup
+      type: boolean?
+      default: False
+      doc: Add dummy file-names for missing frequencies, so that NDPPP can fill the data with flagged dummy data.
+    - id: truncateLastSBs
+      type: boolean?
+      default: True
+      doc: Add dummy file-names for missing frequencies, so that NDPPP can fill the data with flagged dummy data.
+
+label: sort_times_into_freqGroups.py
+arguments:
+  - '-c'
+  - |
+    import sys
+    import json
+    from sort_times_into_freqGroups_CWL import main as sort_times_into_freqGroups
+    null = None
+    false = False
+    true = True
+    
+    mss = sys.argv[1:]
+    numbands = int($(inputs.numbands))
+    stepname = "$(inputs.stepname)"
+    NDPPPfill = $(inputs.NDPPPfill)
+    mergeLastGroup = $(inputs.mergeLastGroup)
+    truncateLastSBs = $(inputs.truncateLastSBs)
+    firstSB = $(inputs.firstSB)
+
+    output = sort_times_into_freqGroups(mss, numbands, NDPPPfill, stepname, mergeLastGroup, truncateLastSBs, firstSB)
+
+    filenames  = output['filenames']
+    groupnames = output['groupnames']
+    
+    cwl_output = {}
+    cwl_output['groupnames'] = groupnames
+
+    with open('./filenames.json', 'w') as fp:
+        json.dump(filenames, fp)
+        
+    with open('./out.json', 'w') as fp:
+        json.dump(cwl_output, fp)
+        
+outputs:
+  - id: filenames
+    type: File
+    outputBinding:
+        glob: 'filenames.json'
+  - id: groupnames
+    type: string[]
+    outputBinding:
+        loadContents: true
+        glob: 'out.json'
+        outputEval: $(JSON.parse(self[0].contents).groupnames)
+  - id: logfile
+    type: File?
+    outputBinding:
+      glob: sort_times_into_freqGroups.log    
+        
+requirements:
+  - class: InlineJavascriptRequirement
+
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: sort_times_into_freqGroups.log
\ No newline at end of file
diff --git a/steps/stage.cwl b/steps/stage.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..0cc4266af5f67fb477e425d90e9055525473b2e4
--- /dev/null
+++ b/steps/stage.cwl
@@ -0,0 +1,21 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: stage
+baseCommand:
+  - gfal-legacy-bringonline
+inputs:
+  - id: input
+    type: string
+    inputBinding:
+      shellQuote: false
+      position: 0
+outputs:
+  - id: output
+    type: string
+    outputBinding:
+      outputEval: $(inputs.input)
+label: stage
+requirements:
+  - class: InlineJavascriptRequirement
diff --git a/steps/structure_function.cwl b/steps/structure_function.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..434d75f0513a3a4b421f9624bb0c4078382728e3
--- /dev/null
+++ b/steps/structure_function.cwl
@@ -0,0 +1,62 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
+  sbg: 'https://www.sevenbridges.com/'
+id: structure_function
+baseCommand:
+  - python3
+  - /usr/local/bin/getStructure_from_phases.py
+inputs:
+  - format: 'lofar:#H5Parm'
+    id: h5parmFile
+    type: File
+    inputBinding:
+      position: 0
+    doc: List of h5parm files
+  - default: 'target'
+    id: solset
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--solset'
+    doc: Input solset name
+  - default: 'phase000'
+    id: soltab
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--soltab'
+    doc: Name of the soltab
+  - default: 'POINTING'
+    id: outbasename
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--outbasename'
+    doc: Namebase of the output files
+outputs:
+  - id: structure_plot
+    doc: Output plot
+    type: File
+    outputBinding:
+      glob: $(inputs.outbasename+'_structure.png')
+  - id: structure_txt
+    doc: Output text
+    type: File
+    outputBinding:
+      glob: $(inputs.outbasename+'_structure.txt')
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: 'structure_function*.log'
+label: structure_function
+requirements:
+  - class: InlineJavascriptRequirement
+hints:
+  - class: DockerRequirement
+    dockerPull: lofareosc/prefactor:HBAcalibrator
+stdout: structure_function.log
+stderr: structure_function_err.log
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/steps/surl_copy.cwl b/steps/surl_copy.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..08bd4527548054a827a951a02f5948ce596598fa
--- /dev/null
+++ b/steps/surl_copy.cwl
@@ -0,0 +1,23 @@
+class: CommandLineTool
+cwlVersion: v1.0
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+id: surl_copy
+baseCommand:
+  - gfal-copy
+inputs:
+  - id: surl
+    type: string
+    inputBinding:
+      position: -1
+outputs:
+  - id: output
+    type: File
+    outputBinding:
+      glob: '*'
+doc: Download a file give a surl
+label: surl_copy
+arguments:
+  - .
+temporaryFailCodes:
+  - 70
diff --git a/steps/transfer_solutions.cwl b/steps/transfer_solutions.cwl
index 9f0ac4510bb0da8908f037d6085a8aecfa19b409..e92ba2e468cc0cd4d35da32b24009cc0a0428122 100644
--- a/steps/transfer_solutions.cwl
+++ b/steps/transfer_solutions.cwl
@@ -4,16 +4,20 @@ $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 id: transfer_solutions
 baseCommand:
-  - transfer_solutions.py
+  - python3
+  - /usr/local/bin/transfer_solutions.py
 inputs:
-  - 'sbg:toolDefaultValue': output.h5
-    id: h5parm_name
-    type: string?
+  - default: output.h5
+    id: h5parm
+    type: File
     inputBinding:
       position: 1
     doc: H5parm to which the solutions should be transferred.
   - id: refh5parm
-    type: File
+    type:
+      - File?
+      - string?
+    default: '/data/solutions/3C48.h5'
     inputBinding:
       position: 0
       prefix: '--refh5parm'
@@ -48,14 +52,53 @@ inputs:
       position: 0
       prefix: '--antenna'
     doc: Regular expression of antenna solutions to be transferred
-outputs:
-  - id: output
+  - id: do_transfer
+    type: boolean?
+    inputBinding:
+      position: 0
+      prefix: '--do_transfer True'
+    doc: Enable/disable the task
+  - id: trusted
+    type: string?
+    inputBinding:
+      position: 0
+      prefix: '--trusted'
+    doc: Comma-separated list of sources to be trusted
+  - id: max_separation_arcmin
+    type: float?
+    inputBinding:
+      position: 0
+      prefix: '--max_separation_arcmin'
+    doc: define the maximum seperation between pointing and model direction in arcmin
+  - id: parset
     type: File?
+    inputBinding:
+      position: 0
+      prefix: '--parset'
+    doc: Parset for plotting diagnostic plots after transfer with LoSoTo
+outputs:
+  - id: outh5parm
+    type: File
+    outputBinding:
+      glob: $(inputs.h5parm.basename)
+  - id: log
+    type: File[]
+    outputBinding:
+      glob: 'transfer_solutions*.log'
+  - id: plots
+    type: File[]
     outputBinding:
-      glob: $(inputs.h5parm_name)
+      glob: "*.png"
+
+stdout: transfer_solutions.log
+stderr: transfer_solutions_err.log
 label: transfer_solutions
 hints:
   - class: DockerRequirement
-    dockerPull: 'lofareosc/prefactor:latest'
+    dockerPull: 'lofareosc/prefactor:HBAcalibrator'
 requirements:
   - class: InlineJavascriptRequirement
+  - class: InitialWorkDirRequirement
+    listing:
+      - entry: $(inputs.h5parm)
+        writable: true
diff --git a/steps/untar.cwl b/steps/untar.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..55d02a9d7e4d3b154312c21c7ef6980d6410ccb8
--- /dev/null
+++ b/steps/untar.cwl
@@ -0,0 +1,30 @@
+id: untar
+label: untar
+class: CommandLineTool
+cwlVersion: v1.0
+inputs: 
+  - id: tar_file
+    type: File
+    inputBinding:
+      position: 0
+    
+outputs: 
+  - id: uncompressed
+    type: Directory
+    outputBinding:
+      glob: 'out/*'
+baseCommand: 
+ - 'bash'
+ - 'untar.sh'
+doc: 'Untar a compressed file'
+requirements:
+  InitialWorkDirRequirement:
+    listing:
+      - entryname: 'untar.sh' 
+        entry: |
+          #!/bin/bash
+          mkdir out
+          cd out
+          tar -xvf $1
+
+    
diff --git a/subworkflow/apply_calibrate_bp.cwl b/subworkflow/apply_calibrate_bp.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..5aca7b54f7212a8ba60306f9ed9514ed6e167016
--- /dev/null
+++ b/subworkflow/apply_calibrate_bp.cwl
@@ -0,0 +1,279 @@
+class: Workflow
+cwlVersion: v1.0
+id: apply_calibrate
+label: apply_calibrate
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: Directory
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: flagunconverged
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: input_h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 300
+outputs:
+  - id: apply_fr.log
+    outputSource:
+      - concat_logfiles_applyFR/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -300
+  - id: msout
+    outputSource:
+      - calib_cal/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: apply_cal.log
+    outputSource:
+      - concat_logfiles_applyBP/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: calib_cal.log
+    outputSource:
+      - concat_logfiles_calib_cal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: outh5parm
+    outputSource:
+      - calib_cal/h5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: apply_pa.log
+    outputSource:
+      - concat_logfiles_applyPA/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 300
+  - id: applybeam.log
+    outputSource:
+      - concat_logfiles_applybeam/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 400
+steps:
+  - id: applyPA
+    in:
+      - id: msin
+        source: msin
+      - id: msin_datacolumn
+        default: DATA
+      - id: parmdb
+        source: input_h5parm
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: correction
+        default: polalign
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applycal.cwl
+    label: applyPA
+    'sbg:x': -400
+    'sbg:y': 0
+  - id: applyBP
+    in:
+      - id: msin
+        source: applyPA/msout
+      - id: msin_datacolumn
+        default: CORRECTED_DATA
+      - id: parmdb
+        source: input_h5parm
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: correction
+        default: bandpass
+      - id: updateweights
+        default: 'True'
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applycal.cwl
+    label: applyBP
+    'sbg:x': -200
+    'sbg:y': 0
+  - id: applybeam
+    in:
+      - id: msin
+        source: applyBP/msout
+      - id: msin_datacolumn
+        default: CORRECTED_DATA
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: type
+        default: applybeam
+      - id: updateweights
+        default: 'true'
+      - id: usechannelfreq
+        default: 'false'
+      - id: invert
+        default: 'true'
+      - id: beammode
+        default: element
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applybeam.cwl
+    label: applybeam
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: applyFR
+    in:
+      - id: msin
+        source: applybeam/msout
+      - id: msin_datacolumn
+        default: CORRECTED_DATA
+      - id: parmdb
+        source: input_h5parm
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: correction
+        default: faraday
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applycal.cwl
+    label: applyFR
+    'sbg:x': 200
+    'sbg:y': 0
+  - id: BLsmooth
+    in:
+      - id: msin
+        source: applyFR/msout
+      - id: do_smooth
+        source: do_smooth
+      - id: in_column_name
+        default: CORRECTED_DATA
+    out:
+      - id: msout
+      - id: logfile
+    run: ../steps/blsmooth.cwl
+    label: BLsmooth
+    'sbg:x': 400
+    'sbg:y': 0
+  - id: calib_cal
+    in:
+      - id: msin
+        source: BLsmooth/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msin_modelcolum
+        default: MODEL_DATA
+      - id: propagate_solutions
+        source: propagatesolutions
+      - id: flagunconverged
+        source: flagunconverged
+      - id: mode
+        default: diagonal
+    out:
+      - id: msout
+      - id: h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/ddecal.cwl
+    'sbg:x': 600
+    'sbg:y': 0
+  - id: concat_logfiles_calib_cal
+    in:
+      - id: file_list
+        source:
+          - calib_cal/logfile
+      - id: file_prefix
+        default: calib_cal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_calib_cal
+    'sbg:x': 700
+    'sbg:y': 200
+  - id: concat_logfiles_applyFR
+    in:
+      - id: file_list
+        source:
+          - applyFR/logfile
+      - id: file_prefix
+        default: applycal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applyFR
+    'sbg:x': 400
+    'sbg:y': 200
+  - id: concat_logfiles_applybeam
+    in:
+      - id: file_list
+        source:
+          - applybeam/logfile
+      - id: file_prefix
+        default: applybeam
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applybeam
+    'sbg:x': 200
+    'sbg:y': 200
+  - id: concat_logfiles_applyBP
+    in:
+      - id: file_list
+        source:
+          - applyBP/logfile
+      - id: file_prefix
+        default: applycal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applyBP
+    'sbg:x': 0
+    'sbg:y': 200
+  - id: concat_logfiles_applyPA
+    in:
+      - id: file_list
+        source:
+          - applyPA/logfile
+      - id: file_prefix
+        default: applycal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applyPA
+    'sbg:x': -200
+    'sbg:y': 200
+requirements: []
diff --git a/subworkflow/apply_calibrate_fr.cwl b/subworkflow/apply_calibrate_fr.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..3c20638a5f7dfa43e0c60c18ab97eb6a1f193898
--- /dev/null
+++ b/subworkflow/apply_calibrate_fr.cwl
@@ -0,0 +1,145 @@
+class: Workflow
+cwlVersion: v1.0
+id: apply_calibrate
+label: apply_calibrate
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: Directory
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: flagunconverged
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: input_h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 300
+outputs:
+  - id: msout
+    outputSource:
+      - calib_cal/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: apply_cal.log
+    outputSource:
+      - concat_logfiles_applycal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: calib_cal.log
+    outputSource:
+      - concat_logfiles_calib_cal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: outh5parm
+    outputSource:
+      - calib_cal/h5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 200
+steps:
+  - id: applyFR
+    in:
+      - id: msin
+        source: msin
+      - id: msin_datacolumn
+        default: CORRECTED_DATA
+      - id: parmdb
+        source: input_h5parm
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: correction
+        default: faraday
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applycal.cwl
+    label: applyFR
+    'sbg:x': -400
+    'sbg:y': 0
+  - id: BLsmooth
+    in:
+      - id: msin
+        source: applyFR/msout
+      - id: do_smooth
+        source: do_smooth
+      - id: in_column_name
+        default: CORRECTED_DATA
+    out:
+      - id: msout
+      - id: logfile
+    run: ../steps/blsmooth.cwl
+    label: BLsmooth
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: calib_cal
+    in:
+      - id: msin
+        source: BLsmooth/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msin_modelcolum
+        default: MODEL_DATA
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagate_solutions
+        source: propagatesolutions
+      - id: mode
+        default: diagonal
+    out:
+      - id: msout
+      - id: h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/ddecal.cwl
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_calib_cal
+    in:
+      - id: file_list
+        source:
+          - calib_cal/logfile
+      - id: file_prefix
+        default: calib_cal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_calib_cal
+    'sbg:x': 700
+    'sbg:y': 200
+  - id: concat_logfiles_applycal
+    in:
+      - id: file_list
+        source:
+          - applyFR/logfile
+      - id: file_prefix
+        default: applycal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applycal
+    'sbg:x': -200
+    'sbg:y': 200
+requirements: []
diff --git a/subworkflow/apply_calibrate_pa.cwl b/subworkflow/apply_calibrate_pa.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..c8f1ea5cf33df4b2e381e0357129676db82147db
--- /dev/null
+++ b/subworkflow/apply_calibrate_pa.cwl
@@ -0,0 +1,193 @@
+class: Workflow
+cwlVersion: v1.0
+id: apply_calibrate
+label: apply_calibrate
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: Directory
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: flagunconverged
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: input_h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 300
+outputs:
+  - id: msout
+    outputSource:
+      - calib_cal/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: apply_cal.log
+    outputSource:
+      - concat_logfiles_applycal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: calib_cal.log
+    outputSource:
+      - concat_logfiles_calib_cal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: outh5parm
+    outputSource:
+      - calib_cal/h5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: applybeam.log
+    outputSource:
+      - concat_logfiles_applybeam/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 300
+steps:
+  - id: applyPA
+    in:
+      - id: msin
+        source: msin
+      - id: msin_datacolumn
+        default: DATA
+      - id: parmdb
+        source: input_h5parm
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: correction
+        default: polalign
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applycal.cwl
+    label: applyPA
+    'sbg:x': -400
+    'sbg:y': 0
+  - id: applybeam
+    in:
+      - id: msin_datacolumn
+        default: CORRECTED_DATA
+      - id: msout_datacolumn
+        default: CORRECTED_DATA
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: updateweights
+        default: 'true'
+      - id: invert
+        default: 'true'
+      - id: beammode
+        default: element
+      - id: usechannelfreq
+        default: 'false'
+      - id: msin
+        source: applyPA/msout
+      - id: type
+        default: applybeam
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/applybeam.cwl
+    label: applybeam
+    'sbg:x': -200
+    'sbg:y': 0
+  - id: BLsmooth
+    in:
+      - id: msin
+        source: applybeam/msout
+      - id: do_smooth
+        source: do_smooth
+      - id: in_column_name
+        default: CORRECTED_DATA
+    out:
+      - id: msout
+      - id: logfile
+    run: ../steps/blsmooth.cwl
+    label: BLsmooth
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: calib_cal
+    in:
+      - id: msin
+        source: BLsmooth/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msin_modelcolum
+        default: MODEL_DATA
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagate_solutions
+        source: propagatesolutions
+      - id: mode
+        default: rotation+diagonal
+    out:
+      - id: msout
+      - id: h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/ddecal.cwl
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_calib_cal
+    in:
+      - id: file_list
+        source:
+          - calib_cal/logfile
+      - id: file_prefix
+        default: calib_cal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_calib_cal
+    'sbg:x': 700
+    'sbg:y': 200
+  - id: concat_logfiles_applybeam
+    in:
+      - id: file_list
+        source:
+          - applybeam/logfile
+      - id: file_prefix
+        default: applybeam
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applybeam
+    'sbg:x': 0
+    'sbg:y': 200
+  - id: concat_logfiles_applycal
+    in:
+      - id: file_list
+        source:
+          - applyPA/logfile
+      - id: file_prefix
+        default: applycal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_applycal
+    'sbg:x': -200
+    'sbg:y': 200
+requirements: []
diff --git a/subworkflow/bandpass.cwl b/subworkflow/bandpass.cwl
index 0d73a6263d3ebe36efc8bd1af192dac894a87346..63f7dc6355cfdbe1cbf68ffe531c192b9eaf637b 100644
--- a/subworkflow/bandpass.cwl
+++ b/subworkflow/bandpass.cwl
@@ -1,134 +1,265 @@
 class: Workflow
 cwlVersion: v1.0
-id: bandpass
-label: bandpass
+id: losoto_bandpass
+label: losoto_bandpass
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 inputs:
+  - id: ampRange
+    type: 'float[]?'
+    'sbg:x': 397.4866943359375
+    'sbg:y': 73.48989868164062
   - id: skipInternational
-    type: string?
-    'sbg:x': 600.0303344726562
-    'sbg:y': -411.65814208984375
+    type: boolean?
+    'sbg:x': 401.4047546386719
+    'sbg:y': -185.20863342285156
+  - id: input_h5parm
+    type: File
+    'sbg:x': 395.389404296875
+    'sbg:y': -51.39104080200195
   - id: max2interpolate
     type: int?
-    'sbg:x': 472.91082763671875
-    'sbg:y': -275.4460144042969
+    'sbg:x': 398.02581787109375
+    'sbg:y': -311.48223876953125
   - id: bandpass_freqresolution
     type: string
-    'sbg:x': 479.5017395019531
-    'sbg:y': 199.0994415283203
+    'sbg:x': 404.9237365722656
+    'sbg:y': -440.521484375
   - id: avg_freqresolution
     type: string?
-    'sbg:x': 527.5851440429688
-    'sbg:y': 368.7982482910156
-  - id: ampRange
-    type: 'float[]?'
-    'sbg:x': 721.8663330078125
-    'sbg:y': 423.6078186035156
-  - id: outh5parmname
-    type: string?
-    'sbg:x': 805.8613891601562
-    'sbg:y': -296.09796142578125
-  - id: antenna_to_transfer
-    type: string?
-    'sbg:x': 985.4193725585938
-    'sbg:y': 183.84898376464844
+    'sbg:x': 401.60693359375
+    'sbg:y': 198.58273315429688
 outputs:
-  - id: output
+  - id: output_h5parm
+    outputSource:
+      - smoothb/output_h5parm
+    type: File
+    'sbg:x': 2315
+    'sbg:y': -50
+  - id: logfiles
     outputSource:
-      - transfer_solutions/output
-    type: File?
-    'sbg:x': 1310.1014404296875
-    'sbg:y': -65.6321029663086
+      - duplicateAbkp/log
+      - losoto_flag/log
+      - flagbp/log
+      - flagextend/log
+      - merge/log
+      - duplicateAbkp2/log
+      - smooth/logfile
+      - bandpass/logfile
+      - interp/logfile
+      - smoothb/logfile
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 2315.6181640625
+    'sbg:y': 352.22503662109375
 steps:
-  - id: h5imp_cal_bandpass
+  - id: duplicateAbkp
     in:
-      - id: insolset
-        default: bandpass
-      - id: squeeze
-        default: true
-      - id: verbose
-        default: true
-      - id: clobber
-        default: true
+      - id: input_h5parm
+        source: input_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: soltabOut
+        default: amplitudeOrig000
     out:
-      - id: outh5parm
+      - id: output_h5parm
       - id: log
-    run: ../lofar-cwl/steps/H5ParmCollector.cwl
-    label: h5imp_cal_bandpass
-    scatter:
-      - h5parmFiles
-    'sbg:x': 553.6541748046875
-    'sbg:y': -29.645381927490234
-  - id: h5exp_cal_bandpass
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': 600
+    'sbg:y': -50
+  - id: losoto_flag
     in:
-      - id: h5parmFiles
-        source:
-          - losoto_bandpass/output_h5parm
-      - id: insolset
-        default: bandpass
-      - id: outh5parmname
-        default: cal_solutions.h5
-        source: outh5parmname
-      - id: verbose
-        default: true
-      - id: clobber
-        default: true
+      - id: input_h5parm
+        source: duplicateAbkp/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToFlag
+        default:
+          - time
+          - freq
+      - id: order
+        default:
+          - 100
+          - 40
+      - id: maxCycles
+        default: 1
+      - id: maxRms
+        default: 5
+      - id: mode
+        default: smooth
+      - id: preflagzeros
+        default: false
+      - id: replace
+        default: false
     out:
-      - id: outh5parm
+      - id: output_h5parm
       - id: log
-    run: ../lofar-cwl/steps/H5ParmCollector.cwl
-    label: h5exp_cal_bandpass
-    'sbg:x': 943
-    'sbg:y': -45
-  - id: transfer_solutions
+    run: ../lofar-cwl/steps/LoSoTo.Flag.cwl
+    label: flag
+    'sbg:x': 750
+    'sbg:y': -50
+  - id: flagbp
     in:
-      - id: refh5parm
-        source: h5exp_cal_bandpass/outh5parm
-      - id: insolset
-        default: calibrator
-      - id: outsolset
-        default: calibrator
-      - id: insoltab
-        default: bandpass
-      - id: outsoltab
+      - id: input_h5parm
+        source: losoto_flag/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: mode
         default: bandpass
-      - id: antenna
-        source: antenna_to_transfer
-    out:
-      - id: output
-    run: ../steps/transfer_solutions.cwl
-    label: transfer_solutions
-    'sbg:x': 1132
-    'sbg:y': -62
-  - id: losoto_bandpass
-    in:
       - id: ampRange
-        default:
-          - 0
-          - 0
         source:
           - ampRange
       - id: skipInternational
-        default: 'True'
         source: skipInternational
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.FlagStation.cwl
+    'sbg:x': 900
+    'sbg:y': -50
+  - id: flagextend
+    in:
       - id: input_h5parm
-        source: h5imp_cal_bandpass/outh5parm
-      - id: max2interpolate
-        default: 30
-        source: max2interpolate
-      - id: bandpass_freqresolution
-        default: 195.3125kHz
+        source: flagbp/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToExt
+        default:
+          - time
+          - freq
+      - id: size
+        default:
+          - 200
+          - 80
+      - id: percent
+        default: 50
+      - id: maxCycles
+        default: 2
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Flagextend.cwl
+    'sbg:x': 1050
+    'sbg:y': -50
+  - id: merge
+    in:
+      - id: input_h5parm
+        source: flagextend/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: mode
+        default: copy
+      - id: soltabImport
+        default: amplitude000
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Reweight.cwl
+    'sbg:x': 1200
+    'sbg:y': -50
+  - id: duplicateAbkp2
+    in:
+      - id: input_h5parm
+        source: merge/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: soltabOut
+        default: amplitudeOrig001
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': 1350
+    'sbg:y': -50
+  - id: smooth
+    in:
+      - id: input_h5parm
+        source: duplicateAbkp2/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToSmooth
+        default:
+          - time
+      - id: mode
+        default: median
+      - id: log
+        default: true
+      - id: replace
+        default: false
+    out:
+      - id: output_h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/LoSoTo.Smooth.cwl
+    'sbg:x': 1500
+    'sbg:y': -50
+  - id: bandpass
+    in:
+      - id: input_h5parm
+        source: smooth/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToSmooth
+        default:
+          - freq
+      - id: size
+        default:
+          - 17
+      - id: mode
+        default: savitzky-golay
+      - id: degree
+        default: 2
+      - id: log
+        default: true
+    out:
+      - id: output_h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/LoSoTo.Smooth.cwl
+    'sbg:x': 1650
+    'sbg:y': -50
+  - id: interp
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axisToRegrid
+        default: freq
+      - id: outSoltab
+        default: bandpass
+      - id: newdelta
         source: bandpass_freqresolution
-      - id: avg_freqresolution
-        default: 48.82kHz
+      - id: delta
         source: avg_freqresolution
+      - id: maxFlaggedWidth
+        source: max2interpolate
+      - id: log
+        default: true
+    out:
+      - id: output_h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/LoSoTo.Interpolate.cwl
+    'sbg:x': 1800
+    'sbg:y': -50
+  - id: smoothb
+    in:
+      - id: input_h5parm
+        source: interp/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesToSmooth
+        default:
+          - time
+      - id: mode
+        default: median
+      - id: replace
+        default: true
+      - id: log
+        default: true
     out:
       - id: output_h5parm
-    run: ./losoto_bandpass.cwl
-    label: losoto_bandpass
-    'sbg:x': 747.5215454101562
-    'sbg:y': -46.37216567993164
-requirements:
-  - class: SubworkflowFeatureRequirement
-  - class: ScatterFeatureRequirement
+      - id: logfile
+    run: ../lofar-cwl/steps/LoSoTo.Smooth.cwl
+    label: smoothb
+    'sbg:x': 1950
+    'sbg:y': -50
+requirements: []
diff --git a/subworkflow/calib_cal.cwl b/subworkflow/calib_cal.cwl
index 1857e5bc044f162234b0bf3e12c0b744002c577a..1fceb82d5f227d8243c7b89d8d4d05a291cea5da 100644
--- a/subworkflow/calib_cal.cwl
+++ b/subworkflow/calib_cal.cwl
@@ -1,45 +1,37 @@
 class: Workflow
 cwlVersion: v1.0
-id: calib_cal
-label: calib_cal
+id: calibrate_calibrator
+label: calibrate_calibrator
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 inputs:
   - id: msin
     type: Directory
-    'sbg:x': -752
-    'sbg:y': -23
-  - id: skymodels
-    type: Directory
-    'sbg:x': -626
-    'sbg:y': -302
-  - id: flagunconverged
-    type: boolean
-    'sbg:x': 41
-    'sbg:y': 100
-  - id: propagate_solutions
-    type: boolean
-    'sbg:x': 77.1015625
-    'sbg:y': -259
+    'sbg:x': -1000
+    'sbg:y': -100
   - id: do_smooth
     type: boolean
-    'sbg:x': -604
-    'sbg:y': 123
-outputs:
-  - id: h5parm
-    outputSource:
-      - calib_rot_diag/h5parm
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: sourcedb
     type: File
-    'sbg:x': 429
-    'sbg:y': -52
+    'sbg:x': -1000
+    'sbg:y': 100
+outputs:
   - id: msout
     outputSource:
-      - calib_rot_diag/msout
+      - predict/msout
     type: Directory
-    'sbg:x': 404
-    'sbg:y': -227
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100    
 steps:
-  - id: blsmooth
+  - id: BLsmooth
     in:
       - id: msin
         source: msin
@@ -47,58 +39,23 @@ steps:
         source: do_smooth
     out:
       - id: msout
+      - id: logfile
     run: ../steps/blsmooth.cwl
     label: BLsmooth
-    'sbg:x': -420
-    'sbg:y': -26
+    'sbg:x': -500
+    'sbg:y': 0
   - id: predict
     in:
       - id: msin
-        source: blsmooth/msout
+        source: BLsmooth/msout
+      - id: msout_datacolumn
+        default: MODEL_DATA
       - id: sources_db
-        source: make_sourcedb/sourcedb
+        source: sourcedb
     out:
       - id: msout
     run: ../lofar-cwl/steps/predict.cwl
-    'sbg:x': -1
-    'sbg:y': -71
-  - id: find_skymodel_cal_py
-    in:
-      - id: msin
-        source: msin
-      - id: skymodels
-        source: skymodels
-    out:
-      - id: output_models
-    run: ../steps/find_skymodel_cal.cwl
-    label: find_skymodel_cal.py
-    'sbg:x': -416
-    'sbg:y': -209
-  - id: make_sourcedb
-    in:
-      - id: sky_model
-        source: find_skymodel_cal_py/output_models
-    out:
-      - id: sourcedb
-      - id: log
-    run: ../lofar-cwl/steps/makesourcedb.cwl
-    label: make_sourcedb
-    'sbg:x': -221
-    'sbg:y': -217
-  - id: calib_rot_diag
-    in:
-      - id: msin
-        source: predict/msout
-      - id: msin_datacolumn
-        default: SMOOTHED_DATA
-      - id: propagate_solutions
-        source: propagate_solutions
-      - id: flagunconverged
-        source: flagunconverged
-    out:
-      - id: msout
-      - id: h5parm
-    run: ../lofar-cwl/steps/ddecal.cwl
-    'sbg:x': 222
-    'sbg:y': -89
-requirements: []
+    'sbg:x': 0
+    'sbg:y': 0
+requirements:
+  - class: ScatterFeatureRequirement
diff --git a/subworkflow/calib_targ.cwl b/subworkflow/calib_targ.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..5ff661bbd13c4c1894795283e94696a697af4a15
--- /dev/null
+++ b/subworkflow/calib_targ.cwl
@@ -0,0 +1,122 @@
+class: Workflow
+cwlVersion: v1.0
+id: calibrate_target
+label: calibrate_target
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: Directory
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: skymodel
+    type: File
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 100
+outputs:
+  - id: msout
+    outputSource:
+      - calib_targ/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: gaincal.log
+    outputSource:
+      - concat_logfiles_gaincal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: outh5parm
+    outputSource:
+      - calib_targ/h5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+steps:
+  - id: BLsmooth
+    in:
+      - id: msin
+        source: msin
+      - id: do_smooth
+        source: do_smooth
+      - id: in_column_name
+        default: DATA
+      - id: restore
+        default: true
+    out:
+      - id: msout
+      - id: logfile
+    run: ../steps/blsmooth.cwl
+    label: BLsmooth
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: calib_targ
+    in:
+      - id: msin
+        source: BLsmooth/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msout_name
+        default: .
+      - id: blrange
+        default:
+          - 150
+          - 9999999
+      - id: caltype
+        default: phaseonly
+      - id: sourcedb
+        source: skymodel
+      - id: maxiter
+        default: 50
+      - id: solint
+        default: 1
+      - id: nchan
+        default: 0
+      - id: tolerance
+        default: 1e-3
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: usebeammodel
+        default: true
+      - id: usechannelfreq
+        default: true
+      - id: beammode
+        default: array_factor
+      - id: onebeamperpatch
+        default: false
+    out:
+      - id: msout
+      - id: h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/gaincal.cwl
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: concat_logfiles_gaincal
+    in:
+      - id: file_list
+        source:
+          - calib_targ/logfile
+      - id: file_prefix
+        default: gaincal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_gaincal
+    'sbg:x': 600
+    'sbg:y': 400
+requirements:
+  - class: MultipleInputFeatureRequirement
diff --git a/subworkflow/clocktec.cwl b/subworkflow/clocktec.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..77eb284a40ef5119df515ae8ce5602c3dfafbec2
--- /dev/null
+++ b/subworkflow/clocktec.cwl
@@ -0,0 +1,260 @@
+class: Workflow
+cwlVersion: v1.0
+id: losoto_ion
+label: losoto_ion
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: input_h5parm
+    type: File
+    'sbg:x': -700
+    'sbg:y': -400
+  - id: fit3rdorder
+    type: boolean?
+    'sbg:x': -700
+    'sbg:y': -200
+  - id: refAnt
+    type: string?
+    'sbg:x': -700
+    'sbg:y': 0
+  - id: maxStddev
+    type: float?
+    'sbg:x': -700
+    'sbg:y': 200
+  - id: clock_smooth
+    type: boolean?
+    'sbg:x': -700
+    'sbg:y': 400
+outputs:
+  - id: output_h5parm
+    outputSource:
+      - losoto_flagstation/output_h5parm
+    type: File
+    'sbg:x': 1500
+    'sbg:y': 0
+  - id: logfiles
+    outputSource:
+      - duplicateAbkp/log
+      - flag/log
+      - flagextend/log
+      - merge/log
+      - duplicatePbkp/log
+      - losoto_clocktec/log
+      - losoto_residual/log
+      - duplicateCbkp/log
+      - smooth/logfile
+      - losoto_flagstation/log
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1500
+    'sbg:y': -200
+  - id: parset
+    outputSource:
+      - losoto_residual/output_h5parm
+    type: File
+    'sbg:x': 1500
+    'sbg:y': 200
+steps:
+  - id: duplicateAbkp
+    in:
+      - id: input_h5parm
+        source: input_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: soltabOut
+        default: amplitudeOrig
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: flag
+    in:
+      - id: input_h5parm
+        source: duplicateAbkp/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToFlag
+        default:
+          - time
+          - freq
+      - id: order
+        default:
+          - 100
+          - 40
+      - id: maxCycles
+        default: 1
+      - id: maxRms
+        default: 5
+      - id: replace
+        default: false
+      - id: preflagzeros
+        default: false
+      - id: mode
+        default: smooth
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Flag.cwl
+    'sbg:x': -300
+    'sbg:y': 0
+  - id: flagextend
+    in:
+      - id: input_h5parm
+        source: flag/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesToExt
+        default:
+          - time
+          - freq
+      - id: size
+        default:
+          - 200
+          - 80
+      - id: percent
+        default: 50
+      - id: maxCycles
+        default: 2
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Flagextend.cwl
+    'sbg:x': -100
+    'sbg:y': 0
+  - id: merge
+    in:
+      - id: input_h5parm
+        source: flagextend/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: mode
+        default: copy
+      - id: soltabImport
+        default: amplitude000
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Reweight.cwl
+    'sbg:x': 100
+    'sbg:y': 0
+  - id: duplicatePbkp
+    in:
+      - id: input_h5parm
+        source: merge/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: soltabOut
+        default: phaseOrig
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': 300
+    'sbg:y': 0
+  - id: losoto_clocktec
+    in:
+      - id: input_h5parm
+        source: duplicatePbkp/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: clocksoltabOut
+        default: clock
+      - id: tecsoltabOut
+        default: tec
+      - id: offsetsoltabOut
+        default: phase_offset
+      - id: tec3rdsoltabOut
+        default: tec3rd
+      - id: FlagBadChannels
+        default: false
+      - id: CombinePol
+        default: true
+      - id: Fit3rdOrder
+        source: fit3rdorder
+      - id: Circular
+        default: false
+    out:
+      - id: output_h5parm
+      - id: parset
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.ClockTec.cwl
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: losoto_residual
+    in:
+      - id: input_h5parm
+        source: losoto_clocktec/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: soltabsToSub
+        source:
+          - fit3rdorder
+        valueFrom: '$(self ? ["tec", "clock", "tec3rd"] : ["tec", "clock"])'
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Residual.cwl
+    'sbg:x': 700
+    'sbg:y': 0
+  - id: duplicateCbkp
+    in:
+      - id: input_h5parm
+        source: losoto_residual/output_h5parm
+      - id: soltab
+        default: sol000/clock
+      - id: soltabOut
+        default: clockOrig
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': 900
+    'sbg:y': 0
+  - id: smooth
+    in:
+      - id: input_h5parm
+        source: duplicateCbkp/output_h5parm
+      - id: execute
+        source: clock_smooth
+      - id: soltab
+        default: sol000/clock
+      - id: axesToSmooth
+        default:
+          - time
+      - id: mode
+        default: median
+      - id: replace
+        default: true
+      - id: log
+        default: false
+    out:
+      - id: output_h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/LoSoTo.Smooth.cwl
+    'sbg:x': 1100
+    'sbg:y': 0
+  - id: losoto_flagstation
+    in:
+      - id: input_h5parm
+        source: smooth/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: mode
+        default: resid
+      - id: maxStddev
+        source: maxStddev
+      - id: refAnt
+        source: refAnt
+      - id: soltabExport
+        default: clock
+    out:
+      - id: output_h5parm
+      - id: log
+    run: ../lofar-cwl/steps/LoSoTo.FlagStation.cwl
+    'sbg:x': 1300
+    'sbg:y': 0
+requirements:
+  - class: StepInputExpressionRequirement
+  - class: InlineJavascriptRequirement
diff --git a/subworkflow/concat.cwl b/subworkflow/concat.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..c7337131d8d95a0985d1e6b3ae62c1214edaa79c
--- /dev/null
+++ b/subworkflow/concat.cwl
@@ -0,0 +1,159 @@
+class: Workflow
+cwlVersion: v1.0
+id: concat
+label: concat
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: group_id
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: groups_specification
+    type: File
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: filter_baselines
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: avg_timeresolution_concat
+    type: int
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: avg_freqresolution_concat
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: min_unflagged_fraction
+    type: float
+    'sbg:x': -1000
+    'sbg:y': 300
+outputs:
+  - id: msout_old
+    outputSource:
+      - dpppconcat/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: unflagged_fraction
+    outputSource:
+      - check_unflagged_fraction/unflagged_fraction
+    type: float
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: msout
+    outputSource:
+      - check_unflagged_fraction/msout
+    type: 'Directory[]'
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: dpppconcat.log
+    outputSource:
+      - concat_logfiles_dpppconcat/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: check_unflagged_fraction.log
+    outputSource:
+      - concat_logfiles_unflagged/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 200
+steps:
+  - id: filter_ms_group
+    in:
+      - id: group_id
+        source: group_id
+      - id: groups_specification
+        source: groups_specification
+      - id: measurement_sets
+        source:
+          - msin
+    out:
+      - id: output
+    run: ../steps/filter_ms_group.cwl
+    label: filter_ms_group
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: dpppconcat
+    in:
+      - id: msin
+        source:
+          - filter_ms_group/output
+      - id: msout_name
+        source: group_id
+      - id: msin_datacolumn
+        default: DATA
+      - id: msout_datacolumn
+        default: DATA
+      - id: filter_baselines
+        source: filter_baselines
+      - id: filter_remove
+        default: true
+      - id: overwrite
+        default: false
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+      - id: missingdata
+        default: true
+      - id: baseline
+        source: filter_baselines
+      - id: avg_timeresolution
+        source: avg_timeresolution_concat
+      - id: avg_freqresolution
+        source: avg_freqresolution_concat
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/dpppconcat.cwl
+    label: dpppconcat
+    'sbg:x': -200
+    'sbg:y': 0
+  - id: check_unflagged_fraction
+    in:
+      - id: msin
+        source: dpppconcat/msout
+      - id: min_fraction
+        source: min_unflagged_fraction
+    out:
+      - id: msout
+      - id: unflagged_fraction
+      - id: logfile
+    run: ../steps/check_unflagged_fraction.cwl
+    label: check_unflagged_fraction
+    'sbg:x': 100
+    'sbg:y': 0
+  - id: concat_logfiles_dpppconcat
+    in:
+      - id: file_list
+        source:
+          - dpppconcat/logfile
+      - id: file_prefix
+        default: dpppconcat
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_dpppconcat
+    'sbg:x': 600
+    'sbg:y': 200
+  - id: concat_logfiles_unflagged
+    in:
+      - id: file_list
+        source:
+          - check_unflagged_fraction/logfile
+      - id: file_prefix
+        default: check_unflagged_fraction
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_unflagged
+    'sbg:x': 600
+    'sbg:y': 400
+requirements: []
diff --git a/subworkflow/faraday_rotation.cwl b/subworkflow/faraday_rotation.cwl
index ab6edc0ca862b312c625ac4d7d479ec56a81c297..7afd26b6adc4e93c0c2c385554bf3b653465ab21 100644
--- a/subworkflow/faraday_rotation.cwl
+++ b/subworkflow/faraday_rotation.cwl
@@ -3,95 +3,66 @@ cwlVersion: v1.0
 id: faraday_rotation
 label: faraday_rotation
 $namespaces:
+  lofar: 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
   sbg: 'https://www.sevenbridges.com/'
 inputs:
-  - id: msin
-    type: 'Directory[]'
-    'sbg:x': -1017.7406616210938
-    'sbg:y': -230.76498413085938
   - id: refAnt
     type: string?
-    'sbg:x': -468.52337646484375
-    'sbg:y': -415.06396484375
+    'sbg:x': -451.3746643066406
+    'sbg:y': -493.92510986328125
+  - id: input_h5parm
+    type: File
+    'sbg:x': -743.1871948242188
+    'sbg:y': -316.5615234375
 outputs:
-  - id: msout
+  - id: output_h5parm
     outputSource:
-      - applycal/msout
-    type: 'Directory[]'
-    'sbg:x': 481.69647216796875
-    'sbg:y': -386.3322448730469
+      - losoto_faraday/output_h5parm
+    type: File
+    format: 'lofar:#H5Parm'
+    'sbg:x': 152.59103393554688
+    'sbg:y': -289.2899169921875
+  - id: logfiles
+    outputSource:
+      - losoto_duplicate/log
+      - losoto_faraday/log
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 300.5910339355469
+    'sbg:y': 0
 steps:
-  - id: h5imp_cal_FR
+  - id: losoto_duplicate
     in:
-      - id: h5parmFiles
-        linkMerge: merge_flattened
-      - id: squeeze
-        default: true
-      - id: verbose
-        default: true
-      - id: clobber
-        default: true
+      - id: input_h5parm
+        source: input_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: soltabOut
+        default: phaseOrig
     out:
-      - id: outh5parm
+      - id: output_h5parm
       - id: log
-    run: ../lofar-cwl/steps/H5ParmCollector.cwl
-    label: h5imp_cal_FR
-    'sbg:x': -339.8519592285156
-    'sbg:y': -82.80227661132812
+    run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
+    'sbg:x': -423.6229248046875
+    'sbg:y': -287.8958435058594
   - id: losoto_faraday
     in:
       - id: input_h5parm
-        source: h5imp_cal_FR/outh5parm
+        source: losoto_duplicate/output_h5parm
       - id: soltab
-        default: sol000/phase000
+        default: sol000/rotation000
+      - id: soltabout
+        default: faraday
       - id: refAnt
         source: refAnt
       - id: maxResidual
         default: 1
     out:
       - id: output_h5parm
+      - id: log
     run: ../lofar-cwl/steps/LoSoTo.Faraday.cwl
     'sbg:x': -99.27792358398438
     'sbg:y': -126.80227661132812
-  - id: h5exp_cal_FR
-    in:
-      - id: h5parmFiles
-        linkMerge: merge_flattened
-        source:
-          - losoto_faraday/output_h5parm
-      - id: insolset
-        default: sol000
-      - id: squeeze
-        default: true
-      - id: verbose
-        default: true
-      - id: clobber
-        default: false
-    out:
-      - id: outh5parm
-      - id: log
-    run: ../lofar-cwl/steps/H5ParmCollector.cwl
-    label: H5parm_collector
-    'sbg:x': 56.72110366821289
-    'sbg:y': -198
-  - id: applycal
-    in:
-      - id: msin
-        source: msin
-      - id: msin_datacolumn
-        default: CORRECTED_DATA
-      - id: parmdb
-        source: h5exp_cal_FR/outh5parm
-      - id: msout_datacolumn
-        default: CORRECTED_DATA
-      - id: correction
-        default: rotationmeasure000
-    out:
-      - id: msout
-    run: ../lofar-cwl/steps/applycal.cwl
-    scatter:
-      - msin
-    'sbg:x': 291.55780029296875
-    'sbg:y': -384.2626647949219
-requirements:
-  - class: ScatterFeatureRequirement
+requirements: []
+$schema:
+  - 'https://git.astron.nl/eosc/ontologies/raw/master/schema/lofar.owl'
diff --git a/subworkflow/ndppp_prep_cal.cwl b/subworkflow/ndppp_prep_cal.cwl
index 633a06d3dffd5d1be757d3783cea09905679fa8e..6bcdf446b3a632500708dabb251e23deb0820aa6 100644
--- a/subworkflow/ndppp_prep_cal.cwl
+++ b/subworkflow/ndppp_prep_cal.cwl
@@ -33,18 +33,46 @@ inputs:
     type: Directory?
     'sbg:x': 2306.83056640625
     'sbg:y': 318.2810363769531
+  - id: msin_baseline
+    type: string?
+    'sbg:x': 2273.798583984375
+    'sbg:y': 182.7539825439453
   - id: skymodel
     type: File
-    'sbg:x': 1428.3411865234375
-    'sbg:y': 273.64007568359375
+    'sbg:x': 1335.2567138671875
+    'sbg:y': 148.68453979492188
   - id: timeresolution
     type: float
     'sbg:x': 2021.81787109375
     'sbg:y': -352.4759216308594
   - id: freqresolution
-    type: float
+    type: string
     'sbg:x': 1999.5889892578125
     'sbg:y': 170.7563934326172
+  - id: demix_timestep
+    type: int
+    'sbg:x': 1371.962646484375
+    'sbg:y': 307.4278259277344
+  - id: demix_freqstep
+    type: int
+    'sbg:x': 1465.0855712890625
+    'sbg:y': 450.8930358886719
+  - id: demix_baseline
+    type: string
+    'sbg:x': 1585.496826171875
+    'sbg:y': 588.0062866210938
+  - id: target_source
+    type: string
+    'sbg:x': 1439.47314453125
+    'sbg:y': -325.6144104003906
+  - id: ntimechunk
+    type: int
+    'sbg:x': 1149.4033203125
+    'sbg:y': 349.2409362792969
+  - id: subtract_sources
+    type: 'string[]?'
+    'sbg:x': 1257.9327392578125
+    'sbg:y': -290.095703125
 outputs:
   - id: msout
     outputSource:
@@ -54,8 +82,8 @@ outputs:
     'sbg:y': 53.67763900756836
   - id: logfile
     outputSource:
-      - dppp/logfile
-    type: File?
+      - concat_logfiles_dppp/output
+    type: File
     'sbg:x': 2857.9423828125
     'sbg:y': 253.50680541992188
   - id: parset
@@ -175,8 +203,21 @@ steps:
           - flagamp/augmented_steps
       - id: step_name
         default: demixer
+      - id: baseline
+        source: demix_baseline
+      - id: demixtimestep
+        source: demix_timestep
+      - id: demixfreqstep
+        source: demix_freqstep
+      - id: ntimechunk
+        source: ntimechunk
       - id: skymodel
         source: skymodel
+      - id: subtractsources
+        source:
+          - subtract_sources
+      - id: targetsource
+        source: target_source
     out:
       - id: augmented_steps
     run: ../lofar-cwl/steps/DP3.DemixerStepGenerator.cwl
@@ -215,6 +256,16 @@ steps:
         source: parsetgenerator/output_file_names
       - id: output_directory_names
         source: parsetgenerator/output_directory_names
+      - id: autoweight
+        source: raw_data
+      - id: baseline
+        source: msin_baseline
+      - id: writefullresflag
+        default: false
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
     out:
       - id: msout
       - id: secondary_output_files
@@ -234,11 +285,26 @@ steps:
         source: timeresolution
       - id: freqresolution
         source: freqresolution
+      - id: minpoints
+        default: 1
     out:
       - id: augmented_steps
     run: ../lofar-cwl/steps/DP3.AveragerStepGenerator.cwl
     'sbg:x': 2158.297119140625
     'sbg:y': -55.93873977661133
+  - id: concat_logfiles_dppp
+    in:
+      - id: file_list
+        source:
+          - dppp/logfile
+      - id: file_prefix
+        default: dppp
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_dppp
+    'sbg:x': 2759.2265625
+    'sbg:y': 140.91714477539062
 requirements:
   - class: SubworkflowFeatureRequirement
   - class: StepInputExpressionRequirement
diff --git a/subworkflow/ndppp_prep_targ.cwl b/subworkflow/ndppp_prep_targ.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..45d923d9430a8745aa6aace52a5759d98ee54cf8
--- /dev/null
+++ b/subworkflow/ndppp_prep_targ.cwl
@@ -0,0 +1,475 @@
+class: Workflow
+cwlVersion: v1.0
+id: ndppp_prep_targ
+label: ndppp_prep_targ
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: baselines_to_flag
+    type: 'string[]'
+    'sbg:x': 732.2234497070312
+    'sbg:y': 79.11939239501953
+  - id: elevation_to_flag
+    type: string
+    'sbg:x': 815.8416137695312
+    'sbg:y': -281.40777587890625
+  - id: min_amplitude_to_flag
+    type: float
+    'sbg:x': 964.3058471679688
+    'sbg:y': 191.110595703125
+  - id: memoryperc
+    type: int
+    'sbg:x': 136.78256225585938
+    'sbg:y': -341.9549560546875
+  - id: raw_data
+    type: boolean
+    'sbg:x': 464.3541259765625
+    'sbg:y': -200.52120971679688
+  - id: demix
+    type: boolean
+    'sbg:x': 1647.1820068359375
+    'sbg:y': -314.6533508300781
+  - id: msin
+    type: Directory?
+    'sbg:x': 3819.599853515625
+    'sbg:y': 423.25006103515625
+  - id: skymodel
+    type: File
+    'sbg:x': 1335.2567138671875
+    'sbg:y': 148.68453979492188
+  - id: timeresolution
+    type: float
+    'sbg:x': 3344.8515625
+    'sbg:y': -733.585693359375
+  - id: freqresolution
+    type: string
+    'sbg:x': 3358.795654296875
+    'sbg:y': 298.08917236328125
+  - id: demix_timestep
+    type: int
+    'sbg:x': 1371.962646484375
+    'sbg:y': 307.4278259277344
+  - id: demix_freqstep
+    type: int
+    'sbg:x': 1465.0855712890625
+    'sbg:y': 450.8930358886719
+  - id: process_baselines_target
+    type: string
+    'sbg:x': 1585.496826171875
+    'sbg:y': 588.0062866210938
+  - id: target_source
+    type: string
+    'sbg:x': 1439.47314453125
+    'sbg:y': -325.6144104003906
+  - id: ntimechunk
+    type: int
+    'sbg:x': 1149.4033203125
+    'sbg:y': 349.2409362792969
+  - id: subtract_sources
+    type: 'string[]?'
+    'sbg:x': 1257.9327392578125
+    'sbg:y': -290.095703125
+  - id: parmdb
+    type: File
+    'sbg:x': 1930.5469970703125
+    'sbg:y': 298.99664306640625
+  - id: apply_tec_correction
+    type: boolean
+    'sbg:x': 2310.848876953125
+    'sbg:y': 446.3658752441406
+  - id: apply_rm_correction
+    type: boolean
+    'sbg:x': 2461.30224609375
+    'sbg:y': 719.8994140625
+  - id: apply_phase_correction
+    type: boolean
+    'sbg:x': 2544.00341796875
+    'sbg:y': 844.8623657226562
+  - id: apply_clock_correction
+    type: boolean
+    'sbg:x': 2238.046630859375
+    'sbg:y': 327.0130920410156
+  - id: apply_beam_correction
+    type: boolean
+    'sbg:x': 2391.738037109375
+    'sbg:y': 585.3051147460938
+  - id: filter_baselines
+    type: string
+    'sbg:x': 1880
+    'sbg:y': -380
+  - id: updateweights
+    type: boolean
+    'sbg:x': 2234.90185546875
+    'sbg:y': -393.8929748535156
+outputs:
+  - id: prep_logfile
+    outputSource:
+      - concat_logfiles_dppp/output
+    type: File?
+    'sbg:x': 5500
+    'sbg:y': 100
+  - id: predict_logfile
+    outputSource:
+      - concat_logfiles_predict/output
+    type: File?
+    'sbg:x': 5500
+    'sbg:y': 0
+  - id: clipper_logfile
+    outputSource:
+      - concat_logfiles_clipper/output
+    type: File?
+    'sbg:x': 5500
+    'sbg:y': -100
+  - id: msout
+    outputSource:
+      - predict/msout
+    type: Directory
+    'sbg:x': 5502.318359375
+    'sbg:y': -279.49835205078125
+  - id: clipper_output
+    outputSource:
+      - Ateamclipper/output
+    type: File
+    'sbg:x': 5502.318359375
+    'sbg:y': -500
+  - id: parset
+    outputSource:
+      - dp3_execute/parset
+    type: File
+    'sbg:x': 5427.662109375
+    'sbg:y': -765.5377197265625
+steps:
+  - id: flagbaseline
+    in:
+      - id: steps
+        source:
+          - process_raw_data_select/selected_steps
+      - id: step_name
+        default: flagbaseline
+      - id: baseline
+        source:
+          - baselines_to_flag
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
+    'sbg:x': 955.2450561523438
+    'sbg:y': -75.71149444580078
+  - id: flagelev
+    in:
+      - id: steps
+        source:
+          - flagbaseline/augmented_steps
+      - id: step_name
+        default: flagelev
+      - id: elevation
+        source: elevation_to_flag
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
+    'sbg:x': 1187.4771728515625
+    'sbg:y': -83
+  - id: process_raw_data_select
+    in:
+      - id: select_a
+        source: raw_data
+      - id: a_steps
+        source:
+          - aoflag/augmented_steps
+      - id: b_steps
+        default: []
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: Selector
+    'sbg:x': 621.4892578125
+    'sbg:y': -71.31844329833984
+  - id: flagamp
+    in:
+      - id: steps
+        source:
+          - flagelev/augmented_steps
+      - id: step_name
+        default: flagamp
+      - id: amplmin
+        source: min_amplitude_to_flag
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
+    'sbg:x': 1385.993408203125
+    'sbg:y': -42.28850555419922
+  - id: flagedge
+    in:
+      - id: steps
+        default: []
+      - id: step_name
+        default: flagedge
+      - id: chan
+        default: '[0..nchan/32-1,31*nchan/32..nchan-1]'
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.PreflaggerStepGenerator.cwl
+    'sbg:x': 122.25408935546875
+    'sbg:y': -54.06163024902344
+  - id: aoflag
+    in:
+      - id: steps
+        source:
+          - flagedge/augmented_steps
+      - id: step_name
+        default: aoflag
+      - id: memoryperc
+        source: memoryperc
+      - id: keepstatistics
+        default: false
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.AOFlaggerStepGenerator.cwl
+    'sbg:x': 369.9876708984375
+    'sbg:y': -38.086280822753906
+  - id: demix_select
+    in:
+      - id: select_a
+        source: demix
+      - id: a_steps
+        source:
+          - demixstepgenerator/augmented_steps
+      - id: b_steps
+        source:
+          - flagamp/augmented_steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: demix?
+    'sbg:x': 1888.8828125
+    'sbg:y': -24.5985050201416
+  - id: demixstepgenerator
+    in:
+      - id: steps
+        source:
+          - flagamp/augmented_steps
+      - id: step_name
+        default: demixer
+      - id: baseline
+        source: process_baselines_target
+      - id: demixtimestep
+        source: demix_timestep
+      - id: demixfreqstep
+        source: demix_freqstep
+      - id: ntimechunk
+        source: ntimechunk
+      - id: skymodel
+        source: skymodel
+      - id: subtractsources
+        source:
+          - subtract_sources
+      - id: targetsource
+        source: target_source
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.DemixerStepGenerator.cwl
+    'sbg:x': 1676.6593017578125
+    'sbg:y': 90.7158203125
+  - id: average_step_generator
+    in:
+      - id: steps
+        source:
+          - prep_target_applycal/selected_steps
+      - id: step_name
+        default: averager
+      - id: minpoints
+        default: 1
+      - id: timeresolution
+        source: timeresolution
+      - id: freqresolution
+        source: freqresolution
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.AveragerStepGenerator.cwl
+    'sbg:x': 3743.862060546875
+    'sbg:y': -426.2447814941406
+  - id: concat_logfiles_dppp
+    in:
+      - id: file_list
+        source:
+          - dp3_execute/logfile
+      - id: file_prefix
+        default: dppp
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_dppp
+    'sbg:x': 4543.36376953125
+    'sbg:y': -6.564670085906982
+  - id: concat_logfiles_predict
+    in:
+      - id: file_list
+        source:
+          - predict/logfile
+      - id: file_prefix
+        default: predict_targ
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_predict
+    'sbg:x': 4700
+    'sbg:y': -6.564670085906982
+  - id: concat_logfiles_clipper
+    in:
+      - id: file_list
+        source:
+          - Ateamclipper/logfile
+      - id: file_prefix
+        default: Ateamclipper
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_clipper
+    'sbg:x': 4900
+    'sbg:y': -6.564670085906982
+  - id: dp3_execute
+    in:
+      - id: msout_name
+        source: msin
+        valueFrom: $("out_"+self.basename)
+      - id: msin
+        source: msin
+      - id: steps
+        source:
+          - average_step_generator/augmented_steps
+      - id: autoweight
+        default: false
+        source: raw_data
+    out:
+      - id: secondary_output_files
+      - id: secondary_output_directories
+      - id: msout
+      - id: logfile
+      - id: parset
+    run: ../lofar-cwl/steps/DP3.Execute.cwl
+    label: DP3.Execute
+    'sbg:x': 4154.9287109375
+    'sbg:y': -344.5472106933594
+  - id: filter
+    in:
+      - id: steps
+        source:
+          - demix_select/selected_steps
+      - id: step_name
+        default: filter
+      - id: baseline
+        source: filter_baselines
+      - id: remove
+        default: true
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.FilterStepGenerator.cwl
+    'sbg:x': 2049.48486328125
+    'sbg:y': -18.005611419677734
+  - id: applyPA
+    in:
+      - id: steps
+        source:
+          - filter/augmented_steps
+      - id: step_name
+        default: apply_pa_1
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: calibrator
+      - id: correction
+        default: polalign
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 2205.820068359375
+    'sbg:y': 7.381086349487305
+  - id: applyBandpass
+    in:
+      - id: steps
+        source:
+          - applyPA/augmented_steps
+      - id: step_name
+        default: apply_bandpass_1
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: calibrator
+      - id: correction
+        default: bandpass
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 2420.382568359375
+    'sbg:y': -149.9799346923828
+  - id: prep_target_applycal
+    in:
+      - id: steps
+        source:
+          - applyBandpass/augmented_steps
+      - id: apply_clock_correction
+        source: apply_clock_correction
+      - id: apply_tec_correction
+        source: apply_tec_correction
+      - id: apply_rm_correction
+        source: apply_rm_correction
+      - id: apply_beam_correction
+        source: apply_beam_correction
+      - id: apply_phase_correction
+        source: apply_phase_correction
+      - id: parmdb
+        source: parmdb
+      - id: updateweights
+        source: updateweights
+    out:
+      - id: selected_steps
+    run: ./prep_target_applycal.cwl
+    label: prep_target_applycal
+    'sbg:x': 2728.697998046875
+    'sbg:y': -18.151018142700195
+  - id: predict
+    in:
+      - id: msin
+        source: dp3_execute/msout
+      - id: msin_datacolumn
+        default: DATA
+      - id: msout_datacolumn
+        default: MODEL_DATA
+      - id: sources_db
+        source: skymodel
+      - id: sources
+        default:
+          - VirA_4_patch
+          - CygAGG
+          - CasA_4_patch
+          - TauAGG
+      - id: usebeammodel
+        default: true
+      - id: onebeamperpatch
+        default: true
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/filter_predict.cwl
+    'sbg:x': 4500
+    'sbg:y': -344.5472106933594
+  - id: Ateamclipper
+    in:
+      - id: msin
+        source:
+          - predict/msout
+    out:
+      - id: msout
+      - id: logfile
+      - id: output
+    run: ../lofar-cwl/steps/Ateamclipper.cwl
+    label: Ateamclipper
+    'sbg:x': 4700
+    'sbg:y': -344.5472106933594
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: InlineJavascriptRequirement
+  - class: StepInputExpressionRequirement
diff --git a/subworkflow/pol_align.cwl b/subworkflow/pol_align.cwl
index 91666c3f84f2a439e81d3306ac2784d3e44b5732..808e4fa193fdf98be78c1067f6f12b7c7ffa4dc0 100644
--- a/subworkflow/pol_align.cwl
+++ b/subworkflow/pol_align.cwl
@@ -14,13 +14,26 @@ inputs:
     type: File
     'sbg:x': -743.1871948242188
     'sbg:y': -316.5615234375
+  - id: fit_offset_PA
+    type: boolean?
+    'sbg:x': -743.1871948242188
+    'sbg:y': -316.5615234375
 outputs:
   - id: output_h5parm
     outputSource:
       - losoto_residual/output_h5parm
     type: File
+    format: lofar:#H5Parm
     'sbg:x': 152.59103393554688
     'sbg:y': -289.2899169921875
+  - id: logfiles
+    outputSource:
+      - losoto_duplicate/log
+      - losoto_polalign/log
+      - losoto_residual/log
+    linkMerge: merge_flattened
+    type: 'File[]'
+
 steps:
   - id: losoto_duplicate
     in:
@@ -32,6 +45,7 @@ steps:
         default: phaseOrig
     out:
       - id: output_h5parm
+      - id: log
     run: ../lofar-cwl/steps/LoSoTo.Duplicate.cwl
     'sbg:x': -423.6229248046875
     'sbg:y': -287.8958435058594
@@ -47,10 +61,15 @@ steps:
         default: true
       - id: replace
         default: true
+      - id: maxResidual
+        default: 1.0
+      - id: fitOffset
+        source: fit_offset_PA
       - id: refAnt
         source: refAnt
     out:
       - id: output_h5parm
+      - id: log
     run: ../lofar-cwl/steps/LoSoTo.Polalign.cwl
     'sbg:x': -203.663818359375
     'sbg:y': -292.61700439453125
@@ -65,6 +84,7 @@ steps:
           - polalign
     out:
       - id: output_h5parm
+      - id: log
     run: ../lofar-cwl/steps/LoSoTo.Residual.cwl
     'sbg:x': -0.012040258385241032
     'sbg:y': -287.7294006347656
diff --git a/subworkflow/predict_calibrate.cwl b/subworkflow/predict_calibrate.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..4186dd11968ae6f8bb8e95aa1bf9f54f4b133562
--- /dev/null
+++ b/subworkflow/predict_calibrate.cwl
@@ -0,0 +1,140 @@
+class: Workflow
+cwlVersion: v1.0
+id: predict_calibrate
+label: predict_calibrate
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: Directory
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: sourcedb
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: flagunconverged
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 200
+outputs:
+  - id: msout
+    outputSource:
+      - calib_cal/msout
+    type: Directory
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: BLsmooth.log
+    outputSource:
+      - BLsmooth/logfile
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: predict_cal.log
+    outputSource:
+      - concat_logfiles_predict/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: calib_cal.log
+    outputSource:
+      - concat_logfiles_calib_cal/output
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: outh5parm
+    outputSource:
+      - calib_cal/h5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 200
+steps:
+  - id: BLsmooth
+    in:
+      - id: msin
+        source: msin
+      - id: do_smooth
+        source: do_smooth
+    out:
+      - id: msout
+      - id: logfile
+    run: ../steps/blsmooth.cwl
+    label: BLsmooth
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: predict
+    in:
+      - id: msin
+        source: BLsmooth/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msout_datacolumn
+        default: MODEL_DATA
+      - id: sources_db
+        source: sourcedb
+      - id: storagemanager
+        default: Dysco
+      - id: databitrate
+        default: 0
+    out:
+      - id: msout
+      - id: logfile
+    run: ../lofar-cwl/steps/predict.cwl
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: calib_cal
+    in:
+      - id: msin
+        source: predict/msout
+      - id: msin_datacolumn
+        default: SMOOTHED_DATA
+      - id: msin_modelcolum
+        default: MODEL_DATA
+      - id: propagate_solutions
+        source: propagatesolutions
+      - id: flagunconverged
+        source: flagunconverged
+      - id: mode
+        default: rotation+diagonal
+    out:
+      - id: msout
+      - id: h5parm
+      - id: logfile
+    run: ../lofar-cwl/steps/ddecal.cwl
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_predict
+    in:
+      - id: file_list
+        source:
+          - predict/logfile
+      - id: file_prefix
+        default: predict
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_predict
+    'sbg:x': 500
+    'sbg:y': 200
+  - id: concat_logfiles_calib_cal
+    in:
+      - id: file_list
+        source:
+          - calib_cal/logfile
+      - id: file_prefix
+        default: calib_cal
+    out:
+      - id: output
+    run: ../steps/concatenate_files.cwl
+    label: concat_logfiles_calib_cal
+    'sbg:x': 700
+    'sbg:y': 200
+requirements: []
diff --git a/subworkflow/prep_target_applycal.cwl b/subworkflow/prep_target_applycal.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e3968609efdafd6e652bf9da367a96a29e02267f
--- /dev/null
+++ b/subworkflow/prep_target_applycal.cwl
@@ -0,0 +1,226 @@
+class: Workflow
+cwlVersion: v1.0
+id: prep_target_applycal
+label: prep_target_applycal
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: steps
+    type: 'Any[]?'
+    'sbg:x': 1566.9437255859375
+    'sbg:y': 173.2586669921875
+  - id: apply_clock_correction
+    type: boolean
+    'sbg:x': 1622.751953125
+    'sbg:y': -235.5788116455078
+  - id: apply_tec_correction
+    type: boolean
+    'sbg:x': 1990.8035888671875
+    'sbg:y': -230.75811767578125
+  - id: apply_rm_correction
+    type: boolean
+    'sbg:x': 2502.2421875
+    'sbg:y': -225.68701171875
+  - id: apply_beam_correction
+    type: boolean
+    'sbg:x': 2273.170166015625
+    'sbg:y': -251.86672973632812
+  - id: apply_phase_correction
+    type: boolean
+    'sbg:x': 2750.948974609375
+    'sbg:y': -241.39480590820312
+  - id: parmdb
+    type: File
+    'sbg:x': 2007.115234375
+    'sbg:y': 685.0719604492188
+  - id: updateweights
+    type: boolean
+    'sbg:x': 2167.219970703125
+    'sbg:y': 422.6792297363281
+outputs:
+  - id: selected_steps
+    outputSource:
+      - apply_phase/selected_steps
+    type: Any
+    'sbg:x': 3129.244873046875
+    'sbg:y': 165.6987762451172
+steps:
+  - id: applyClock
+    in:
+      - id: steps
+        source:
+          - steps
+      - id: step_name
+        default: apply_clock
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: calibrator
+      - id: correction
+        default: clock
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 1747.8311767578125
+    'sbg:y': 285.2012634277344
+  - id: applyTec
+    in:
+      - id: steps
+        source:
+          - apply_clock/selected_steps
+      - id: step_name
+        default: apply_tec
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: calibrator
+      - id: correction
+        default: tec
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 2056.49462890625
+    'sbg:y': 277.8923034667969
+  - id: applyPhase
+    in:
+      - id: steps
+        source:
+          - apply_rm/selected_steps
+      - id: step_name
+        default: apply_phase
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: calibrator
+      - id: correction
+        default: phaseOrig
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 2805.44873046875
+    'sbg:y': 299.8974304199219
+  - id: applyRM
+    in:
+      - id: steps
+        source:
+          - apply_beam/selected_steps
+      - id: step_name
+        default: apply_rm
+      - id: parmdb
+        source: parmdb
+      - id: solset
+        default: target
+      - id: correction
+        default: RMextract
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyCalStepGenerator.cwl
+    'sbg:x': 2545.4775390625
+    'sbg:y': 291.2240295410156
+  - id: applybeam
+    in:
+      - id: steps
+        source:
+          - apply_tec/selected_steps
+      - id: step_name
+        default: apply_beam
+      - id: usechannelfreq
+        default: true
+      - id: updateweights
+        source: updateweights
+      - id: invert
+        default: true
+      - id: beammode
+        default: default
+    out:
+      - id: augmented_steps
+    run: ../lofar-cwl/steps/DP3.ApplyBeamStepGenerator.cwl
+    'sbg:x': 2321
+    'sbg:y': 285.3694763183594
+  - id: apply_beam
+    in:
+      - id: select_a
+        source: apply_beam_correction
+      - id: a_steps
+        source:
+          - applybeam/augmented_steps
+      - id: b_steps
+        default: []
+        source:
+          - apply_tec/selected_steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: apply_beam
+    'sbg:x': 2441.14599609375
+    'sbg:y': 167.0730438232422
+  - id: apply_rm
+    in:
+      - id: select_a
+        source: apply_rm_correction
+      - id: a_steps
+        source:
+          - applyRM/augmented_steps
+      - id: b_steps
+        default: []
+        source:
+          - apply_beam/selected_steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: apply_rm?
+    'sbg:x': 2648.432373046875
+    'sbg:y': 167.062255859375
+  - id: apply_clock
+    in:
+      - id: select_a
+        source: apply_clock_correction
+      - id: a_steps
+        source:
+          - applyClock/augmented_steps
+      - id: b_steps
+        default: []
+        source:
+          - steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: apply_clock?
+    'sbg:x': 1909.072998046875
+    'sbg:y': 167.82034301757812
+  - id: apply_tec
+    in:
+      - id: select_a
+        source: apply_tec_correction
+      - id: a_steps
+        source:
+          - applyTec/augmented_steps
+      - id: b_steps
+        default: []
+        source:
+          - apply_clock/selected_steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: apply_tec?
+    'sbg:x': 2192.246826171875
+    'sbg:y': 166.15206909179688
+  - id: apply_phase
+    in:
+      - id: select_a
+        source: apply_phase_correction
+      - id: a_steps
+        source:
+          - applyPhase/augmented_steps
+      - id: b_steps
+        default: []
+        source:
+          - apply_rm/selected_steps
+    out:
+      - id: selected_steps
+    run: ../lofar-cwl/steps/DP3.Selector.cwl
+    label: apply_phase
+    'sbg:x': 2927.22412109375
+    'sbg:y': 162.4778289794922
+requirements:
+  - class: SubworkflowFeatureRequirement
diff --git a/test_workflow/empty_dirs/ms1/README b/test_workflow/empty_dirs/ms1/README
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/test_workflow/empty_dirs/ms2/README b/test_workflow/empty_dirs/ms2/README
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/test_workflow/empty_dirs/ms3/README b/test_workflow/empty_dirs/ms3/README
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/test_workflow/empty_dirs/ms5/README b/test_workflow/empty_dirs/ms5/README
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/test_workflow/filter_ms_group.json b/test_workflow/filter_ms_group.json
new file mode 100644
index 0000000000000000000000000000000000000000..dbdcc34733a9aa358d6d7bd9a2d4769b7e80bf5e
--- /dev/null
+++ b/test_workflow/filter_ms_group.json
@@ -0,0 +1,9 @@
+{
+"group_id": "1",
+"groups_specification": {"class": "File", "path": "groups_spec.json"},
+"measurement_sets": [
+           {"class": "Directory", "path": "empty_dirs/ms1"}, 
+           {"class": "Directory", "path": "empty_dirs/ms2"},
+           {"class": "Directory", "path": "empty_dirs/ms3"},
+           {"class": "Directory", "path": "empty_dirs/ms5"}]
+}
diff --git a/test_workflow/groups_spec.json b/test_workflow/groups_spec.json
new file mode 100644
index 0000000000000000000000000000000000000000..89e56a1ffbd550d4ed4f48841a01cc2feaa47578
--- /dev/null
+++ b/test_workflow/groups_spec.json
@@ -0,0 +1,4 @@
+{
+ "1": ["ms1", "ms2"],
+ "2": ["ms3", "ms5"]
+}
diff --git a/workflows/HBA_calibrator.cwl b/workflows/HBA_calibrator.cwl
index 101392e71b433db42dcba5d45c3a6bf993211d55..664c6dda2b7a1ed1556b528ff4a21ec04c39fa6d 100644
--- a/workflows/HBA_calibrator.cwl
+++ b/workflows/HBA_calibrator.cwl
@@ -1,117 +1,126 @@
 class: Workflow
 cwlVersion: v1.0
-id: _h_b_a
-label: HBA.cwl
+id: HBA_calibrator
+label: HBA_calibrator
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 inputs:
   - id: msin
     type: 'Directory[]'
     'sbg:x': -1000
-    'sbg:y': -1700
+    'sbg:y': -1900
   - id: refant
     type: string?
-    default: CS001HBA0
+    default: 'CS00.*'
     'sbg:x': -1000
-    'sbg:y': -1600
+    'sbg:y': -1800
   - id: flag_baselines
     type: 'string[]?'
     default: []
     'sbg:x': -1000
-    'sbg:y': -1500
+    'sbg:y': -1700
   - id: process_baselines_cal
     type: string?
     default: '*&'
     'sbg:x': -1000
-    'sbg:y': -1400
+    'sbg:y': -1600
   - id: filter_baselines
     type: string?
     default: '*&'
     'sbg:x': -1000
-    'sbg:y': -1300
+    'sbg:y': -1500
+  - id: fit_offset_PA
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1400
   - id: do_smooth
     type: boolean?
     default: false
     'sbg:x': -1000
-    'sbg:y': -1200
+    'sbg:y': -1300
   - id: rfistrategy
     type: string?
     default: HBAdefault.rfis
     'sbg:x': -1000
-    'sbg:y': -1100
+    'sbg:y': -1200
   - id: max2interpolate
     type: int?
     default: 30
     'sbg:x': -1000
-    'sbg:y': -1000
+    'sbg:y': -1100
   - id: ampRange
-    type: 'int[]?'
+    type: 'float[]?'
     default:
       - 0
       - 0
     'sbg:x': -1000
-    'sbg:y': -900
+    'sbg:y': -1000
   - id: skip_international
     type: boolean?
     default: true
     'sbg:x': -1000
-    'sbg:y': -800
+    'sbg:y': -900
   - id: raw_data
     type: boolean?
     default: false
     'sbg:x': -1000
-    'sbg:y': -700
+    'sbg:y': -800
   - id: propagatesolutions
     type: boolean?
     default: true
     'sbg:x': -1000
-    'sbg:y': -600
+    'sbg:y': -700
   - id: flagunconverged
     type: boolean?
     default: false
     'sbg:x': -1000
-    'sbg:y': -500
+    'sbg:y': -600
   - id: maxStddev
     type: float?
     default: -1.0
     'sbg:x': -1000
-    'sbg:y': -400
+    'sbg:y': -500
   - id: solutions2transfer
     type: File?
-    default: /data/solutions/3C48.h5
     'sbg:x': -1000
-    'sbg:y': -300
+    'sbg:y': -400
   - id: antennas2transfer
-    type: File?
+    type: string?
     default: '[FUSPID].*'
     'sbg:x': -1000
+    'sbg:y': -300
+  - id: do_transfer
+    type: boolean
+    default: false
+    'sbg:x': -1000
     'sbg:y': -200
+  - id: trusted_sources
+    type: string
+    default: '3C48,3C147,3C196,3C295'
+    'sbg:x': -1000
+    'sbg:y': -100
   - id: demix_sources
     type: 'string[]?'
     default:
       - CasA
       - CygA
     'sbg:x': -1000
-    'sbg:y': -100
+    'sbg:y': 0
   - id: demix_target
     type: string?
     default: ''
     'sbg:x': -1000
-    'sbg:y': 0
+    'sbg:y': 100
   - id: demix_freqstep
     type: int?
     default: 16
     'sbg:x': -1000
-    'sbg:y': 100
+    'sbg:y': 200
   - id: demix_timestep
     type: int?
     default: 10
     'sbg:x': -1000
-    'sbg:y': 200
-  - id: raw_data
-    type: boolean?
-    default: false
-    'sbg:x': -1000
     'sbg:y': 300
   - id: demix
     type: boolean?
@@ -138,44 +147,42 @@ inputs:
     default: false
     'sbg:x': -1000
     'sbg:y': 800
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 900
   - id: memoryperc
     type: int?
     default: 20
     'sbg:x': -1000
-    'sbg:y': 900
+    'sbg:y': 1000
   - id: min_length
     type: int?
     default: 50
     'sbg:x': -1000
-    'sbg:y': 1000
+    'sbg:y': 1100
   - id: overhead
     type: float?
     default: 0.8
     'sbg:x': -1000
-    'sbg:y': 1100
+    'sbg:y': 1200
   - id: min_separation
     type: int?
     default: 30
     'sbg:x': -1000
-    'sbg:y': 1200
+    'sbg:y': 1300
   - id: max_separation_arcmin
     type: float?
-    default: 1
+    default: 1.0
     'sbg:x': -1000
-    'sbg:y': 1300
+    'sbg:y': 1400
   - id: calibrator_path_skymodel
     type: Directory?
-    default: /data/skymodels
-    'sbg:x': -1000
-    'sbg:y': 1400
-  - id: A-Team_sky_model
-    type: File?
-    default: /data/skymodels/Ateam_LBA_CC.skymodel
     'sbg:x': -1000
     'sbg:y': 1500
-  - id: cal_solutions
-    type: string?
-    default: cal_solutions.h5
+  - id: A-Team_skymodel
+    type: File?
     'sbg:x': -1000
     'sbg:y': 1600
   - id: avg_timeresolution
@@ -194,55 +201,35 @@ inputs:
     'sbg:x': -1000
     'sbg:y': 1900
 outputs:
-  - id: msout
-    outputSource:
-      - prefactor/msout
-    type: 'Directory[]'
-    'sbg:x': 289.5600891113281
-    'sbg:y': -144.01869201660156
-  - id: make_sourcedb_ateam.log
-    outputSource:
-      - prefactor/make_sourcedb_ateam.log
-    type: File?
-    'sbg:x': 317.4496154785156
-    'sbg:y': 9.373631477355957
-  - id: logfile_prep_cal
+  - id: logs
     outputSource:
-      - prefactor/logfile_prep_cal
-    type: 'File[]?'
-    'sbg:x': 315.0741882324219
-    'sbg:y': 180.26284790039062
-  - id: check_Ateam_separation.png
-    outputSource:
-      - prefactor/check_Ateam_separation.png
-    type: 'File[]?'
-    'sbg:x': 287.6455078125
-    'sbg:y': 344.1313171386719
-  - id: check_Ateam_separation.log
-    outputSource:
-      - prefactor/check_Ateam_separation.log
-    type: 'File[]?'
-    'sbg:x': 315.5941467285156
-    'sbg:y': 494.9656982421875
-  - id: parset
+      - save_logfiles/log_dir
+    type: Directory
+    'sbg:x': 1500
+    'sbg:y': -100
+  - id: results
     outputSource:
-      - prefactor/parset
-    type: 'File[]'
-    'sbg:x': 293.33331298828125
-    'sbg:y': -305.4627990722656
+      - save_results/log_dir
+    type: Directory
+    'sbg:x': 1500
+    'sbg:y': 0
 steps:
   - id: prefactor
     in:
       - id: msin
-        source: msin
+        source:
+          - msin
       - id: refant
         source: refant
       - id: flag_baselines
-        source: flag_baselines
+        source:
+          - flag_baselines
       - id: process_baselines_cal
         source: process_baselines_cal
       - id: filter_baselines
         source: filter_baselines
+      - id: fit_offset_PA
+        source: fit_offset_PA
       - id: do_smooth
         source: do_smooth
       - id: rfistrategy
@@ -250,7 +237,8 @@ steps:
       - id: max2interpolate
         source: max2interpolate
       - id: ampRange
-        source: ampRange
+        source:
+          - ampRange
       - id: skip_international
         source: skip_international
       - id: raw_data
@@ -265,8 +253,13 @@ steps:
         source: solutions2transfer
       - id: antennas2transfer
         source: antennas2transfer
+      - id: do_transfer
+        source: do_transfer
+      - id: trusted_sources
+        source: trusted_sources
       - id: demix_sources
-        source: demix_sources
+        source:
+          - demix_sources
       - id: demix_target
         source: demix_target
       - id: demix_freqstep
@@ -283,6 +276,8 @@ steps:
         source: tables2export
       - id: final_apply
         source: final_apply
+      - id: max_dppp_threads
+        source: max_dppp_threads
       - id: memoryperc
         source: memoryperc
       - id: min_length
@@ -295,10 +290,8 @@ steps:
         source: max_separation_arcmin
       - id: calibrator_path_skymodel
         source: calibrator_path_skymodel
-      - id: A-Team_sky_model
-        source: Team_sky_model
-      - id: cal_solutions
-        source: cal_solutions
+      - id: A-Team_skymodel
+        source: A-Team_skymodel
       - id: avg_timeresolution
         source: avg_timeresolution
       - id: avg_freqresolution
@@ -306,15 +299,73 @@ steps:
       - id: bandpass_freqresolution
         source: bandpass_freqresolution
     out:
-      - id: check_Ateam_separation.png
-      - id: check_Ateam_separation.log
-      - id: make_sourcedb_ateam.log
+      - id: logfiles
       - id: msout
-      - id: logfile_prep_cal
       - id: parset
-    run: ./prefactor_calibrator_test.cwl
+      - id: solutions
+      - id: inspection
+    run: ./prefactor_calibrator.cwl
     label: prefactor_calibrator
     'sbg:x': 0
     'sbg:y': 0
+  - id: save_logfiles
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - prefactor/logfiles
+      - id: sub_directory_name
+        default: logs
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_logfiles
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: save_inspection
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - prefactor/inspection
+      - id: sub_directory_name
+        default: inspection
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_inspection
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: save_solutions
+    in:
+      - id: log_files
+        source:
+          - prefactor/solutions
+      - id: sub_directory_name
+        default: cal_values
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_solutions
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: save_results
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - save_solutions/log_dir
+          - save_inspection/log_dir
+          - prefactor/msout
+      - id: sub_directory_name
+        default: results
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_results
+    'sbg:x': 1200
+    'sbg:y': 0
 requirements:
   - class: SubworkflowFeatureRequirement
+  - class: MultipleInputFeatureRequirement
+  
diff --git a/workflows/HBA_target.cwl b/workflows/HBA_target.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..a42768111708e306c360753e9d9489adb16f995a
--- /dev/null
+++ b/workflows/HBA_target.cwl
@@ -0,0 +1,415 @@
+class: Workflow
+cwlVersion: v1.0
+id: HBA_target
+label: HBA_target
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -1700
+  - id: cal_solutions
+    type: 'File'
+    'sbg:x': -1000
+    'sbg:y': -1600
+  - id: refant
+    type: string?
+    default: 'CS00.*'
+    'sbg:x': -1000
+    'sbg:y': -1500
+  - id: flag_baselines
+    type: 'string[]?'
+    default: []
+    'sbg:x': -1000
+    'sbg:y': -1400
+  - id: process_baselines_target
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1300
+  - id: filter_baselines
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1200
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1100
+  - id: rfistrategy
+    type: string?
+    default: HBAdefault.rfis
+    'sbg:x': -1000
+    'sbg:y': -1000
+  - id: min_unflagged_fraction
+    type: float?
+    default: 0.5
+    'sbg:x': -1000
+    'sbg:y': -900
+  - id: compression_bitrate
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': -800
+  - id: raw_data
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -700
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -600
+  - id: demix_sources
+    type: 'string[]?'
+    default:
+      - CasA
+      - CygA
+    'sbg:x': -1000
+    'sbg:y': -500
+  - id: demix_target
+    type: string?
+    default: ''
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: demix_freqstep
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: demix_timestep
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: demix
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: apply_tec
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y':  0
+  - id: apply_clock
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: apply_phase
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: apply_RM
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: apply_beam
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: clipATeam
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: gsmcal_step
+    type: string?
+    default: 'phase'
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: updateweights
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 800
+  - id: memoryperc
+    type: int?
+    default: 20
+    'sbg:x': -1000
+    'sbg:y': 900
+  - id: min_length
+    type: int?
+    default: 5
+    'sbg:x': -1000
+    'sbg:y': 1000
+  - id: overhead
+    type: float?
+    default: 0.7
+    'sbg:x': -1000
+    'sbg:y': 1100
+  - id: min_separation
+    type: int?
+    default: 30
+    'sbg:x': -1000
+    'sbg:y': 1200
+  - id: A-Team_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 1300
+  - id: target_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 1400
+  - id: use_target
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 1500
+  - id: skymodel_source
+    type: string?
+    default: 'TGSS'
+    'sbg:x': -1000
+    'sbg:y': 1600
+  - id: avg_timeresolution
+    type: int?
+    default: 4
+    'sbg:x': -1000
+    'sbg:y': 1700
+  - id: avg_freqresolution
+    type: string?
+    default: 48.82kHz
+    'sbg:x': -1000
+    'sbg:y': 1800
+  - id: avg_timeresolution_concat
+    type: int?
+    default: 8
+    'sbg:x': -1000
+    'sbg:y': 1900
+  - id: avg_freqresolution_concat
+    type: string?
+    default: 97.64kHz
+    'sbg:x': -1000
+    'sbg:y': 2000
+  - id: num_SBs_per_group
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 2100
+  - id: reference_stationSB
+    type: int?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2200
+  - id: ionex_server
+    type: string?
+    default: 'ftp://ftp.aiub.unibe.ch/CODE/'
+    'sbg:x': -1000
+    'sbg:y': 2300
+  - id: ionex_prefix
+    type: string?
+    default: 'CODG'
+    'sbg:x': -1000
+    'sbg:y': 2400
+  - id: proxy_server
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2500
+  - id: proxy_port
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2600
+  - id: proxy_type
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2700
+  - id: proxy_user
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2800
+  - id: proxy_pass
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2900
+outputs:
+  - id: results
+    outputSource:
+      - save_results/log_dir
+    type: Directory
+    'sbg:x': 1500
+    'sbg:y': 0
+steps:
+  - id: prefactor
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: cal_solutions
+        source: cal_solutions
+      - id: refant
+        source: refant
+      - id: flag_baselines
+        source:
+          - flag_baselines
+      - id: process_baselines_target
+        source: process_baselines_target
+      - id: filter_baselines
+        source: filter_baselines
+      - id: do_smooth
+        source: do_smooth
+      - id: rfistrategy
+        source: rfistrategy
+      - id: min_unflagged_fraction
+        source: min_unflagged_fraction
+      - id: compression_bitrate
+        source: compression_bitrate
+      - id: raw_data
+        source: raw_data
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: apply_tec
+        source: apply_tec
+      - id: apply_clock
+        source: apply_clock
+      - id: apply_phase
+        source: apply_phase
+      - id: apply_RM
+        source: apply_RM
+      - id: apply_beam
+        source: apply_beam
+      - id: demix_sources
+        source:
+          - demix_sources
+      - id: demix_target
+        source: demix_target
+      - id: demix_freqstep
+        source: demix_freqstep
+      - id: demix_timestep
+        source: demix_timestep
+      - id: demix
+        source: demix
+      - id: clipATeam
+        source: clipATeam
+      - id: updateweights
+        source: updateweights
+      - id: max_dppp_threads
+        source: max_dppp_threads
+      - id: memoryperc
+        source: memoryperc
+      - id: min_length
+        source: min_length
+      - id: overhead
+        source: overhead
+      - id: min_separation
+        source: min_separation
+      - id: A-Team_skymodel
+        source: A-Team_skymodel
+      - id: target_skymodel
+        source: target_skymodel
+      - id: use_target
+        source: use_target
+      - id: skymodel_source
+        source: skymodel_source
+      - id: avg_timeresolution
+        source: avg_timeresolution
+      - id: avg_freqresolution
+        source: avg_freqresolution
+      - id: avg_timeresolution_concat
+        source: avg_timeresolution_concat
+      - id: avg_freqresolution_concat
+        source: avg_freqresolution_concat
+      - id: num_SBs_per_group
+        source: num_SBs_per_group
+      - id: reference_stationSB
+        source: reference_stationSB
+      - id: ionex_server
+        source: ionex_server
+      - id: ionex_prefix
+        source: ionex_prefix
+      - id: proxy_server
+        source: proxy_server
+      - id: proxy_port
+        source: proxy_port
+      - id: proxy_type
+        source: proxy_type
+      - id: proxy_user
+        source: proxy_user
+      - id: proxy_pass
+        source: proxy_pass
+    out:
+      - id: logfiles
+      - id: msout
+      - id: solutions
+      - id: inspection
+    run: ./prefactor_target.cwl
+    label: prefactor_target
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: save_logfiles
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - prefactor/logfiles
+      - id: sub_directory_name
+        default: logs
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_logfiles
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: save_inspection
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - prefactor/inspection
+      - id: sub_directory_name
+        default: inspection
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_inspection
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: save_solutions
+    in:
+      - id: log_files
+        source:
+          - prefactor/solutions
+      - id: sub_directory_name
+        default: cal_values
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_solutions
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: save_results
+    in:
+      - id: log_files
+        linkMerge: merge_flattened
+        source:
+          - save_solutions/log_dir
+          - save_inspection/log_dir
+          - save_logfiles/log_dir
+          - prefactor/msout
+      - id: sub_directory_name
+        default: results
+    out:
+      - id: log_dir
+    run: ./../steps/collectlog.cwl
+    label: save_results
+    'sbg:x': 1200
+    'sbg:y': 0
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/dowload_surl_and_create_input_file-json.cwl b/workflows/dowload_surl_and_create_input_file-json.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..328385f3b8dc90e93f9bdf58a94950ec09671fc4
--- /dev/null
+++ b/workflows/dowload_surl_and_create_input_file-json.cwl
@@ -0,0 +1,71 @@
+class: Workflow
+cwlVersion: v1.0
+id: dowload_surl_and_create_input_file_json
+label: dowload_surl_and_create_input_file.json
+
+inputs:
+  - id: surl_list
+    type: File
+outputs:
+  - id: results
+    outputSource:
+      - _h_b_a_calibrator/results
+    type: Directory
+  - id: logs
+    outputSource:
+      - _h_b_a_calibrator/logs
+    type: Directory
+steps:
+  - id: read_surl_list
+    in:
+      - id: surl_list
+        source: surl_list
+    out:
+      - id: surls
+    run: ../steps/read_surl_list.cwl
+    label: ReadSurlList
+  - id: surl_copy
+    in:
+      - id: surl
+        source: stage/output
+    out:
+      - id: output
+    run: ../steps/surl_copy.cwl
+    label: surl_copy
+    scatter:
+      - surl
+  - id: untar
+    in:
+      - id: tar_file
+        source: surl_copy/output
+    out:
+      - id: uncompressed
+    run: ../steps/untar.cwl
+    label: untar
+    scatter:
+      - tar_file
+  - id: stage
+    in:
+      - id: input
+        source: read_surl_list/surls
+    out:
+      - id: output
+    run: ../steps/stage.cwl
+    label: stage
+    scatter:
+      - input
+  - id: _h_b_a_calibrator
+    in:
+      - id: msin
+        source:
+          - untar/uncompressed
+    out:
+      - id: logs
+      - id: results
+    run: ./HBA_calibrator.cwl
+    label: HBA_calibrator
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: InlineJavascriptRequirement
+  - class: StepInputExpressionRequirement
diff --git a/workflows/prefactor_calibrator.cwl b/workflows/prefactor_calibrator.cwl
index 5eeb2026640386bb2ccc842f6d67a26a69ede115..00fa893a16f765d2c33e4865c8c18d28711deb58 100644
--- a/workflows/prefactor_calibrator.cwl
+++ b/workflows/prefactor_calibrator.cwl
@@ -5,211 +5,498 @@ label: prefactor_calibrator
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 inputs:
-  - id: raw_data
-    type: boolean
-    'sbg:x': -634
-    'sbg:y': -688
-  - id: demix
-    type: boolean
-    'sbg:x': -639.3313598632812
-    'sbg:y': -271
   - id: msin
     type: 'Directory[]'
-    'sbg:x': -635
-    'sbg:y': -543
-  - id: skymodels
-    type: Directory
-    'sbg:x': -123
-    'sbg:y': -850
-  - id: memoryperc
-    type: int
-    default: 20
-    'sbg:x': -634
-    'sbg:y': -411
-  - id: baselines_to_flag
-    type: 'string[]'
+    'sbg:x': -1000
+    'sbg:y': -1900
+  - id: refant
+    type: string?
+    default: 'CS00.*'
+    'sbg:x': -1000
+    'sbg:y': -1800
+  - id: flag_baselines
+    type: 'string[]?'
     default: []
-    'sbg:x': -635.8651123046875
-    'sbg:y': -148
-  - id: uvw
-    type: File?
-    'sbg:x': -356.9723205566406
-    'sbg:y': -804.0709838867188
-  - id: strategy
-    type: File?
-    'sbg:x': -352
-    'sbg:y': -713
-  - id: propagate_solutions
-    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -1700
+  - id: process_baselines_cal
+    type: string?
+    default: '*&'
+    'sbg:x': -1000
+    'sbg:y': -1600
+  - id: filter_baselines
+    type: string?
+    default: '*&'
+    'sbg:x': -1000
+    'sbg:y': -1500
+  - id: fit_offset_PA
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1400
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1300
+  - id: rfistrategy
+    type: string?
+    default: HBAdefault.rfis
+    'sbg:x': -1000
+    'sbg:y': -1200
+  - id: max2interpolate
+    type: int?
+    default: 30
+    'sbg:x': -1000
+    'sbg:y': -1100
+  - id: ampRange
+    type: 'float[]?'
+    default:
+      - 0
+      - 0
+    'sbg:x': -1000
+    'sbg:y': -1000
+  - id: skip_international
+    type: boolean?
     default: true
-    'sbg:x': -112
-    'sbg:y': -737
-  - id: flagunconverged
-    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -900
+  - id: raw_data
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -800
+  - id: propagatesolutions
+    type: boolean?
     default: true
-    'sbg:x': -92
+    'sbg:x': -1000
+    'sbg:y': -700
+  - id: flagunconverged
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -600
+  - id: maxStddev
+    type: float?
+    default: -1
+    'sbg:x': -1000
+    'sbg:y': -500
+  - id: solutions2transfer
+    type: File?
+    'sbg:x': -1000
     'sbg:y': -400
-  - id: do_smooth
-    type: boolean
+  - id: antennas2transfer
+    type: string?
+    default: '[FUSPID].*'
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: do_transfer
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: trusted_sources
+    type: string
+    default: '3C48,3C147,3C196,3C295'
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: demix_sources
+    type: 'string[]?'
+    default:
+      - CasA
+      - CygA
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: demix_target
+    type: string?
+    default: ''
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: demix_freqstep
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: demix_timestep
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: demix
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: ion_3rd
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: clock_smooth
+    type: boolean?
     default: true
-    'sbg:x': -89
-    'sbg:y': -276
-  - id: min_separation
-    type: int
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: tables2export
+    type: string?
+    default: clock
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: final_apply
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 800
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 900
+  - id: memoryperc
+    type: int?
     default: 20
-    'sbg:x': -638.4987182617188
-    'sbg:y': 31.238996505737305
-  - id: A-Team_sky_model
-    type: string
-    'sbg:x': -889.9927978515625
-    'sbg:y': -845.9927978515625
+    'sbg:x': -1000
+    'sbg:y': 1000
+  - id: min_length
+    type: int?
+    default: 50
+    'sbg:x': -1000
+    'sbg:y': 1100
+  - id: overhead
+    type: float?
+    default: 0.8
+    'sbg:x': -1000
+    'sbg:y': 1200
+  - id: min_separation
+    type: int?
+    default: 30
+    'sbg:x': -1000
+    'sbg:y': 1300
+  - id: max_separation_arcmin
+    type: float?
+    default: 1
+    'sbg:x': -1000
+    'sbg:y': 1400
+  - id: calibrator_path_skymodel
+    type: Directory?
+    'sbg:x': -1000
+    'sbg:y': 1500
+  - id: A-Team_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 1600
+  - id: avg_timeresolution
+    type: float?
+    default: 4
+    'sbg:x': -1000
+    'sbg:y': 1700
+  - id: avg_freqresolution
+    type: string?
+    default: 48.82kHz
+    'sbg:x': -1000
+    'sbg:y': 1800
+  - id: bandpass_freqresolution
+    type: string?
+    default: 195.3125kHz
+    'sbg:x': -1000
+    'sbg:y': 1900
 outputs:
-  - id: outh5parm
+  - id: inspection
+    linkMerge: merge_flattened
     outputSource:
-      - h5parm_collector/outh5parm
-    type: File
-    'sbg:x': 477
-    'sbg:y': -546.076171875
-  - id: log
+      - prep/check_Ateam_separation.png 
+      - pa/inspection
+      - fr/inspection
+      - bp/inspection
+      - ion/inspection
+    type: File[]
+    'sbg:x': 2000
+    'sbg:y': -600
+  - id: solutions
     outputSource:
-      - h5parm_collector/log
+      - ion/outsolutions
     type: File
-    'sbg:x': 481.1239318847656
-    'sbg:y': -368.0228576660156
-  - id: output_imag
+    'sbg:x': 2000
+    'sbg:y': -500
+  - id: msout
     outputSource:
-      - check_ateam_separation/output_imag
-    type: File?
-    'sbg:x': 486.94464111328125
-    'sbg:y': -5.156437873840332
-  - id: logfile
+      - bp/msout
+    type: 'Directory[]'
+    'sbg:x': 2000
+    'sbg:y': 0
+  - id: parset
     outputSource:
-      - check_ateam_separation/logfile
-    type: File?
-    'sbg:x': 492.1335754394531
-    'sbg:y': 133
-  - id: log_1
+      - ion/parsets
+    type: 'File[]'
+    'sbg:x': 2000
+    'sbg:y': 200
+  - id: logfiles
     outputSource:
-      - make_sourcedb/log
-    type: File?
-    'sbg:x': 495.6245422363281
-    'sbg:y': -1257.4857177734375
+      - prep/logfiles
+      - concat_logfiles_RefAnt/output
+      - pa/logfiles
+      - fr/logfiles
+      - bp/logfiles
+      - ion/logfiles
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 2000
+    'sbg:y': 600
 steps:
-  - id: ndppp_prep_cal
+  - id: prep
     in:
-      - id: baselines_to_flag
-        default: []
+      - id: msin
         source:
-          - baselines_to_flag
-      - id: elevation_to_flag
-        default: 0deg..20deg
-      - id: min_amplitude_to_flag
-        default: 1.e-30
-      - id: memoryperc
-        default: 20
-        source: memoryperc
+          - msin
+      - id: filter_baselines
+        source: filter_baselines
       - id: raw_data
         source: raw_data
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: flagunconverged
+        source: flagunconverged
       - id: demix
         source: demix
-      - id: msin
-        linkMerge: merge_flattened
+      - id: max_dppp_threads
+        source: max_dppp_threads
+      - id: memoryperc
+        source: memoryperc
+      - id: flag_baselines
         source:
-          - msin
-      - id: skymodel
-        source: make_sourcedb/sourcedb
-      - id: timeresolution
-        default: 1
-      - id: freqresolution
-        default: 1
+          - flag_baselines
+      - id: avg_timeresolution
+        source: avg_timeresolution
+      - id: avg_freqresolution
+        source: avg_freqresolution
+      - id: process_baselines_cal
+        source: process_baselines_cal
+      - id: demix_timestep
+        source: demix_timestep
+      - id: demix_freqstep
+        source: demix_freqstep
+      - id: demix_target
+        source: demix_target
+      - id: demix_sources
+        source:
+          - demix_sources
+      - id: min_length
+        source: min_length
+      - id: overhead
+        source: overhead
+      - id: min_separation
+        source: min_separation
+      - id: do_smooth
+        source: do_smooth
+      - id: max_separation_arcmin
+        source: max_separation_arcmin
+      - id: A-Team_skymodel
+        source: A-Team_skymodel
+      - id: calibrator_path_skymodel
+        source: calibrator_path_skymodel
     out:
+      - id: outh5parm
+      - id: logfiles
+      - id: outh5parm_logfile
+      - id: check_Ateam_separation.png
       - id: msout
-    run: ../subworkflow/ndppp_prep_cal.cwl
-    label: ndppp_prep_cal
+      - id: parset
+      - id: calibrator_name
+    run: ./prefactor_calibrator/prep.cwl
+    label: prep
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: findRefAnt
+    in:
+      - id: msin
+        source: prep/msout
+    out:
+      - id: flagged_fraction_dict
+      - id: logfile
+    run: ./../steps/findRefAnt.cwl
+    label: findRefAnt
     scatter:
       - msin
-    'sbg:x': -359
-    'sbg:y': -519
-  - id: aoflagger
+    'sbg:x': 300
+    'sbg:y': 0
+  - id: findRefAnt_join
     in:
-      - id: msin
+      - id: flagged_fraction_dict
+        source: findRefAnt/flagged_fraction_dict
+      - id: filter_station
+        source: refant
+    out:
+      - id: refant
+      - id: logfile
+    run: ./../steps/findRefAnt_join.cwl
+    label: findRefAnt_join
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_RefAnt
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
         source:
-          - ndppp_prep_cal/msout
-      - id: strategy
-        source: strategy
-      - id: uvw
-        source: uvw
+          - findRefAnt/logfile
+          - findRefAnt_join/logfile
+      - id: file_prefix
+        default: findRefAnt
     out:
-      - id: output_ms
-    run: ../lofar-cwl/steps/AOFlagger.cwl
-    label: AOFlagger
-    scatterMethod: flat_crossproduct
-    'sbg:x': -164
-    'sbg:y': -565
-  - id: calib_cal
+      - id: output
+    run: ./../steps/concatenate_files.cwl
+    label: concat_logfiles_RefAnt
+    'sbg:x': 700
+    'sbg:y': 300
+
+  - id: pa
     in:
       - id: msin
-        source: aoflagger/output_ms
-      - id: skymodels
-        source: skymodels
+        source:
+          - prep/msout
+      - id: h5parm
+        source:
+          - prep/outh5parm
+      - id: refant
+        source: findRefAnt_join/refant
+      - id: inh5parm_logfile
+        source:
+          - prep/outh5parm_logfile
       - id: flagunconverged
         source: flagunconverged
-      - id: propagate_solutions
-        source: propagate_solutions
+      - id: propagatesolutions
+        source: propagatesolutions
       - id: do_smooth
         source: do_smooth
+      - id: fit_offset_PA
+        source: fit_offset_PA
     out:
-      - id: h5parm
       - id: msout
-    run: ../subworkflow/calib_cal.cwl
-    label: calib_cal
-    scatter:
-      - msin
-    'sbg:x': 47
-    'sbg:y': -583
-  - id: h5parm_collector
+      - id: outsolutions
+      - id: inspection
+      - id: logfiles
+      - id: outh5parm
+      - id: outh5parm_logfile
+    run: ./prefactor_calibrator/pa.cwl
+    label: PA
+    'sbg:x': 700
+    'sbg:y': 0
+  - id: fr
     in:
-      - id: h5parmFiles
+      - id: msin
+        source:
+          - pa/msout
+      - id: h5parm
         source:
-          - calib_cal/h5parm
-      - id: squeeze
-        default: true
-      - id: verbose
-        default: true
-      - id: clobber
-        default: true
+          - pa/outh5parm
+      - id: refant
+        source: findRefAnt_join/refant
+      - id: inh5parm_logfile
+        source:
+          - pa/outh5parm_logfile
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: do_smooth
+        source: do_smooth
+      - id: insolutions
+        source: pa/outsolutions
     out:
+      - id: msout
+      - id: outsolutions
+      - id: inspection
+      - id: logfiles
       - id: outh5parm
-      - id: log
-    run: ../lofar-cwl/steps/H5ParmCollector.cwl
-    label: H5parm_collector
-    'sbg:x': 292.1979675292969
-    'sbg:y': -543.7208251953125
-  - id: check_ateam_separation
+      - id: outh5parm_logfile
+    run: ./prefactor_calibrator/fr.cwl
+    label: FR
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: bp
     in:
-      - id: ms
+      - id: msin
         source:
-          - msin
-      - id: min_separation
-        source: min_separation
+          - fr/msout
+      - id: h5parm
+        source:
+          - fr/outh5parm
+      - id: refant
+        source: findRefAnt_join/refant
+      - id: inh5parm_logfile
+        source:
+          - fr/outh5parm_logfile
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: ampRange
+        source: ampRange
+      - id: skipInternational
+        source: skip_international
+      - id: max2interpolate
+        source: max2interpolate
+      - id: bandpass_freqresolution
+        source: bandpass_freqresolution
+      - id: avg_freqresolution
+        source: avg_freqresolution
+      - id: do_smooth
+        source: do_smooth
+      - id: insolutions
+        source: fr/outsolutions
+      - id: solutions2transfer
+        source: solutions2transfer
+      - id: antennas2transfer
+        source: antennas2transfer
+      - id: do_transfer
+        source: do_transfer
+      - id: trusted_sources
+        source: trusted_sources
+      - id: max_separation_arcmin
+        source: max_separation_arcmin
+      - id: calibrator_name
+        source: prep/calibrator_name
     out:
-      - id: output_imag
-      - id: logfile
-    run: ../lofar-cwl/steps/check_ateam_separation.cwl
-    label: check_Ateam_separation
-    'sbg:x': -331.452392578125
-    'sbg:y': 23.596216201782227
-  - id: make_sourcedb
+      - id: msout
+      - id: outsolutions
+      - id: inspection
+      - id: logfiles
+      - id: outh5parm
+      - id: outh5parm_logfile
+    run: ./prefactor_calibrator/bp.cwl
+    label: BP
+    'sbg:x': 1300
+    'sbg:y': 0
+  - id: ion
     in:
-      - id: sky_model
-        source: A-Team_sky_model
+      - id: h5parm
+        source:
+          - bp/outh5parm
+      - id: refant
+        source: findRefAnt_join/refant
+      - id: inh5parm_logfile
+        source:
+          - bp/outh5parm_logfile
+      - id: insolutions
+        source: bp/outsolutions
+      - id: maxStddev
+        source: maxStddev
+      - id: ion_3rd
+        source: ion_3rd
+      - id: tables2export
+        source: tables2export
+      - id: clock_smooth
+        source: clock_smooth
+      - id: calibrator_name
+        source: prep/calibrator_name
     out:
-      - id: sourcedb
-      - id: log
-    run: ../lofar-cwl/steps/makesourcedb.cwl
-    label: make_sourcedb_ateam
-    'sbg:x': -628.7400512695312
-    'sbg:y': -847.117919921875
+      - id: outsolutions
+      - id: inspection
+      - id: logfiles
+      - id: parsets
+    run: ./prefactor_calibrator/ion.cwl
+    label: ion
+    'sbg:x': 1600
+    'sbg:y': 0
 requirements:
   - class: SubworkflowFeatureRequirement
-  - class: ScatterFeatureRequirement
+  - class: ScatterFeatureRequirement
\ No newline at end of file
diff --git a/workflows/prefactor_calibrator/bp.cwl b/workflows/prefactor_calibrator/bp.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e65eb63938c33a7f8c1e6762090cffdca896f7a9
--- /dev/null
+++ b/workflows/prefactor_calibrator/bp.cwl
@@ -0,0 +1,593 @@
+class: Workflow
+cwlVersion: v1.0
+id: bp
+label: BP
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: max_separation_arcmin
+    type: float
+    'sbg:x': -1000
+    'sbg:y': -800
+  - id: calibrator_name
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -700
+  - id: ampRange
+    type: 'float[]?'
+    'sbg:x': -1000
+    'sbg:y': -600
+  - id: skipInternational
+    type: boolean?
+    'sbg:x': -1000
+    'sbg:y': -500
+  - id: max2interpolate
+    type: int?
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: bandpass_freqresolution
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: avg_freqresolution
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: flagunconverged
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: solutions2transfer
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: inh5parm_logfile
+    type: File[]
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: insolutions
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: antennas2transfer
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: do_transfer
+    type: boolean?
+    'sbg:x': -1000
+    'sbg:y': 800
+  - id: trusted_sources
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': 900
+outputs:
+  - id: outh5parm
+    outputSource:
+      - h5parm_collector/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: msout
+    outputSource:
+      - apply_calibrate_bp/msout
+    type: 'Directory[]'
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: inspection
+    outputSource:
+      - losoto_plot_A1/output_plots
+      - losoto_plot_A2/output_plots
+      - losoto_plot_B1/output_plots
+      - losoto_plot_B2/output_plots
+      - losoto_plot_B3/output_plots
+      - transfer_solutions/plots
+    type: 'File[]?'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: outsolutions
+    outputSource:
+      - transfer_solutions/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_bp/output
+      - concat_logfiles_calib/output
+      - concat_logfiles_blsmooth/output
+      - concat_logfiles_apply/output
+      - concat_logfiles_apply_pa/output
+      - concat_logfiles_apply_fr/output
+      - concat_logfiles_beam/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: outh5parm_logfile
+    outputSource:
+      - h5parm_collector/log
+    type: File[]
+    'sbg:x': 1000
+    'sbg:y': 300
+steps:
+  - id: bandpass
+    in:
+      - id: ampRange
+        source: ampRange
+      - id: input_h5parm
+        source: h5parm
+      - id: skipInternational
+        source: skipInternational
+      - id: max2interpolate
+        source: max2interpolate
+      - id: bandpass_freqresolution
+        source: bandpass_freqresolution
+      - id: avg_freqresolution
+        source: avg_freqresolution
+    out:
+      - id: output_h5parm
+      - id: logfiles
+    run: ../../subworkflow/bandpass.cwl
+    label: bandpass
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: losoto_plot_A1
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/amplitudeOrig000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: ampBFlag_
+    out:
+      - id: output_plots
+      - id: logfile
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A1
+    'sbg:x': -200
+    'sbg:y': -200
+  - id: losoto_plot_A2
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/amplitudeOrig001
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: ampAFlag_
+    out:
+      - id: output_plots
+      - id: logfile
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A2
+    'sbg:x': -200
+    'sbg:y': -100
+  - id: losoto_plot_B1
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: bandpass_
+    out:
+      - id: output_plots
+      - id: logfile
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B1
+    'sbg:x': -200
+    'sbg:y': 0
+  - id: losoto_plot_B2
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisInCol
+        default: pol
+      - id: plotFlag
+        default: true
+      - id: time.minmaxstep
+        default:
+          - 0
+          - 1e20
+          - 500000
+      - id: prefix
+        default: bandpass_
+    out:
+      - id: output_plots
+      - id: logfile
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B2
+    'sbg:x': -200
+    'sbg:y': 100
+  - id: losoto_plot_B3
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - freq
+      - id: axisInCol
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: time.minmaxstep
+        default:
+          - 0
+          - 1e20
+          - 500000
+      - id: prefix
+        default: bandpass_
+    out:
+      - id: output_plots
+      - id: logfile
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B3
+    'sbg:x': -200
+    'sbg:y': 200
+  - id: losoto_plot_B1_trans
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: bandpass_transfer_
+    out:
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B1_trans
+    'sbg:x': -200
+    'sbg:y': 300
+  - id: losoto_plot_B2_trans
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisInCol
+        default: pol
+      - id: plotFlag
+        default: true
+      - id: time.minmaxstep
+        default:
+          - 0
+          - 1e20
+          - 500000
+      - id: prefix
+        default: bandpass_transfer_
+    out:
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B2_trans
+    'sbg:x': -200
+    'sbg:y': 400
+  - id: losoto_plot_B3_trans
+    in:
+      - id: input_h5parm
+        source: bandpass/output_h5parm
+      - id: soltab
+        default: sol000/bandpass
+      - id: axesInPlot
+        default:
+          - freq
+      - id: axisInCol
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: time.minmaxstep
+        default:
+          - 0
+          - 1e20
+          - 500000
+      - id: prefix
+        default: bbandpass_transfer_
+    out:
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_B3_trans
+    'sbg:x': -200
+    'sbg:y': 500
+  - id: concat_logfiles_bp
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - inh5parm_logfile
+          - bandpass/logfiles
+          - losoto_plot_A1/logfile
+          - losoto_plot_A2/logfile
+          - losoto_plot_B1/logfile
+          - losoto_plot_B2/logfile
+          - losoto_plot_B3/logfile
+          - write_solutions/log
+          - h5parm_pointingname/log
+          - transfer_solutions/log
+      - id: file_prefix
+        default: losoto_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_bp
+    'sbg:x': 500
+    'sbg:y': 500
+  - id: write_solutions
+    in:
+      - id: h5parmFile
+        source: bandpass/output_h5parm
+      - id: input_file
+        source: insolutions
+      - id: outsolset
+        default: calibrator
+      - id: insoltab
+        default: bandpass
+      - id: outh5parmname
+        default: cal_solutions.h5
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parmcat.cwl
+    label: write_solutions
+    'sbg:x': -200
+    'sbg:y': 700
+  - id: apply_calibrate_bp
+    in:
+      - id: msin
+        source: msin
+      - id: do_smooth
+        source: do_smooth
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: input_h5parm
+        source: transfer_solutions/outh5parm
+    out:
+      - id: msout
+      - id: BLsmooth.log
+      - id: apply_cal.log
+      - id: apply_pa.log
+      - id: apply_fr.log
+      - id: calib_cal.log
+      - id: applybeam.log
+      - id: outh5parm
+    run: ../../subworkflow/apply_calibrate_bp.cwl
+    label: apply_calibrate_bp
+    scatter:
+      - msin
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_blsmooth
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/BLsmooth.log
+      - id: file_prefix
+        default: blsmooth_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_blsmooth
+    'sbg:x': 750
+    'sbg:y': 300
+  - id: concat_logfiles_apply_pa
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/apply_pa.log
+      - id: file_prefix
+        default: apply_pa_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_apply_pa
+    'sbg:x': 750
+    'sbg:y': 400
+  - id: concat_logfiles_apply_fr
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/apply_fr.log
+      - id: file_prefix
+        default: apply_fr_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_apply_fr
+    'sbg:x': 750
+    'sbg:y': 500
+  - id: concat_logfiles_apply
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/apply_cal.log
+      - id: file_prefix
+        default: apply_cal_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_apply
+    'sbg:x': 750
+    'sbg:y': 600
+  - id: concat_logfiles_beam
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/applybeam.log
+      - id: file_prefix
+        default: applybeam_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_beam
+    'sbg:x': 750
+    'sbg:y': 700
+  - id: concat_logfiles_calib
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_bp/calib_cal.log
+      - id: file_prefix
+        default: calib_cal_bandpass
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_calib
+    'sbg:x': 750
+    'sbg:y': 800
+  - id: h5parm_collector
+    in:
+      - id: h5parmFiles
+        source:
+          - apply_calibrate_bp/outh5parm
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: clobber
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: H5parm_collector
+    'sbg:x': 750
+    'sbg:y': -300
+  - id: h5parm_pointingname
+    in:
+      - id: h5parmFile
+        source: write_solutions/outh5parm
+      - id: solsetName
+        default: calibrator
+      - id: pointing
+        source: calibrator_name
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parm_pointingname.cwl
+    label: h5parm_pointingname
+    'sbg:x': 0
+    'sbg:y': 300
+  - id: transfer_solutions
+    in:
+      - id: h5parm
+        source: h5parm_pointingname/outh5parm
+      - id: refh5parm
+        source: solutions2transfer
+      - id: insolset
+        default: calibrator
+      - id: outsolset
+        default: calibrator
+      - id: insoltab
+        default: bandpass
+      - id: outsoltab
+        default: bandpass
+      - id: antenna
+        source: antennas2transfer
+      - id: do_transfer
+        source: do_transfer
+      - id: trusted
+        source: trusted_sources
+      - id: max_separation_arcmin
+        source: max_separation_arcmin
+      - id: parset
+        source: concat_parset/output
+    out:
+      - id: outh5parm
+      - id: log
+      - id: plots
+    run: ../../steps/transfer_solutions.cwl
+    label: transfer_solutions
+    'sbg:x': 200
+    'sbg:y': 300
+  - id: concat_parset
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - losoto_plot_B1_trans/parset
+          - losoto_plot_B2_trans/parset
+          - losoto_plot_B3_trans/parset
+      - id: file_prefix
+        default: losoto
+      - id: file_suffix
+        default: parset
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_parset
+    'sbg:x': 0
+    'sbg:y': 500
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_calibrator/fr.cwl b/workflows/prefactor_calibrator/fr.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..dbb17414c51f0b76454133888aaf30a6fef212ef
--- /dev/null
+++ b/workflows/prefactor_calibrator/fr.cwl
@@ -0,0 +1,365 @@
+class: Workflow
+cwlVersion: v1.0
+id: fr
+label: FR
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: flagunconverged
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: refant
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: inh5parm_logfile
+    type: 'File[]'
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: insolutions
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 400
+outputs:
+  - id: outh5parm
+    outputSource:
+      - h5parm_collector/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: msout
+    outputSource:
+      - apply_calibrate_fr/msout
+    type: 'Directory[]'
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: inspection
+    outputSource:
+      - losoto_plot_P3/output_plots
+      - losoto_plot_Pd/output_plots
+      - losoto_plot_Rot3/output_plots
+      - losoto_plot_A3/output_plots
+      - losoto_plot_fr/output_plots
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: outsolutions
+    outputSource:
+      - write_solutions/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_fr/output
+      - concat_logfiles_calib/output
+      - concat_logfiles_blsmooth/output
+      - concat_logfiles_apply/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: outh5parm_logfile
+    outputSource:
+      - h5parm_collector/log
+    type: 'File[]'
+    'sbg:x': 1000
+    'sbg:y': 300
+steps:
+  - id: faraday_rot
+    in:
+      - id: refAnt
+        default: CS001HBA0
+        source: refant
+      - id: input_h5parm
+        source: h5parm
+    out:
+      - id: output_h5parm
+      - id: logfiles
+    run: ../../subworkflow/faraday_rotation.cwl
+    label: FaradayRot
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: losoto_plot_P3
+    in:
+      - id: input_h5parm
+        source: faraday_rot/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: fr_ph_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_P3
+    'sbg:x': 0
+    'sbg:y': -200
+  - id: losoto_plot_Pd
+    in:
+      - id: input_h5parm
+        source: faraday_rot/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: fr_ph_poldif
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pd
+    'sbg:x': 0
+    'sbg:y': -100
+  - id: losoto_plot_Rot3
+    in:
+      - id: input_h5parm
+        source: faraday_rot/output_h5parm
+      - id: soltab
+        default: sol000/rotation000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: fr_rotangle
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Rot3
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: losoto_plot_A3
+    in:
+      - id: input_h5parm
+        source: faraday_rot/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: fr_amp_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A3
+    'sbg:x': 0
+    'sbg:y': 100
+  - id: losoto_plot_fr
+    in:
+      - id: input_h5parm
+        source: faraday_rot/output_h5parm
+      - id: soltab
+        default: sol000/faraday
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: fr
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_fr
+    'sbg:x': 0
+    'sbg:y': 200
+  - id: concat_logfiles_fr
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - inh5parm_logfile
+          - faraday_rot/logfiles
+          - losoto_plot_P3/logfile
+          - losoto_plot_Pd/logfile
+          - losoto_plot_Rot3/logfile
+          - losoto_plot_A3/logfile
+          - losoto_plot_fr/logfile
+          - write_solutions/log
+      - id: file_prefix
+        default: losoto_FR
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_FR
+    'sbg:x': 500
+    'sbg:y': 500
+  - id: write_solutions
+    in:
+      - id: h5parmFile
+        source: faraday_rot/output_h5parm
+      - id: outsolset
+        default: calibrator
+      - id: insoltab
+        default: faraday
+      - id: input_file
+        source: insolutions
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parmcat.cwl
+    label: write_solutions
+    'sbg:x': 0
+    'sbg:y': 500
+  - id: apply_calibrate_fr
+    in:
+      - id: msin
+        source: msin
+      - id: do_smooth
+        source: do_smooth
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: input_h5parm
+        source: write_solutions/outh5parm
+    out:
+      - id: msout
+      - id: BLsmooth.log
+      - id: apply_cal.log
+      - id: calib_cal.log
+      - id: outh5parm
+    run: ../../subworkflow/apply_calibrate_fr.cwl
+    label: apply_calibrate_fr
+    scatter:
+      - msin
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_blsmooth
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_fr/BLsmooth.log
+      - id: file_prefix
+        default: blsmooth_FR
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_blsmooth
+    'sbg:x': 750
+    'sbg:y': 300
+  - id: concat_logfiles_apply
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_fr/apply_cal.log
+      - id: file_prefix
+        default: apply_cal_FR
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_apply
+    'sbg:x': 750
+    'sbg:y': 600
+  - id: concat_logfiles_calib
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_fr/calib_cal.log
+      - id: file_prefix
+        default: calib_cal_FR
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_calib
+    'sbg:x': 750
+    'sbg:y': 800
+  - id: h5parm_collector
+    in:
+      - id: h5parmFiles
+        source:
+          - apply_calibrate_fr/outh5parm
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: clobber
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: H5parm_collector
+    'sbg:x': 750
+    'sbg:y': -300
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_calibrator/ion.cwl b/workflows/prefactor_calibrator/ion.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..e567ef2eb019c79aa3c0d17635c91ba741a02490
--- /dev/null
+++ b/workflows/prefactor_calibrator/ion.cwl
@@ -0,0 +1,412 @@
+class: Workflow
+cwlVersion: v1.0
+id: ion
+label: ion
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: calibrator_name
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: clock_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: ion_3rd
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: refant
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: tables2export
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: inh5parm_logfile
+    type: 'File[]'
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: maxStddev
+    type: float
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: insolutions
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 600
+outputs:
+  - id: inspection
+    outputSource:
+      - losoto_plot_A1/output_plots
+      - losoto_plot_A2/output_plots
+      - losoto_plot_P3/output_plots
+      - losoto_plot_Pd/output_plots
+      - losoto_plot_tec/output_plots
+      - losoto_plot_tec3rd/output_plots
+      - losoto_plot_clock/output_plots
+      - losoto_plot_Pr/output_plots
+      - losoto_plot_Pr3/output_plots
+    type: 'File[]?'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: outsolutions
+    outputSource:
+      - h5parm_pointingname/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_ion/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: parsets
+    outputSource:
+      - clocktec/parset
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 300
+steps:
+  - id: clocktec
+    in:
+      - id: input_h5parm
+        source: h5parm
+      - id: maxStddev
+        source: maxStddev
+      - id: fit3rdorder
+        source: ion_3rd
+      - id: clock_smooth
+        source: clock_smooth
+    out:
+      - id: output_h5parm
+      - id: logfiles
+      - id: parset
+    run: ../../subworkflow/clocktec.cwl
+    label: clocktec
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: losoto_plot_A1
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/amplitudeOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: ion_ampBFlag_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A1
+    'sbg:x': 0
+    'sbg:y': -400
+  - id: losoto_plot_A2
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: ion_ampAFlag_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A2
+    'sbg:x': 0
+    'sbg:y': -300
+  - id: losoto_plot_P3
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ion_ph_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_P3
+    'sbg:x': 0
+    'sbg:y': -200
+  - id: losoto_plot_Pd
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ion_ph_poldif
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pd
+    'sbg:x': 0
+    'sbg:y': -100
+  - id: losoto_plot_tec
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/tec
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: false
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: tec
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_tec
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: losoto_plot_tec3rd
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: 'sol000/tec3rd'
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: false
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: tec3rd
+      - id: execute
+        source: ion_3rd
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_tec3rd
+    'sbg:x': 0
+    'sbg:y': 100
+  - id: losoto_plot_clock
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/clockOrig
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: false
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: clock
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_clock
+    'sbg:x': 0
+    'sbg:y': 200
+  - id: losoto_plot_Pr
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ion_ph-res_poldif
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pr
+    'sbg:x': 0
+    'sbg:y': 300
+  - id: losoto_plot_Pr3
+    in:
+      - id: input_h5parm
+        source: clocktec/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ion_ph-res_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pr3
+    'sbg:x': 0
+    'sbg:y': 400
+  - id: concat_logfiles_ion
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - inh5parm_logfile
+          - clocktec/logfiles
+          - losoto_plot_A1/logfile
+          - losoto_plot_A2/logfile
+          - losoto_plot_P3/logfile
+          - losoto_plot_Pd/logfile
+          - losoto_plot_tec/logfile
+          - losoto_plot_tec3rd/logfile
+          - losoto_plot_clock/logfile
+          - losoto_plot_Pr/logfile
+          - losoto_plot_Pr3/logfile
+          - write_solutions/log
+          - h5parm_pointingname/log
+      - id: file_prefix
+        default: losoto_ion
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_ion
+    'sbg:x': 500
+    'sbg:y': 500
+  - id: write_solutions
+    in:
+      - id: h5parmFile
+        source: clocktec/output_h5parm
+      - id: outsolset
+        default: calibrator
+      - id: insoltab
+        source: tables2export
+      - id: input_file
+        source: insolutions
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parmcat.cwl
+    label: write_solutions
+    'sbg:x': -200
+    'sbg:y': 700
+  - id: h5parm_pointingname
+    in:
+      - id: h5parmFile
+        source: write_solutions/outh5parm
+      - id: solsetName
+        default: calibrator
+      - id: pointing
+        source: calibrator_name
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parm_pointingname.cwl
+    label: h5parm_pointingname
+    'sbg:x': 0
+    'sbg:y': 700
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_calibrator/pa.cwl b/workflows/prefactor_calibrator/pa.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..fa1d3eabf48540a8a42147a76573a587eebee5b3
--- /dev/null
+++ b/workflows/prefactor_calibrator/pa.cwl
@@ -0,0 +1,461 @@
+class: Workflow
+cwlVersion: v1.0
+id: pa
+label: PA
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: flagunconverged
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: refant
+    type: string?
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: inh5parm_logfile
+    type: 'File[]'
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: fit_offset_PA
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 400
+outputs:
+  - id: outh5parm
+    outputSource:
+      - h5parm_collector/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -200
+  - id: msout
+    outputSource:
+      - apply_calibrate_pa/msout
+    type: 'Directory[]'
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: inspection
+    outputSource:
+      - losoto_plot_P3/output_plots
+      - losoto_plot_Pd/output_plots
+      - losoto_plot_Rot3/output_plots
+      - losoto_plot_A3/output_plots
+      - losoto_plot_Align/output_plots
+      - losoto_plot_Pr/output_plots
+      - losoto_plot_Pr2/output_plots
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: outsolutions
+    outputSource:
+      - write_solutions/outh5parm
+    type: File
+    'sbg:x': 1000
+    'sbg:y': 100
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_pa/output
+      - concat_logfiles_calib/output
+      - concat_logfiles_blsmooth/output
+      - concat_logfiles_beam/output
+      - concat_logfiles_apply/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: outh5parm_logfile
+    outputSource:
+      - h5parm_collector/log
+    type: 'File[]'
+    'sbg:x': 1000
+    'sbg:y': 300
+steps:
+  - id: pol_align
+    in:
+      - id: refAnt
+        default: CS001HBA0
+        source: refant
+      - id: input_h5parm
+        source: h5parm
+      - id: fit_offset_PA
+        source: fit_offset_PA
+    out:
+      - id: output_h5parm
+      - id: logfiles
+    run: ../../subworkflow/pol_align.cwl
+    label: PolAlign
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: losoto_plot_P3
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign_ph_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_P3
+    'sbg:x': 0
+    'sbg:y': -200
+  - id: losoto_plot_Pd
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/phaseOrig
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign_ph_poldif
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pd
+    'sbg:x': 0
+    'sbg:y': -100
+  - id: losoto_plot_Rot3
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/rotation000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign_rotangle
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Rot3
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: losoto_plot_A3
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/amplitude000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: plotFlag
+        default: true
+      - id: prefix
+        default: polalign_amp_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_A3
+    'sbg:x': 0
+    'sbg:y': 100
+  - id: losoto_plot_Align
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/polalign
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Align
+    'sbg:x': 0
+    'sbg:y': 200
+  - id: losoto_plot_Pr
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign_ph-res_poldif
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pr
+    'sbg:x': 0
+    'sbg:y': 300
+  - id: losoto_plot_Pr2
+    in:
+      - id: input_h5parm
+        source: pol_align/output_h5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisInCol
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: polalign_ph-res_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pr2
+    'sbg:x': 0
+    'sbg:y': 400
+  - id: concat_logfiles_pa
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - inh5parm_logfile
+          - pol_align/logfiles
+          - losoto_plot_P3/logfile
+          - losoto_plot_Pd/logfile
+          - losoto_plot_Rot3/logfile
+          - losoto_plot_A3/logfile
+          - losoto_plot_Align/logfile
+          - losoto_plot_Pr/logfile
+          - losoto_plot_Pr2/logfile
+          - write_solutions/log
+      - id: file_prefix
+        default: losoto_PA
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_PA
+    'sbg:x': 500
+    'sbg:y': 500
+  - id: write_solutions
+    in:
+      - id: h5parmFiles
+        source:
+          - pol_align/output_h5parm
+      - id: outsolset
+        default: calibrator
+      - id: insoltab
+        default: polalign
+      - id: outh5parmname
+        default: cal_solutions.h5
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: write_solutions
+    'sbg:x': 0
+    'sbg:y': 500
+  - id: apply_calibrate_pa
+    in:
+      - id: msin
+        source: msin
+      - id: do_smooth
+        source: do_smooth
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: input_h5parm
+        source: write_solutions/outh5parm
+    out:
+      - id: msout
+      - id: BLsmooth.log
+      - id: apply_cal.log
+      - id: calib_cal.log
+      - id: outh5parm
+      - id: applybeam.log
+    run: ../../subworkflow/apply_calibrate_pa.cwl
+    label: apply_calibrate_pa
+    scatter:
+      - msin
+    'sbg:x': 500
+    'sbg:y': 0
+  - id: concat_logfiles_blsmooth
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_pa/BLsmooth.log
+      - id: file_prefix
+        default: blsmooth_PA
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_blsmooth
+    'sbg:x': 750
+    'sbg:y': 300
+  - id: concat_logfiles_beam
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_pa/applybeam.log
+      - id: file_prefix
+        default: applybeam_PA
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_beam
+    'sbg:x': 750
+    'sbg:y': 400
+  - id: concat_logfiles_apply
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_pa/apply_cal.log
+      - id: file_prefix
+        default: apply_cal_PA
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_apply
+    'sbg:x': 750
+    'sbg:y': 600
+  - id: concat_logfiles_calib
+    in:
+      - id: file_list
+        source:
+          - apply_calibrate_pa/calib_cal.log
+      - id: file_prefix
+        default: calib_cal_PA
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_calib
+    'sbg:x': 750
+    'sbg:y': 800
+  - id: h5parm_collector
+    in:
+      - id: h5parmFiles
+        source:
+          - apply_calibrate_pa/outh5parm
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: clobber
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: H5parm_collector
+    'sbg:x': 750
+    'sbg:y': -300
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_calibrator/prep.cwl b/workflows/prefactor_calibrator/prep.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..dba3a8e3f7d667076b2613fd74cc2b0ebb2cbbfe
--- /dev/null
+++ b/workflows/prefactor_calibrator/prep.cwl
@@ -0,0 +1,395 @@
+class: Workflow
+cwlVersion: v1.0
+id: prep
+label: prep
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -515.1839599609375
+    'sbg:y': 330.674560546875
+  - id: filter_baselines
+    type: string
+    'sbg:x': 254.234375
+    'sbg:y': 684
+  - id: raw_data
+    type: boolean
+    'sbg:x': 0
+    'sbg:y': 563
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': 0
+    'sbg:y': 670
+  - id: flagunconverged
+    type: boolean
+    'sbg:x': 559.319091796875
+    'sbg:y': 837.5
+  - id: demix
+    type: boolean
+    'sbg:x': 254.234375
+    'sbg:y': 1326
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': 254.234375
+    'sbg:y': 214
+  - id: memoryperc
+    type: int
+    'sbg:x': 254.234375
+    'sbg:y': 107
+  - id: flag_baselines
+    type: 'string[]'
+    'sbg:x': 254.234375
+    'sbg:y': 442
+  - id: avg_timeresolution
+    type: float
+    'sbg:x': 254.234375
+    'sbg:y': 1554
+  - id: avg_freqresolution
+    type: string
+    'sbg:x': 254.234375
+    'sbg:y': 1661
+  - id: process_baselines_cal
+    type: string
+    'sbg:x': 0
+    'sbg:y': 777
+  - id: demix_timestep
+    type: int
+    'sbg:x': 254.234375
+    'sbg:y': 898
+  - id: demix_freqstep
+    type: int
+    'sbg:x': 254.234375
+    'sbg:y': 1219
+  - id: demix_target
+    type: string
+    'sbg:x': 254.234375
+    'sbg:y': 1005
+  - id: demix_sources
+    type: 'string[]'
+    'sbg:x': 254.234375
+    'sbg:y': 1112
+  - id: min_length
+    type: int?
+    'sbg:x': 360
+    'sbg:y': 1919.42626953125
+  - id: overhead
+    type: float?
+    'sbg:x': 180
+    'sbg:y': 1903.963134765625
+  - id: min_separation
+    type: int?
+    'sbg:x': 0
+    'sbg:y': 884
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': 559.319091796875
+    'sbg:y': 944.5
+  - id: max_separation_arcmin
+    type: float?
+    'sbg:x': 0
+    'sbg:y': 991
+  - id: calibrator_path_skymodel
+    type: Directory?
+    'sbg:x': 0
+    'sbg:y': 1098
+  - id: A-Team_skymodel
+    type: File?
+    'sbg:x': 0
+    'sbg:y': 1205
+  - id: elevation
+    type: string
+    default: 0deg..20deg
+    'sbg:x': 254.234375
+    'sbg:y': 791
+  - id: amplmin
+    type: float
+    default: 1.e-30
+    'sbg:x': 254.234375
+    'sbg:y': 1768
+outputs:
+  - id: outh5parm
+    outputSource:
+      - h5parm_collector/outh5parm
+    type: File
+    'sbg:x': 1554.5106201171875
+    'sbg:y': 884
+  - id: check_Ateam_separation.png
+    outputSource:
+      - check_ateam_separation/output_imag
+    type: File
+    'sbg:x': 559.319091796875
+    'sbg:y': 1051.5
+  - id: msout
+    outputSource:
+      - predict_calibrate/msout
+    type: 'Directory[]'
+    'sbg:x': 1329.937255859375
+    'sbg:y': 663
+  - id: parset
+    outputSource:
+      - ndppp_prep_cal/parset
+    type: 'File[]'
+    'sbg:x': 1027.490966796875
+    'sbg:y': 884
+  - id: calibrator_name
+    outputSource:
+      - find_skymodel_cal/model_name
+    type: string
+    'sbg:x': 559.319091796875
+    'sbg:y': 1158.5
+  - id: outh5parm_logfile
+    outputSource:
+      - h5parm_collector/log
+    type: 'File[]'
+    'sbg:x': 1554.5106201171875
+    'sbg:y': 777
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_calib/output
+      - concat_logfiles_predict/output
+      - concat_logfiles_blsmooth/output
+      - make_sourcedb/log
+      - find_skymodel_cal/logfile
+      - concat_logfiles_prep_cal/output
+      - make_sourcedb_ateam/log
+      - check_ateam_separation/logfile
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1554.5106201171875
+    'sbg:y': 991
+steps:
+  - id: select
+    in:
+      - id: input
+        source:
+          - msin
+    out:
+      - id: output
+    run: ../../steps/selectfirstdirectory.cwl
+    label: select_ony_first
+    'sbg:x': -303.7861022949219
+    'sbg:y': 542.37646484375
+  - id: ndppp_prep_cal
+    in:
+      - id: baselines_to_flag
+        default: []
+        source:
+          - flag_baselines
+      - id: elevation_to_flag
+        source: elevation
+      - id: min_amplitude_to_flag
+        source: amplmin
+      - id: memoryperc
+        default: 20
+        source: memoryperc
+      - id: raw_data
+        default: false
+        source: raw_data
+      - id: demix
+        default: false
+        source: demix
+      - id: msin
+        linkMerge: merge_flattened
+        source:
+          - msin
+      - id: msin_baseline
+        default: '*'
+        source: filter_baselines
+      - id: skymodel
+        source: make_sourcedb_ateam/sourcedb
+      - id: timeresolution
+        default: 1
+        source: avg_timeresolution
+      - id: freqresolution
+        default: 12.21kHz
+        source: avg_freqresolution
+      - id: demix_timestep
+        default: 1
+        source: demix_timestep
+      - id: demix_freqstep
+        default: 1
+        source: demix_freqstep
+      - id: demix_baseline
+        default: '*'
+        source: process_baselines_cal
+      - id: target_source
+        source: demix_target
+      - id: ntimechunk
+        default: 10
+        source: max_dppp_threads
+      - id: subtract_sources
+        source:
+          - demix_sources
+    out:
+      - id: msout
+      - id: logfile
+      - id: parset
+    run: ../../subworkflow/ndppp_prep_cal.cwl
+    label: ndppp_prep_cal
+    scatter:
+      - msin
+    'sbg:x': 559.319091796875
+    'sbg:y': 497.5
+  - id: predict_calibrate
+    in:
+      - id: msin
+        linkMerge: merge_flattened
+        source:
+          - ndppp_prep_cal/msout
+      - id: do_smooth
+        source: do_smooth
+      - id: sourcedb
+        source: make_sourcedb/sourcedb
+      - id: flagunconverged
+        source: flagunconverged
+      - id: propagatesolutions
+        source: propagatesolutions
+    out:
+      - id: msout
+      - id: BLsmooth.log
+      - id: predict_cal.log
+      - id: calib_cal.log
+      - id: outh5parm
+    run: ../../subworkflow/predict_calibrate.cwl
+    label: predict_calibrate
+    scatter:
+      - msin
+    'sbg:x': 1027.490966796875
+    'sbg:y': 749
+  - id: check_ateam_separation
+    in:
+      - id: ms
+        source:
+          - select/output
+      - id: min_separation
+        source: min_separation
+    out:
+      - id: output_imag
+      - id: logfile
+    run: ../../lofar-cwl/steps/check_ateam_separation.cwl
+    label: check_Ateam_separation
+    'sbg:x': 254.234375
+    'sbg:y': 1440
+  - id: make_sourcedb_ateam
+    in:
+      - id: sky_model
+        source: A-Team_skymodel
+      - id: logname
+        default: make_sourcedb_ateam.log
+    out:
+      - id: sourcedb
+      - id: log
+    run: ../../lofar-cwl/steps/makesourcedb.cwl
+    label: make_sourcedb_ateam
+    'sbg:x': 254.234375
+    'sbg:y': 328
+  - id: find_skymodel_cal
+    in:
+      - id: msin
+        source:
+          - select/output
+      - id: skymodels
+        source: calibrator_path_skymodel
+      - id: max_separation_arcmin
+        source: max_separation_arcmin
+    out:
+      - id: output_models
+      - id: model_name
+      - id: logfile
+    run: ../../steps/find_skymodel_cal.cwl
+    label: find_skymodel_cal
+    'sbg:x': 254.234375
+    'sbg:y': 563
+  - id: make_sourcedb
+    in:
+      - id: sky_model
+        source: find_skymodel_cal/output_models
+      - id: output_file_name
+        default: calibrator.sourcedb
+    out:
+      - id: sourcedb
+      - id: log
+    run: ../../lofar-cwl/steps/makesourcedb.cwl
+    label: make_sourcedb
+    'sbg:x': 559.319091796875
+    'sbg:y': 723.5
+  - id: concat_logfiles_prep_cal
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - ndppp_prep_cal/logfile
+      - id: file_prefix
+        default: ndppp_prep_cal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_prep_cal
+    'sbg:x': 1027.490966796875
+    'sbg:y': 991
+  - id: concat_logfiles_blsmooth
+    in:
+      - id: file_list
+        source:
+          - predict_calibrate/BLsmooth.log
+      - id: file_prefix
+        default: blsmooth_prep
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_blsmooth
+    'sbg:x': 1329.937255859375
+    'sbg:y': 1105
+  - id: concat_logfiles_predict
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - predict_calibrate/predict_cal.log
+      - id: file_prefix
+        default: predict_cal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_predict
+    'sbg:x': 1329.937255859375
+    'sbg:y': 891
+  - id: concat_logfiles_calib
+    in:
+      - id: file_list
+        source:
+          - predict_calibrate/calib_cal.log
+      - id: file_prefix
+        default: calib_cal_prep
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_calib
+    'sbg:x': 1329.937255859375
+    'sbg:y': 998
+  - id: h5parm_collector
+    in:
+      - id: h5parmFiles
+        source:
+          - predict_calibrate/outh5parm
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: clobber
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: H5parm_collector
+    'sbg:x': 1329.937255859375
+    'sbg:y': 777
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: InlineJavascriptRequirement
+  - class: StepInputExpressionRequirement
diff --git a/workflows/prefactor_calibrator_test.cwl b/workflows/prefactor_calibrator_test.cwl
deleted file mode 100644
index aa2db155ed3737bf1ca408c3a0b8e1810058b5c7..0000000000000000000000000000000000000000
--- a/workflows/prefactor_calibrator_test.cwl
+++ /dev/null
@@ -1,149 +0,0 @@
-class: Workflow
-cwlVersion: v1.0
-id: prefactor_calibrator
-label: prefactor_calibrator
-$namespaces:
-  sbg: 'https://www.sevenbridges.com/'
-inputs:
-  - id: raw_data
-    type: boolean
-    'sbg:x': -634
-    'sbg:y': -688
-  - id: demix
-    type: boolean
-    'sbg:x': -639
-    'sbg:y': -206.68032836914062
-  - id: msin
-    type: 'Directory[]'
-    'sbg:x': -635
-    'sbg:y': -543
-  - id: memoryperc
-    type: int
-    'sbg:x': -634
-    'sbg:y': -411
-  - id: baselines_to_flag
-    type: 'string[]'
-    'sbg:x': -635
-    'sbg:y': -100.83224487304688
-  - id: min_separation
-    type: float?
-    'sbg:x': -638.4987182617188
-    'sbg:y': 31.238996505737305
-  - id: A-Team_sky_model
-    default: /data/skymodels/Ateam_LBA_CC.skymodel
-    type:
-      - string?
-      - File?
-    'sbg:x': -889
-    'sbg:y': -983.5078735351562
-  - id: timeresolution
-    type: float
-    'sbg:x': -634.4667358398438
-    'sbg:y': -817.0217895507812
-  - id: freqresolution
-    type: string
-    'sbg:x': -641.6406860351562
-    'sbg:y': -298.1281433105469
-outputs:
-  - id: check_Ateam_separation.png
-    outputSource:
-      - check_ateam_separation/output_imag
-    type: 'File[]?'
-    'sbg:x': 68.06497955322266
-    'sbg:y': -3.1985559463500977
-  - id: check_Ateam_separation.log
-    outputSource:
-      - check_ateam_separation/logfile
-    type: 'File[]?'
-    'sbg:x': 83.07220458984375
-    'sbg:y': 136.60289001464844
-  - id: make_sourcedb_ateam.log
-    outputSource:
-      - make_sourcedb/log
-    type: File?
-    'sbg:x': 71.66065216064453
-    'sbg:y': -880.4981689453125
-  - id: msout
-    outputSource:
-      - ndppp_prep_cal/msout
-    type: 'Directory[]'
-    'sbg:x': 52.33274459838867
-    'sbg:y': -546.0951538085938
-  - id: logfile_prep_cal
-    outputSource:
-      - ndppp_prep_cal/logfile
-    type: 'File[]?'
-    'sbg:x': 43.325523376464844
-    'sbg:y': -371.35504150390625
-  - id: parset
-    outputSource:
-      - ndppp_prep_cal/parset
-    type: 'File[]'
-    'sbg:x': 49.54720687866211
-    'sbg:y': -680.8679809570312
-steps:
-  - id: ndppp_prep_cal
-    in:
-      - id: baselines_to_flag
-        default: []
-        source:
-          - baselines_to_flag
-      - id: elevation_to_flag
-        default: 0deg..20deg
-      - id: min_amplitude_to_flag
-        default: 1.e-30
-      - id: memoryperc
-        default: 20
-        source: memoryperc
-      - id: raw_data
-        source: raw_data
-      - id: demix
-        source: demix
-      - id: msin
-        linkMerge: merge_flattened
-        source:
-          - msin
-      - id: skymodel
-        source: make_sourcedb/sourcedb
-      - id: timeresolution
-        source: timeresolution
-      - id: freqresolution
-        source: freqresolution
-    out:
-      - id: msout
-      - id: logfile
-      - id: parset
-    run: ../subworkflow/ndppp_prep_cal.cwl
-    label: ndppp_prep_cal
-    scatter:
-      - msin
-    'sbg:x': -359
-    'sbg:y': -519
-  - id: check_ateam_separation
-    in:
-      - id: ms
-        source:
-          - msin
-      - id: min_separation
-        source: min_separation
-    out:
-      - id: output_imag
-      - id: logfile
-    run: ../lofar-cwl/steps/check_ateam_separation.cwl
-    label: check_Ateam_separation
-    'sbg:x': -331.452392578125
-    'sbg:y': 23.596216201782227
-  - id: make_sourcedb
-    in:
-      - id: sky_model
-        source: A-Team_sky_model
-    out:
-      - id: sourcedb
-      - id: log
-    run: ../lofar-cwl/steps/makesourcedb.cwl
-    label: make_sourcedb_ateam
-    'sbg:x': -647.0108642578125
-    'sbg:y': -981.3153076171875
-requirements:
-  - class: SubworkflowFeatureRequirement
-  - class: ScatterFeatureRequirement
diff --git a/workflows/prefactor_target.cwl b/workflows/prefactor_target.cwl
index 7986942f49eb71cf1f3161c65ee7bd01d75f49f0..6e624e973e2d8592d95c548fe578a90a6908f950 100644
--- a/workflows/prefactor_target.cwl
+++ b/workflows/prefactor_target.cwl
@@ -5,17 +5,463 @@ label: prefactor_target
 $namespaces:
   sbg: 'https://www.sevenbridges.com/'
 inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -1700
   - id: cal_solutions
     type: File
-    'sbg:x': -327
-    'sbg:y': -42
+    'sbg:x': -1000
+    'sbg:y': -1600
+  - id: refant
+    type: string?
+    default: CS00.*
+    'sbg:x': -1000
+    'sbg:y': -1500
+  - id: flag_baselines
+    type: 'string[]?'
+    default: []
+    'sbg:x': -1000
+    'sbg:y': -1400
+  - id: process_baselines_target
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1300
+  - id: filter_baselines
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1200
+  - id: do_smooth
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1100
+  - id: rfistrategy
+    type: string?
+    default: HBAdefault.rfis
+    'sbg:x': -1000
+    'sbg:y': -1000
+  - id: min_unflagged_fraction
+    type: float?
+    default: 0.5
+    'sbg:x': -1000
+    'sbg:y': -900
+  - id: compression_bitrate
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': -800
+  - id: raw_data
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -700
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -600
+  - id: demix_sources
+    type: 'string[]?'
+    default:
+      - CasA
+      - CygA
+    'sbg:x': -1000
+    'sbg:y': -500
+  - id: demix_target
+    type: string?
+    default: ''
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: demix_freqstep
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: demix_timestep
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: demix
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: apply_tec
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: apply_clock
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: apply_phase
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: apply_RM
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: apply_beam
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: clipATeam
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: gsmcal_step
+    type: string?
+    default: phase
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: updateweights
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 800
+  - id: memoryperc
+    type: int?
+    default: 20
+    'sbg:x': -1000
+    'sbg:y': 900
+  - id: min_length
+    type: int?
+    default: 5
+    'sbg:x': -1000
+    'sbg:y': 1000
+  - id: overhead
+    type: float?
+    default: 0.7
+    'sbg:x': -1000
+    'sbg:y': 1100
+  - id: min_separation
+    type: int?
+    default: 30
+    'sbg:x': -1000
+    'sbg:y': 1200
+  - id: A-Team_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 1300
+  - id: target_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 1400
+  - id: use_target
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 1500
+  - id: skymodel_source
+    type: string?
+    default: TGSS
+    'sbg:x': -1000
+    'sbg:y': 1600
+  - id: avg_timeresolution
+    type: float?
+    default: 4
+    'sbg:x': -1000
+    'sbg:y': 1700
+  - id: avg_freqresolution
+    type: string?
+    default: 48.82kHz
+    'sbg:x': -1000
+    'sbg:y': 1800
+  - id: avg_timeresolution_concat
+    type: int?
+    default: 8
+    'sbg:x': -1000
+    'sbg:y': 1900
+  - id: avg_freqresolution_concat
+    type: string?
+    default: 97.64kHz
+    'sbg:x': -1000
+    'sbg:y': 2000
+  - id: num_SBs_per_group
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 2100
+  - id: reference_stationSB
+    type: int?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2200
+  - id: ionex_server
+    type: string?
+    default: 'ftp://ftp.aiub.unibe.ch/CODE/'
+    'sbg:x': -1000
+    'sbg:y': 2300
+  - id: ionex_prefix
+    type: string?
+    default: CODG
+    'sbg:x': -1000
+    'sbg:y': 2400
+  - id: proxy_server
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2500
+  - id: proxy_port
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2600
+  - id: proxy_type
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2700
+  - id: proxy_user
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2800
+  - id: proxy_pass
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 2900
 outputs:
+  - id: inspection
+    outputSource:
+      - prep/inspection
+      - gsmcal/inspection
+      - finalize/inspection
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 2000
+    'sbg:y': -600
   - id: solutions
     outputSource:
-      - cal_solutions
+      - finalize/solutions
     type: File
-    'sbg:x': -58
-    'sbg:y': -43
-    source: input.cal_solutions
-steps: []
-requirements: []
+    'sbg:x': 2000
+    'sbg:y': -500
+  - id: msout
+    outputSource:
+      - finalize/msout
+    type: 'Directory[]'
+    'sbg:x': 2000
+    'sbg:y': 0
+  - id: logfiles
+    outputSource:
+      - prep/logfiles
+      - concat_logfiles_RefAnt/output
+      - gsmcal/logfiles
+      - finalize/logfiles
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 2000
+    'sbg:y': 600
+steps:
+  - id: prep
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: cal_solutions
+        source: cal_solutions
+      - id: flag_baselines
+        source:
+          - flag_baselines
+      - id: process_baselines_target
+        source: process_baselines_target
+      - id: filter_baselines
+        source: filter_baselines
+      - id: raw_data
+        source: raw_data
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: demix_sources
+        source:
+          - demix_sources
+      - id: demix_target
+        source: demix_target
+      - id: demix_freqstep
+        source: demix_freqstep
+      - id: demix_timestep
+        source: demix_timestep
+      - id: demix
+        source: demix
+      - id: apply_tec
+        source: apply_tec
+      - id: apply_clock
+        source: apply_clock
+      - id: apply_phase
+        source: apply_phase
+      - id: apply_RM
+        source: apply_RM
+      - id: apply_beam
+        source: apply_beam
+      - id: clipATeam
+        source: clipATeam
+      - id: updateweights
+        source: updateweights
+      - id: max_dppp_threads
+        source: max_dppp_threads
+      - id: memoryperc
+        source: memoryperc
+      - id: min_separation
+        source: min_separation
+      - id: A-Team_skymodel
+        source: A-Team_skymodel
+      - id: avg_timeresolution
+        source: avg_timeresolution
+      - id: avg_freqresolution
+        source: avg_freqresolution
+      - id: ionex_server
+        source: ionex_server
+      - id: ionex_prefix
+        source: ionex_prefix
+      - id: proxy_server
+        source: proxy_server
+      - id: proxy_port
+        source: proxy_port
+      - id: proxy_type
+        source: proxy_type
+      - id: proxy_user
+        source: proxy_user
+      - id: proxy_pass
+        source: proxy_pass
+    out:
+      - id: outh5parm
+      - id: inspection
+      - id: msout
+      - id: logfiles
+    run: ./prefactor_target/prep.cwl
+    label: prep
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: findRefAnt
+    in:
+      - id: msin
+        source: prep/msout
+    out:
+      - id: flagged_fraction_dict
+      - id: logfile
+    run: ./../steps/findRefAnt.cwl
+    label: findRefAnt
+    scatter:
+      - msin
+    'sbg:x': 400
+    'sbg:y': 0
+  - id: findRefAnt_join
+    in:
+      - id: flagged_fraction_dict
+        source:
+          - findRefAnt/flagged_fraction_dict
+      - id: filter_station
+        source: refant
+    out:
+      - id: refant
+      - id: logfile
+    run: ./../steps/findRefAnt_join.cwl
+    label: findRefAnt_join
+    'sbg:x': 600
+    'sbg:y': 0
+  - id: concat_logfiles_RefAnt
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - findRefAnt/logfile
+          - findRefAnt_join/logfile
+      - id: file_prefix
+        default: findRefAnt
+    out:
+      - id: output
+    run: ./../steps/concatenate_files.cwl
+    label: concat_logfiles_RefAnt
+    'sbg:x': 800
+    'sbg:y': 300
+  - id: gsmcal
+    in:
+      - id: msin
+        source:
+          - prep/msout
+      - id: filter_baselines
+        source: process_baselines_target
+      - id: num_SBs_per_group
+        source: num_SBs_per_group
+      - id: reference_stationSB
+        source: reference_stationSB
+      - id: use_target
+        source: use_target
+      - id: target_skymodel
+        source: target_skymodel
+      - id: skymodel_source
+        source: skymodel_source
+      - id: do_smooth
+        source: do_smooth
+      - id: propagatesolutions
+        source: propagatesolutions
+      - id: avg_timeresolution_concat
+        source: avg_timeresolution_concat
+      - id: avg_freqresolution_concat
+        source: avg_freqresolution_concat
+      - id: min_unflagged_fraction
+        source: min_unflagged_fraction
+      - id: refant
+        source: findRefAnt_join/refant
+    out:
+      - id: msout
+      - id: outh5parm
+      - id: bad_antennas
+      - id: outh5parm_logfile
+      - id: inspection
+      - id: logfiles
+    run: ./prefactor_target/gsmcal.cwl
+    label: gsmcal
+    'sbg:x': 900
+    'sbg:y': 0
+  - id: finalize
+    in:
+      - id: msin
+        source:
+          - gsmcal/msout
+      - id: input_h5parm
+        source: gsmcal/outh5parm
+      - id: inh5parm_logfile
+        source: gsmcal/outh5parm_logfile
+      - id: gsmcal_step
+        source: gsmcal_step
+      - id: process_baselines_target
+        source: process_baselines_target
+      - id: bad_antennas
+        source: gsmcal/bad_antennas
+      - id: insolutions
+        source: prep/outh5parm
+      - id: compression_bitrate
+        source: compression_bitrate
+      - id: skymodel_source
+        source: skymodel_source
+    out:
+      - id: msout
+      - id: solutions
+      - id: logfiles
+      - id: inspection
+    run: ./prefactor_target/finalize.cwl
+    label: finalize
+    'sbg:x': 1200
+    'sbg:y': 0
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_target/finalize.cwl b/workflows/prefactor_target/finalize.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..93346d0285251d714b0db13f4035d71f1edcb1e0
--- /dev/null
+++ b/workflows/prefactor_target/finalize.cwl
@@ -0,0 +1,279 @@
+class: Workflow
+cwlVersion: v1.0
+id: finalize
+label: finalize
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: input_h5parm
+    type: File
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: inh5parm_logfile
+    type: File
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: gsmcal_step
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: process_baselines_target
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: bad_antennas
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: insolutions
+    type: File
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: compression_bitrate
+    type: int
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: skymodel_source
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 400
+outputs:
+  - id: msout
+    outputSource:
+      - apply_gsmcal/msout
+    type: 'Directory[]'
+    'sbg:x': 1300
+    'sbg:y': 0
+  - id: solutions
+    outputSource:
+      - h5parm_pointingname/outh5parm
+    type: File
+    'sbg:x': 1300
+    'sbg:y': 200
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_applygsm/output
+      - concat_logfiles_solutions/output
+      - concat_logfiles_structure/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1300
+    'sbg:y': 800
+  - id: inspection
+    outputSource:
+      - structure_function/structure_plot
+    type: 'File[]?'
+    linkMerge: merge_flattened
+    'sbg:x': 1300
+    'sbg:y': 500
+steps:
+  - id: add_missing_stations
+    in:
+      - id: h5parm
+        source: input_h5parm
+      - id: solset
+        default: 'sol000'
+      - id: refsolset
+        default: 'target'
+      - id: refh5parm
+        source: insolutions
+      - id: soltab_in
+        source: gsmcal_step
+        valueFrom: $(self+'000')
+      - id: soltab_out
+        source:
+          - skymodel_source
+          - gsmcal_step
+        valueFrom: $(self.join(''))
+      - id: filter
+        source: process_baselines_target
+      - id: bad_antennas
+        source: bad_antennas
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/add_missing_stations.cwl
+    label: add_missing_stations
+    'sbg:x': -200
+    'sbg:y': -300
+
+  - id: apply_gsmcal
+    in:
+      - id: msin
+        source: msin
+      - id: msin_datacolumn
+        default: DATA
+      - id: msout_name
+        source: msin
+        valueFrom: $(self.nameroot+'_pre-cal.ms')
+        linkMerge: merge_flattened
+      - id: parmdb
+        source: write_solutions/outh5parm
+      - id: msout_datacolumn
+        default: DATA
+      - id: storagemanager
+        default: "Dysco"
+      - id: databitrate
+        source: compression_bitrate
+      - id: correction
+        source:
+          - skymodel_source
+          - gsmcal_step
+        valueFrom: $(self.join(''))
+      - id: solset
+        default: 'target'
+    out:
+      - id: msout
+      - id: logfile
+    run: ../../lofar-cwl/steps/applytarget.cwl
+    label: apply_gsmcal
+    scatter:
+      - msin
+      - msout_name
+    scatterMethod: flat_crossproduct
+    'sbg:x': 400
+    'sbg:y': 0
+  - id: merge_array_files
+    in:
+      - id: input
+        source:
+          - apply_gsmcal/logfile
+    out:
+      - id: output
+    run: ../../steps/merge_array_files.cwl
+    label: merge_array_files
+    'sbg:x': 600
+    'sbg:y': 0
+
+  - id: write_solutions
+    in:
+      - id: h5parmFile
+        source: add_missing_stations/outh5parm
+      - id: outsolset
+        default: target
+      - id: insoltab
+        source:
+          - skymodel_source
+          - gsmcal_step
+        valueFrom: $(self.join(''))
+      - id: input_file
+        source: insolutions
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: history
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parmcat.cwl
+    label: write_solutions
+    'sbg:x': 200
+    'sbg:y': 500
+  - id: h5parm_pointingname
+    in:
+      - id: h5parmFile
+        source: write_solutions/outh5parm
+      - id: outsolset
+        default: 'target'
+      - id: solsetName
+        default: 'target'
+      - id: pointing
+        source: get_targetname/targetname
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../steps/h5parm_pointingname.cwl
+    label: h5parm_pointingname
+    'sbg:x': 400
+    'sbg:y': 200
+  - id: structure_function
+    in:
+      - id: h5parmFile
+        source: write_solutions/outh5parm
+      - id: solset
+        default: 'target'
+      - id: soltab
+        source:
+          - skymodel_source
+          - gsmcal_step
+        valueFrom: $(self.join(''))
+      - id: outbasename
+        source: get_targetname/targetname
+    out:
+      - id: structure_plot
+      - id: structure_txt
+      - id: log
+    run: ../../steps/structure_function.cwl
+    label: structure_function
+    'sbg:x': 500
+    'sbg:y': 300
+  - id: concat_logfiles_applygsm
+    in:
+      - id: file_list
+        source:
+          - merge_array_files/output
+      - id: file_prefix
+        default: apply_gsmcal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_applygsm
+    'sbg:x': 750
+    'sbg:y': 500
+  - id: concat_logfiles_solutions
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - inh5parm_logfile
+          - add_missing_stations/log
+          - write_solutions/log
+          - get_targetname/logfile
+          - h5parm_pointingname/log
+      - id: file_prefix
+        default: losoto_gsmcal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_solutions
+    'sbg:x': 500
+    'sbg:y': 500
+  - id: concat_logfiles_structure
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - structure_function/log
+          - structure_function/structure_txt
+      - id: file_prefix
+        source: get_targetname/targetname
+        valueFrom: $(self+'_structure')
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_structure
+    'sbg:x': 950
+    'sbg:y': 500
+  - id: get_targetname
+    in:
+      - id: msin
+        linkMerge: merge_flattened
+        source: msin
+    out:
+      - id: targetname
+      - id: logfile
+    run: ../../steps/get_targetname.cwl
+    label: get_targetname
+    'sbg:x': 200
+    'sbg:y': 200
+requirements:
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: StepInputExpressionRequirement
+  - class: InlineJavascriptRequirement
\ No newline at end of file
diff --git a/workflows/prefactor_target/gsmcal.cwl b/workflows/prefactor_target/gsmcal.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..a94c5e97938b0f2e88f32287674bba73ea140c83
--- /dev/null
+++ b/workflows/prefactor_target/gsmcal.cwl
@@ -0,0 +1,506 @@
+class: Workflow
+cwlVersion: v1.0
+id: gsmcal
+label: gsmcal
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: filter_baselines
+    type: string
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: num_SBs_per_group
+    type: int
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: reference_stationSB
+    type: int
+    default: null
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: use_target
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: target_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: skymodel_source
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: do_smooth
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: propagatesolutions
+    type: boolean
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: avg_timeresolution_concat
+    type: int
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: avg_freqresolution_concat
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: min_unflagged_fraction
+    type: float
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: refant
+    type: string
+    'sbg:x': -1000
+    'sbg:y': 800
+outputs:
+  - id: msout
+    outputSource:
+      - calibrate_target/msout
+    type: 'Directory[]'
+    'sbg:x': 1500
+    'sbg:y': 0
+  - id: outh5parm
+    outputSource:
+      - h5parm_collector/outh5parm
+    type: File
+    'sbg:x': 1500
+    'sbg:y': 200
+  - id: bad_antennas
+    outputSource:
+      - identifybadantennas_join/filter_out
+    type: string
+    'sbg:x': 1500
+    'sbg:y': 400
+  - id: outh5parm_logfile
+    outputSource:
+      - concat_logfiles_losoto/output
+    type: File
+    'sbg:x': 1500
+    'sbg:y': 600
+  - id: inspection
+    outputSource:
+      - losoto_plot_P/output_plots
+      - losoto_plot_P2/output_plots
+      - losoto_plot_Pd/output_plots
+      - losoto_plot_Pd2/output_plots
+      - plot_unflagged/output_imag
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1500
+    'sbg:y': 800
+  - id: logfiles
+    outputSource:
+      - concat_logfiles_identify/output
+      - sort_times_into_freqGroups/logfile
+      - find_skymodel_target/logfile
+      - make_sourcedb_target/log
+      - concat_logfiles_calib/output
+      - concat_logfiles_dpppconcat/output
+      - concat_logfiles_blsmooth/output
+      - concat_logfiles_unflagged/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1500
+    'sbg:y': 1000
+steps:
+  - id: identifybadantennas
+    in:
+      - id: msin
+        source: msin
+    out:
+      - id: flaggedants
+      - id: logfile
+    run: ../../steps/identify_bad_antennas.cwl
+    label: identifybadantennas
+    scatter:
+      - msin
+    'sbg:x': -200
+    'sbg:y': -300
+  - id: identifybadantennas_join
+    in:
+      - id: flaggedants
+        source: identifybadantennas/flaggedants
+      - id: filter
+        source: filter_baselines
+    out:
+      - id: filter_out
+      - id: logfile
+    run: ../../steps/identify_bad_antennas_join.cwl
+    label: identifybadantennas_join
+    'sbg:x': 0
+    'sbg:y': -300
+  - id: sort_times_into_freqGroups
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: numbands
+        source: num_SBs_per_group
+      - id: NDPPPfill
+        default: true
+      - id: stepname
+        default: .dpppconcat
+      - id: firstSB
+        source: reference_stationSB
+      - id: truncateLastSBs
+        default: false
+    out:
+      - id: filenames
+      - id: groupnames
+      - id: logfile
+    run: ../../steps/sort_times_into_freqGroups.cwl
+    label: sorttimesintofreqGroups
+    'sbg:x': -200
+    'sbg:y': 0
+  - id: find_skymodel_target
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: SkymodelPath
+        source: target_skymodel
+      - id: Radius
+        default: 5
+      - id: Source
+        source: skymodel_source
+      - id: DoDownload
+        source: use_target
+    out:
+      - id: skymodel
+      - id: logfile
+    run: ../../steps/find_skymodel_target.cwl
+    label: find_skymodel_target
+    'sbg:x': -200
+    'sbg:y': -500
+  - id: make_sourcedb_target
+    in:
+      - id: sky_model
+        source: find_skymodel_target/skymodel
+      - id: output_file_name
+        default: target.sourcedb
+      - id: logname
+        default: make_sourcedb_target.log
+    out:
+      - id: sourcedb
+      - id: log
+    run: ../../lofar-cwl/steps/makesourcedb.cwl
+    label: make_sourcedb_target
+    'sbg:x': 0
+    'sbg:y': -500
+  - id: concat_logfiles_dpppconcat
+    in:
+      - id: file_list
+        source:
+          - concat/dpppconcat.log
+      - id: file_prefix
+        default: dpppconcat
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_dpppconcat
+    'sbg:x': 1200
+    'sbg:y': 100
+  - id: concat_logfiles_blsmooth
+    in:
+      - id: file_list
+        source:
+          - calibrate_target/BLsmooth.log
+      - id: file_prefix
+        default: blsmooth_target
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_blsmooth
+    'sbg:x': 1200
+    'sbg:y': 300
+  - id: concat_logfiles_calib
+    in:
+      - id: file_list
+        source:
+          - calibrate_target/gaincal.log
+      - id: file_prefix
+        default: gaincal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_calib
+    'sbg:x': 1200
+    'sbg:y': 500
+  - id: concat_logfiles_losoto
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - h5parm_collector/log
+          - losoto_plot_P/logfile
+          - losoto_plot_P2/logfile
+          - losoto_plot_Pd/logfile
+          - losoto_plot_Pd2/logfile
+      - id: file_prefix
+        default: losoto_gsmcal
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_losoto
+    'sbg:x': 1200
+    'sbg:y': 700
+  - id: concat_logfiles_unflagged
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - concat/check_unflagged_fraction.log
+          - plot_unflagged/logfile
+      - id: file_prefix
+        default: check_unflagged_fraction
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_unflagged
+    'sbg:x': 1200
+    'sbg:y': 900
+  - id: concat_logfiles_identify
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - identifybadantennas/logfile
+          - identifybadantennas_join/logfile
+      - id: file_prefix
+        default: identifyBadAntennas
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_identify
+    'sbg:x': 1200
+    'sbg:y': -100
+  - id: concat
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: group_id
+        source: sort_times_into_freqGroups/groupnames
+      - id: groups_specification
+        source: sort_times_into_freqGroups/filenames
+      - id: filter_baselines
+        source: identifybadantennas_join/filter_out
+      - id: avg_timeresolution_concat
+        source: avg_timeresolution_concat
+      - id: avg_freqresolution_concat
+        source: avg_freqresolution_concat
+      - id: min_unflagged_fraction
+        source: min_unflagged_fraction
+    out:
+      - id: msout_old
+      - id: unflagged_fraction
+      - id: msout
+      - id: dpppconcat.log
+      - id: check_unflagged_fraction.log
+    run: ../../subworkflow/concat.cwl
+    label: concat
+    scatter:
+      - group_id
+    'sbg:x': 200
+    'sbg:y': 0
+  - id: merge_array
+    in:
+      - id: input
+        source:
+          - concat/msout
+    out:
+      - id: output
+    run: ../../steps/merge_array.cwl
+    label: merge_array
+    'sbg:x': 400
+    'sbg:y': 0
+  - id: calibrate_target
+    in:
+      - id: msin
+        source: merge_array/output
+      - id: skymodel
+        source: make_sourcedb_target/sourcedb
+      - id: do_smooth
+        source: do_smooth
+      - id: propagatesolutions
+        source: propagatesolutions
+    out:
+      - id: msout
+      - id: BLsmooth.log
+      - id: gaincal.log
+      - id: outh5parm
+    run: ../../subworkflow/calib_targ.cwl
+    label: calibrate_target
+    scatter:
+      - msin
+    'sbg:x': 600
+    'sbg:y': 0
+  - id: h5parm_collector
+    in:
+      - id: h5parmFiles
+        source:
+          - calibrate_target/outh5parm
+      - id: squeeze
+        default: true
+      - id: verbose
+        default: true
+      - id: clobber
+        default: true
+    out:
+      - id: outh5parm
+      - id: log
+    run: ../../lofar-cwl/steps/H5ParmCollector.cwl
+    label: H5parm_collector
+    'sbg:x': 750
+    'sbg:y': -300
+  - id: plot_unflagged
+    in:
+      - id: msin
+        source:
+          - concat/msout_old
+      - id: unflagged_fraction
+        source:
+          - concat/unflagged_fraction
+    out:
+      - id: output_imag
+      - id: logfile
+    run: ../../steps/plot_unflagged.cwl
+    label: plot_unflagged
+    'sbg:x': 500
+    'sbg:y': -200
+  - id: losoto_plot_P
+    in:
+      - id: input_h5parm
+        source: h5parm_collector/outh5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ph_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_P
+    'sbg:x': 1000
+    'sbg:y': 200
+  - id: losoto_plot_P2
+    in:
+      - id: input_h5parm
+        source: h5parm_collector/outh5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: axisInCol
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ph_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_P2
+    'sbg:x': 1000
+    'sbg:y': 50
+  - id: losoto_plot_Pd
+    in:
+      - id: input_h5parm
+        source: h5parm_collector/outh5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+          - freq
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ph_poldif_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pd
+    'sbg:x': 1000
+    'sbg:y': -100
+  - id: losoto_plot_Pd2
+    in:
+      - id: input_h5parm
+        source: h5parm_collector/outh5parm
+      - id: soltab
+        default: sol000/phase000
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: axisDiff
+        default: pol
+      - id: minmax
+        default:
+          - -3.14
+          - 3.14
+      - id: plotFlag
+        default: true
+      - id: refAnt
+        source: refant
+      - id: prefix
+        default: ph_poldif_
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_Pd2
+    'sbg:x': 1000
+    'sbg:y': -250
+requirements:
+  - class: StepInputExpressionRequirement
+  - class: InlineJavascriptRequirement
+  - class: SubworkflowFeatureRequirement
+  - class: ScatterFeatureRequirement
+  - class: MultipleInputFeatureRequirement
diff --git a/workflows/prefactor_target/prep.cwl b/workflows/prefactor_target/prep.cwl
new file mode 100644
index 0000000000000000000000000000000000000000..1e1ebb52fb6326cd33b18425db8a6112b8a510e1
--- /dev/null
+++ b/workflows/prefactor_target/prep.cwl
@@ -0,0 +1,491 @@
+class: Workflow
+cwlVersion: v1.0
+id: prep
+label: prep
+$namespaces:
+  sbg: 'https://www.sevenbridges.com/'
+inputs:
+  - id: msin
+    type: 'Directory[]'
+    'sbg:x': -1000
+    'sbg:y': -1700
+  - id: cal_solutions
+    type: File
+    'sbg:x': -1000
+    'sbg:y': -1600
+  - id: flag_baselines
+    type: 'string[]?'
+    default: []
+    'sbg:x': -1000
+    'sbg:y': -1500
+  - id: process_baselines_target
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1400
+  - id: filter_baselines
+    type: string?
+    default: '[CR]S*&'
+    'sbg:x': -1000
+    'sbg:y': -1300
+  - id: rfistrategy
+    type: string?
+    default: HBAdefault.rfis
+    'sbg:x': -1000
+    'sbg:y': -1200
+  - id: raw_data
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -1100
+  - id: propagatesolutions
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -1000
+  - id: demix_sources
+    type: 'string[]?'
+    default:
+      - CasA
+      - CygA
+    'sbg:x': -1000
+    'sbg:y': -900
+  - id: demix_target
+    type: string?
+    default: ''
+    'sbg:x': -1000
+    'sbg:y': -800
+  - id: demix_freqstep
+    type: int?
+    default: 16
+    'sbg:x': -1000
+    'sbg:y': -700
+  - id: demix_timestep
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': -600
+  - id: demix
+    type: boolean?
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -500
+  - id: apply_tec
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -400
+  - id: apply_clock
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -300
+  - id: apply_phase
+    type: boolean
+    default: false
+    'sbg:x': -1000
+    'sbg:y': -200
+  - id: apply_RM
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': -100
+  - id: apply_beam
+    type: boolean
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 0
+  - id: clipATeam
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 100
+  - id: updateweights
+    type: boolean?
+    default: true
+    'sbg:x': -1000
+    'sbg:y': 200
+  - id: max_dppp_threads
+    type: int?
+    default: 10
+    'sbg:x': -1000
+    'sbg:y': 300
+  - id: memoryperc
+    type: int?
+    default: 20
+    'sbg:x': -1000
+    'sbg:y': 400
+  - id: min_separation
+    type: int?
+    default: 30
+    'sbg:x': -1000
+    'sbg:y': 500
+  - id: A-Team_skymodel
+    type: File?
+    'sbg:x': -1000
+    'sbg:y': 600
+  - id: avg_timeresolution
+    type: float?
+    default: 4
+    'sbg:x': -1000
+    'sbg:y': 700
+  - id: avg_freqresolution
+    type: string?
+    default: 48.82kHz
+    'sbg:x': -1000
+    'sbg:y': 800
+  - id: ionex_server
+    type: string?
+    default: 'ftp://ftp.aiub.unibe.ch/CODE/'
+    'sbg:x': -1000
+    'sbg:y': 900
+  - id: ionex_prefix
+    type: string?
+    default: CODG
+    'sbg:x': -1000
+    'sbg:y': 1000
+  - id: proxy_server
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 1100
+  - id: proxy_port
+    type: int?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 1200
+  - id: proxy_type
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 1300
+  - id: proxy_user
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 1400
+  - id: proxy_pass
+    type: string?
+    default: null
+    'sbg:x': -1000
+    'sbg:y': 1500
+  - id: elevation
+    type: string
+    default: 0deg..20deg
+    'sbg:x': -1000
+    'sbg:y': 1600
+  - id: amplmin
+    type: float
+    default: 1.e-30
+    'sbg:x': -1000
+    'sbg:y': 1700
+outputs:
+  - id: outh5parm
+    outputSource:
+      - createRMh5parm/h5parmout
+    type: File
+    'sbg:x': 1000
+    'sbg:y': -500
+  - id: inspection
+    outputSource:
+      - check_ateam_separation/output_imag
+      - losoto_plot_RM/output_plots
+      - plot_Ateamclipper/output_imag
+    type: 'File[]?'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': -300
+  - id: msout
+    outputSource:
+      - dppp_prep_target/msout
+    type: 'Directory[]'
+    'sbg:x': 1000
+    'sbg:y': 0
+  - id: logfiles
+    outputSource:
+      - make_sourcedb_ateam/log
+      - check_ateam_separation/logfile
+      - concat_logfiles_stationlist/output
+      - concat_logfiles_RMextract/output
+      - concat_logfiles_prep_targ/output
+      - concat_logfiles_predict_targ/output
+      - concat_logfiles_clipper_targ/output
+    type: 'File[]'
+    linkMerge: merge_flattened
+    'sbg:x': 1000
+    'sbg:y': 800
+steps:
+  - id: check_ateam_separation
+    in:
+      - id: ms
+        source:
+          - msin
+      - id: min_separation
+        source: min_separation
+    out:
+      - id: output_imag
+      - id: logfile
+    run: ../../lofar-cwl/steps/check_ateam_separation.cwl
+    label: check_Ateam_separation
+    'sbg:x': -500
+    'sbg:y': -300
+  - id: compare_station_list
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: h5parmdb
+        source: cal_solutions
+      - id: solset_name
+        default: 'calibrator'
+      - id: filter
+        source: filter_baselines
+    out:
+      - id: filter_out
+      - id: logfile
+    run: ../../steps/compare_station_list.cwl
+    label: compare_station_list
+    'sbg:x': -500
+    'sbg:y': -500
+  - id: make_sourcedb_ateam
+    in:
+      - id: sky_model
+        source: A-Team_skymodel
+      - id: logname
+        default: make_sourcedb_ateam.log
+    out:
+      - id: sourcedb
+      - id: log
+    run: ../../lofar-cwl/steps/makesourcedb.cwl
+    label: make_sourcedb_ateam
+    'sbg:x': -500
+    'sbg:y': 300
+  - id: createRMh5parm
+    in:
+      - id: msin
+        source:
+          - msin
+      - id: h5parm
+        source: cal_solutions
+      - id: ionex_server
+        source: ionex_server
+      - id: ionex_prefix
+        source: ionex_prefix
+      - id: solset
+        default: target
+      - id: proxyserver
+        source: proxy_server
+      - id: proxyport
+        source: proxy_port
+      - id: proxytype
+        source: proxy_type
+      - id: proxyuser
+        source: proxy_user
+      - id: proxypass
+        source: proxy_pass
+    out:
+      - id: h5parmout
+      - id: logfile
+    run: ../../steps/createRMh5parm.cwl
+    label: createRMh5parm
+    'sbg:x': -500
+    'sbg:y': 0
+  - id: losoto_plot_RM
+    in:
+      - id: input_h5parm
+        source: createRMh5parm/h5parmout
+      - id: soltab
+        default: target/RMextract
+      - id: axesInPlot
+        default:
+          - time
+      - id: axisInTable
+        default: ant
+      - id: prefix
+        default: RMextract
+    out:
+      - id: output_plots
+      - id: logfile
+      - id: parset
+    run: ../../lofar-cwl/steps/LoSoTo.Plot.cwl
+    label: losoto_plot_RM
+    'sbg:x': 0
+    'sbg:y': -300
+  - id: dppp_prep_target
+    in:
+      - id: msin
+        linkMerge: merge_flattened
+        source:
+          - msin
+      - id: msin_baseline
+        default: '*'
+        source: compare_station_list/filter_out
+      - id: baselines_to_flag
+        source: flag_baselines
+      - id: elevation_to_flag
+        source: elevation
+      - id: min_amplitude_to_flag
+        source: amplmin
+      - id: memoryperc
+        default: 20
+        source: memoryperc
+      - id: raw_data
+        default: false
+        source: raw_data
+      - id: demix
+        default: false
+        source: demix
+      - id: skymodel
+        source: make_sourcedb_ateam/sourcedb
+      - id: timeresolution
+        default: 1
+        source: avg_timeresolution
+      - id: freqresolution
+        default: 12.21kHz
+        source: avg_freqresolution
+      - id: demix_timestep
+        default: 1
+        source: demix_timestep
+      - id: demix_freqstep
+        default: 1
+        source: demix_freqstep
+      - id: process_baselines_target
+        default: '*'
+        source: process_baselines_target
+      - id: target_source
+        source: demix_target
+      - id: ntimechunk
+        default: 10
+        source: max_dppp_threads
+      - id: subtract_sources
+        source:
+          - demix_sources
+      - id: parmdb
+        source: createRMh5parm/h5parmout
+      - id: apply_tec_correction
+        source: apply_tec
+        default: false
+      - id: apply_rm_correction
+        source: apply_RM
+        default: true
+      - id: apply_phase_correction
+        source: apply_phase
+        default: false
+      - id: apply_clock_correction
+        source: apply_clock
+        default: true
+      - id: apply_beam_correction
+        source: apply_beam
+        default: true
+      - id: filter_baselines
+        source: compare_station_list/filter_out
+      - id: updateweights
+        source: updateweights
+    out:
+      - id: msout
+      - id: prep_logfile
+      - id: predict_logfile
+      - id: clipper_logfile
+      - id: clipper_output
+      - id: parset
+    run: ../../subworkflow/ndppp_prep_targ.cwl
+    label: ndppp_prep_target
+    scatter:
+      - msin
+    'sbg:x': 0
+    'sbg:y': 0
+  - id: plot_Ateamclipper
+    in:
+      - id: clipper_output
+        source: concat_logfiles_clipper_output/output
+    out:
+      - id: output_imag
+    run: ../../steps/plot_Ateamclipper.cwl
+    label: concat_logfiles_clipper_output
+    'sbg:x': 600
+    'sbg:y': 200
+  - id: concat_logfiles_clipper_output
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source: dppp_prep_target/clipper_output
+      - id: file_prefix
+        default: Ateamclipper
+      - id: file_suffix
+        default: txt
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_clipper_output
+    'sbg:x': 400
+    'sbg:y': 200
+  - id: concat_logfiles_prep_targ
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source: dppp_prep_target/prep_logfile
+      - id: file_prefix
+        default: ndppp_prep_targ
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_prep_target
+    'sbg:x': 400
+    'sbg:y': 300
+  - id: concat_logfiles_predict_targ
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source: dppp_prep_target/predict_logfile
+      - id: file_prefix
+        default: predict_targ
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_predict_targ
+    'sbg:x': 400
+    'sbg:y': 400
+  - id: concat_logfiles_clipper_targ
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source: dppp_prep_target/clipper_logfile
+      - id: file_prefix
+        default: Ateamclipper
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_clipper_targ
+    'sbg:x': 400
+    'sbg:y': 500
+  - id: concat_logfiles_RMextract
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - createRMh5parm/logfile
+          - losoto_plot_RM/logfile
+      - id: file_prefix
+        default: RMextract
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_RMextract
+    'sbg:x': 400
+    'sbg:y': 600
+  - id: concat_logfiles_stationlist
+    in:
+      - id: file_list
+        linkMerge: merge_flattened
+        source:
+          - compare_station_list/logfile
+      - id: file_prefix
+        default: compareStationList
+    out:
+      - id: output
+    run: ../../steps/concatenate_files.cwl
+    label: concat_logfiles_stationlist
+    'sbg:x': 400
+    'sbg:y': 700
+requirements:
+  - class: ScatterFeatureRequirement
\ No newline at end of file