Examples¶
The following examples show how to use the loader APIs:
1.1 Parsing a Workflow¶
This sample shows how to read a CWL document from a remote public URL:
In [1]:
Copied!
from cwl_loader import load_cwl_from_location
# cwl_document = load_cwl_from_location('https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl')
cwl_document = load_cwl_from_location("/home/stripodi/Downloads/hotspot.cwl")
from cwl_loader import load_cwl_from_location
# cwl_document = load_cwl_from_location('https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl')
cwl_document = load_cwl_from_location("/home/stripodi/Downloads/hotspot.cwl")
2026-07-28 10:41:12.055 | DEBUG | cwl_loader:load_cwl_from_location:437 - Loading CWL document from /home/stripodi/Downloads/hotspot.cwl...
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[1], line 5 1 from cwl_loader import load_cwl_from_location 2 3 # cwl_document = load_cwl_from_location('https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl') 4 ----> 5 cwl_document = load_cwl_from_location("/home/stripodi/Downloads/hotspot.cwl") File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:473, in load_cwl_from_location(path, cwl_version, sort, session) 471 return _load_cwl_from_stream(f) 472 else: --> 473 raise ValueError(f"Invalid source {path}: not a URL or existing file path") ValueError: Invalid source /home/stripodi/Downloads/hotspot.cwl: not a URL or existing file path
1.2 Serializing¶
This sample shows how to write a CWL document to a stream (string, file, ...):
In [2]:
Copied!
from cwl_loader import dump_cwl
import sys
dump_cwl(process=cwl_document, stream=sys.stderr)
from cwl_loader import dump_cwl
import sys
dump_cwl(process=cwl_document, stream=sys.stderr)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[2], line 4 1 from cwl_loader import dump_cwl 2 import sys 3 ----> 4 dump_cwl(process=cwl_document, stream=sys.stderr) NameError: name 'cwl_document' is not defined
2.1 Parsing a CommandLineTool¶
This sample shows how to read a CWL document from a remote public URL:
In [3]:
Copied!
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl"
)
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl"
)
2026-07-28 10:41:12.194 | DEBUG | cwl_loader:load_cwl_from_location:437 - Loading CWL document from https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl...
2026-07-28 10:41:12.266 | DEBUG | cwl_loader:_load_cwl_from_stream:440 - Reading stream from https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl...
2026-07-28 10:41:12.272 | DEBUG | cwl_loader:load_cwl_from_stream:407 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2026-07-28 10:41:12.272 | DEBUG | cwl_loader:load_cwl_from_yaml:326 - Updating the model from version 'v1.0' to version 'v1.2'...
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[3], line 1 ----> 1 cwl_document = load_cwl_from_location( 2 "https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl" 3 ) File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:465, in load_cwl_from_location(path, cwl_version, sort, session) 461 combined = BytesIO(magic + remaining) 463 buffer = GzipFile(fileobj=combined) if magic == b"\x1f\x8b" else combined --> 465 return _load_cwl_from_stream( 466 TextIOWrapper(buffer, encoding=__DEFAULT_ENCODING__) 467 ) 468 source_path = Path(path) 469 if source_path.exists(): File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:442, in load_cwl_from_location.<locals>._load_cwl_from_stream(stream) 439 def _load_cwl_from_stream(stream): 440 logger.debug(f"Reading stream from {path}...") --> 442 loaded = load_cwl_from_stream( 443 content=stream, 444 uri=path, 445 cwl_version=cwl_version, 446 sort=sort, 447 session=session, 448 ) 450 logger.debug(f"Stream from {path} successfully load!") 452 return loaded File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:411, in load_cwl_from_stream(content, uri, cwl_version, sort, session) 405 cwl_content = _yaml.load(content) 407 logger.debug( 408 f"CWL data of type {type(cwl_content)} successfully loaded from stream" 409 ) --> 411 return load_cwl_from_yaml( 412 raw_process=cwl_content, 413 uri=uri, 414 cwl_version=cwl_version, 415 sort=sort, 416 session=session, 417 ) File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:330, in load_cwl_from_yaml(raw_process, uri, cwl_version, sort, session) 325 if cwl_version != raw_process[__CWL_VERSION__]: 326 logger.debug( 327 f"Updating the model from version '{raw_process[__CWL_VERSION__]}' to version '{cwl_version}'..." 328 ) --> 330 updated_process = _upgrade_document( 331 raw_process=raw_process, 332 cwl_version=cwl_version, 333 uri=uri, 334 ) 336 logger.debug(f"Raw CWL document successfully updated to {cwl_version}!") 337 else: File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwl_loader/__init__.py:86, in _upgrade_document(raw_process, cwl_version, uri) 83 if not isinstance(document, CommentedMap): 84 document = _to_commented_yaml(document) ---> 86 upgraded = upgrade_document( 87 document, 88 output_dir=_upgrade_output_dir(uri), 89 target_version=cwl_version, 90 ) 91 if not isinstance(upgraded, CommentedMap): 92 raise ValueError( 93 f"Cannot upgrade CWL document from {raw_process[__CWL_VERSION__]} " 94 f"to {cwl_version}" 95 ) File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:169, in upgrade_document(document, output_dir, target_version, imports) 166 _logger.error(f"Cannot downgrade from cwlVersion {version} to {target_version}") 167 return --> 169 process_imports(document, imports, inner_updater, output_dir) 170 return main_updater(document, output_dir) File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:228, in process_imports(document, imports, updater, outdir) 226 imports.add(value) 227 else: --> 228 process_imports(value, imports, updater, outdir) 229 elif isinstance(document, MutableSequence): 230 for entry in document: File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:228, in process_imports(document, imports, updater, outdir) 226 imports.add(value) 227 else: --> 228 process_imports(value, imports, updater, outdir) 229 elif isinstance(document, MutableSequence): 230 for entry in document: File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:228, in process_imports(document, imports, updater, outdir) 226 imports.add(value) 227 else: --> 228 process_imports(value, imports, updater, outdir) 229 elif isinstance(document, MutableSequence): 230 for entry in document: File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:231, in process_imports(document, imports, updater, outdir) 229 elif isinstance(document, MutableSequence): 230 for entry in document: --> 231 process_imports(entry, imports, updater, outdir) File /opt/hostedtoolcache/Python/3.14.6/x64/lib/python3.14/site-packages/cwlupgrader/main.py:219, in process_imports(document, imports, updater, outdir) 214 if key == "$import": 215 if value not in imports: 216 write_cwl_document( 217 updater( 218 load_cwl_document( --> 219 Path(document.lc.filename).parent / value 220 ), 221 outdir, 222 ), 223 Path(value).name, 224 outdir, 225 ) 226 imports.add(value) 227 else: AttributeError: 'LineCol' object has no attribute 'filename'
2.2 Serializing¶
This sample shows how to write a CWL document to a stream (string, file, ...):
In [4]:
Copied!
dump_cwl(process=cwl_document, stream=sys.stderr)
dump_cwl(process=cwl_document, stream=sys.stderr)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[4], line 1 ----> 1 dump_cwl(process=cwl_document, stream=sys.stderr) NameError: name 'cwl_document' is not defined
3. Parsing existing data structures¶
Users can load CWL Worflow(s) even from existing dictionaries:
In [5]:
Copied!
from cwl_loader import load_cwl_from_yaml
cwl_document = load_cwl_from_yaml(
raw_process={
"cwlVersion": "v1.2",
"inputs": {
"api_endpoint": {
"doc": "STAC API endpoint for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint",
"label": "STAC API endpoint",
},
"search_request": {
"doc": "STAC API settings for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings",
"label": "STAC API settings",
},
},
"requirements": [
{"class": "InlineJavascriptRequirement"},
{"class": "NetworkAccess", "networkAccess": True},
{
"class": "SchemaDefRequirement",
"types": [
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml"
},
],
},
],
"doc": "This tool uses the STAC Client to search for STAC items\n",
"class": "CommandLineTool",
"baseCommand": ["stac-client"],
"label": "STAC Client Tool",
"arguments": [
"search",
"$(inputs.api_endpoint.url.value)",
"${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(\",\")); return args; }",
"${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; }",
'${ const args = []; const limit = inputs.search_request?.limit; args.push("--limit", (limit ?? 10).toString()); return args; }',
"${ const maxItems = 5; return ['--max-items', maxItems.toString()]; }",
"${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; }",
"${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; }",
"${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; }",
"${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; }",
"--save",
"discovery-output.json",
],
"outputs": {
"search_output": {
"outputBinding": {"glob": "discovery-output.json"},
"type": "File",
}
},
"id": "stac-client",
"hints": [
{
"dockerPull": "docker.io/library/stac-client",
"class": "DockerRequirement",
}
],
}
)
dump_cwl(process=cwl_document, stream=sys.stderr)
from cwl_loader import load_cwl_from_yaml
cwl_document = load_cwl_from_yaml(
raw_process={
"cwlVersion": "v1.2",
"inputs": {
"api_endpoint": {
"doc": "STAC API endpoint for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint",
"label": "STAC API endpoint",
},
"search_request": {
"doc": "STAC API settings for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings",
"label": "STAC API settings",
},
},
"requirements": [
{"class": "InlineJavascriptRequirement"},
{"class": "NetworkAccess", "networkAccess": True},
{
"class": "SchemaDefRequirement",
"types": [
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml"
},
],
},
],
"doc": "This tool uses the STAC Client to search for STAC items\n",
"class": "CommandLineTool",
"baseCommand": ["stac-client"],
"label": "STAC Client Tool",
"arguments": [
"search",
"$(inputs.api_endpoint.url.value)",
"${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(\",\")); return args; }",
"${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; }",
'${ const args = []; const limit = inputs.search_request?.limit; args.push("--limit", (limit ?? 10).toString()); return args; }',
"${ const maxItems = 5; return ['--max-items', maxItems.toString()]; }",
"${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; }",
"${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; }",
"${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; }",
"${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; }",
"--save",
"discovery-output.json",
],
"outputs": {
"search_output": {
"outputBinding": {"glob": "discovery-output.json"},
"type": "File",
}
},
"id": "stac-client",
"hints": [
{
"dockerPull": "docker.io/library/stac-client",
"class": "DockerRequirement",
}
],
}
)
dump_cwl(process=cwl_document, stream=sys.stderr)
2026-07-28 10:41:12.456 | DEBUG | cwl_loader:load_cwl_from_yaml:338 - No needs to update the Raw CWL document since it targets already the v1.2
2026-07-28 10:41:12.457 | DEBUG | cwl_loader:load_cwl_from_yaml:342 - Parsing the raw CWL document to the CWL Utils DOM...
2026-07-28 10:41:13.581 | DEBUG | cwl_loader:load_cwl_from_yaml:351 - Raw CWL document successfully parsed to the CWL Utils DOM!
2026-07-28 10:41:13.582 | DEBUG | cwl_loader:load_cwl_from_yaml:353 - Dereferencing the steps[].run...
2026-07-28 10:41:13.582 | DEBUG | cwl_loader:load_cwl_from_yaml:357 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2026-07-28 10:41:13.582 | DEBUG | cwl_loader:load_cwl_from_yaml:361 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2026-07-28 10:41:13.583 | DEBUG | cwl_loader:load_cwl_from_yaml:367 - All steps[].run link are resolvable!
2026-07-28 10:41:13.584 | DEBUG | cwl_loader:load_cwl_from_yaml:370 - Sorting Process instances by dependencies....
2026-07-28 10:41:13.584 | DEBUG | cwl_loader:load_cwl_from_yaml:372 - Sorting process is over.
id: stac-client
class: CommandLineTool
label: STAC Client Tool
doc: "This tool uses the STAC Client to search for STAC items\n"
inputs:
- id: api_endpoint
label: STAC API endpoint
doc: STAC API endpoint for Landsat-9 data
type:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint
- id: search_request
label: STAC API settings
doc: STAC API settings for Landsat-9 data
type:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings
outputs:
- id: search_output
type: File
outputBinding:
glob: discovery-output.json
requirements:
- class: InlineJavascriptRequirement
- class: NetworkAccess
networkAccess: true
- class: SchemaDefRequirement
types:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType/Point
type: enum
- name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/coordinates
type:
name: _:2319a22b-7132-4e7a-8598-a760441d14eb
items: double
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox
type:
name: _:a3173ae0-5a71-47f4-a52d-5dc1fd11405b
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType/LineString
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/coordinates
type:
name: _:87d093ff-1f49-4e47-b2df-d1180d7f0429
items: double
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox
type:
name: _:7a83e40e-a6ac-481c-8ec5-d4d228820ff9
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType/Polygon
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/coordinates
type:
name: _:f7121eca-4264-4a8d-8800-9cd080cedfcf
items:
name: _:84ad2960-e60a-4943-9f50-b0b1d05ad654
items:
name: _:a221c6d8-717a-43a6-a391-41ada6219d9c
items: double
type: array
type: array
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox
type:
name: _:7f8f62e5-9cf4-43a0-971e-b2a01376f3a7
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType/MultiPoint
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/coordinates
type:
name: _:d4122ec3-f931-4d36-8600-17bfe332bf01
items:
name: _:a0902e0a-f138-4e64-af7c-fe49f7a7b792
items: double
type: array
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox
type:
name: _:bff64b3d-5d1d-4f44-a189-97a41a854186
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType/MultiLineString
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/coordinates
type:
name: _:b40b1404-dd4e-4fb3-baac-0acb7ee82061
items:
name: _:d5a71186-6748-4bee-a56c-29b3bb84230f
items:
name: _:9e7145f5-bde4-4ba7-a4f5-0c629075c84d
items: double
type: array
type: array
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox
type:
name: _:8d345b84-eef5-49e3-8c60-def0c09b0010
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType/MultiPolygon
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/coordinates
type:
name: _:525dffc9-a1ab-493f-93c9-f2f80a620c80
items:
name: _:3f05cb85-b4a8-4a27-8a4b-cd763437280d
items:
name: _:a85f1045-d8f1-4f09-9c9d-78ea3d7e60fd
items:
name: _:e3217053-5ecb-45ea-b3aa-a4a53ddebffe
items: double
type: array
type: array
type: array
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox
type:
name: _:2e5e05ad-6e14-48ff-8e3b-d3cc4cbba552
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType/Feature
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/id
doc: "Identifier"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/geometry
type:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/bbox
type:
name: _:0aacb928-74a4-42be-b79f-d771d6d4c025
items: double
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType/GeometryCollection
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/geometries
type:
name: _:9a6d4001-1d4b-4486-a880-26c0a2f640c2
items:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/bbox
type:
name: _:ab89bf58-79fe-4ad9-86cb-996c06b08b6c
items: double
type: array
type: record
- name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/href
doc: "i.e. http://data.example.com/buildings/123"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/rel
doc: "i.e. alternate"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/type
doc: "i.e. application/geo+json"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/hreflang
doc: "i.e. en"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/title
doc: "i.e. Trierer Strasse 70, 53115 Bonn"
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/length
type: int
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType/FeatureCollection
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/type
type:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/features
type:
name: _:5ddf0e26-0bb1-4a11-b94f-92c4e7183699
items:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/links
type:
name: _:db21e5c0-3bbc-4443-a91e-3d0611cc91a2
items:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/timeStamp
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberMatched
type: int
- name:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberReturned
type: int
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/key
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/value
type: string
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/url
type:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/headers
type:
- 'null'
- name: _:3847ebe4-da2f-4a1e-aee8-70220a2a6eb0
items:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/start
type:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/end
type:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/include
type:
- 'null'
- name: _:c7c1eb38-cbc6-47d9-bbfa-4096fe45c481
items: string
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude
type:
- 'null'
- name: _:a44e3104-4623-4083-a62a-d9319744b914
items: string
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-text
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-json
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction
symbols:
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/asc
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/desc
type: enum
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/field
type: string
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/direction
type:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/bbox
type:
- 'null'
- name: _:6f3b68d0-74d7-451c-9962-bf84f0ad8637
items: double
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime
type:
- 'null'
- https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime-interval
type:
- 'null'
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/intersects
type:
- 'null'
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon
- https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/collections
type:
- 'null'
- name: _:1fe08934-4957-4af7-922c-25190b849a72
items: string
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids
type:
- 'null'
- name: _:f87ec194-1f63-47be-9c30-62cb6a7ab8a7
items: string
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/limit
type:
- 'null'
- int
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/max-items
type:
- 'null'
- int
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/fields
type:
- 'null'
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter
type:
- 'null'
- Any
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-lang
type:
- 'null'
- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-crs
type:
- 'null'
- name: _:1b9e3e99-14f8-4989-8f5a-274a42a69250
items:
https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI
type: array
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/sortby
type:
- 'null'
- name: _:fae48892-aa15-412e-9405-c95b7e2b22dd
items:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy
type: array
type: record
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI
fields:
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/api_endpoint
type:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint
- name:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/search_request
type:
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings
type: record
hints:
- class: DockerRequirement
dockerPull: docker.io/library/stac-client
cwlVersion: v1.2
baseCommand:
- stac-client
arguments:
- search
- $(inputs.api_endpoint.url.value)
- ${ const args = []; const collections = inputs.search_request.collections;
args.push('--collections', collections.join(",")); return args; }
- ${ const args = []; const bbox = inputs.search_request?.bbox; if
(Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox',
...bbox.map(String)); } return args; }
- ${ const args = []; const limit = inputs.search_request?.limit;
args.push("--limit", (limit ?? 10).toString()); return args; }
- ${ const maxItems = 5; return ['--max-items', maxItems.toString()]; }
- ${ const args = []; const filter = inputs.search_request?.filter; const
filterLang = inputs.search_request?.['filter-lang']; if (filterLang) {
args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter',
JSON.stringify(filter)); } return args; }
- ${ const datetime = inputs.search_request?.datetime; const datetimeInterval =
inputs.search_request?.datetime_interval; if (datetime) { return
['--datetime', datetime]; } else if (datetimeInterval) { const start =
datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value
|| '..'; return ['--datetime', `${start}/${end}`]; } return []; }
- ${ const ids = inputs.search_request?.ids; const args = []; if
(Array.isArray(ids) && ids.length > 0) { args.push('--ids',
...ids.map(String)); } return args; }
- ${ const intersects = inputs.search_request?.intersects; if (intersects) {
return ['--intersects', JSON.stringify(intersects)]; } return []; }
- --save
- discovery-output.json
4. Parsing conditional Workflow¶
In [6]:
Copied!
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl"
)
dump_cwl(process=cwl_document, stream=sys.stderr)
cwl_document = load_cwl_from_location(
"https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl"
)
dump_cwl(process=cwl_document, stream=sys.stderr)
2026-07-28 10:41:13.647 | DEBUG | cwl_loader:load_cwl_from_location:437 - Loading CWL document from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl...
2026-07-28 10:41:13.680 | DEBUG | cwl_loader:_load_cwl_from_stream:440 - Reading stream from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl...
2026-07-28 10:41:13.699 | DEBUG | cwl_loader:load_cwl_from_stream:407 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2026-07-28 10:41:13.699 | DEBUG | cwl_loader:load_cwl_from_yaml:338 - No needs to update the Raw CWL document since it targets already the v1.2
2026-07-28 10:41:13.700 | DEBUG | cwl_loader:load_cwl_from_yaml:342 - Parsing the raw CWL document to the CWL Utils DOM...
2026-07-28 10:41:13.952 | DEBUG | cwl_loader:load_cwl_from_yaml:351 - Raw CWL document successfully parsed to the CWL Utils DOM!
2026-07-28 10:41:13.953 | DEBUG | cwl_loader:load_cwl_from_yaml:353 - Dereferencing the steps[].run...
2026-07-28 10:41:13.954 | DEBUG | cwl_loader:_dereference_step:263 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#stac must be externally imported...
2026-07-28 10:41:13.954 | DEBUG | cwl_loader:_dereference_step:265 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2026-07-28 10:41:13.954 | DEBUG | cwl_loader:_dereference_step:263 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_stack must be externally imported...
2026-07-28 10:41:13.955 | DEBUG | cwl_loader:_dereference_step:265 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2026-07-28 10:41:13.955 | DEBUG | cwl_loader:_dereference_step:263 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_warp_stack must be externally imported...
2026-07-28 10:41:13.956 | DEBUG | cwl_loader:_dereference_step:265 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2026-07-28 10:41:13.956 | DEBUG | cwl_loader:_dereference_step:263 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_color must be externally imported...
2026-07-28 10:41:13.956 | DEBUG | cwl_loader:_dereference_step:265 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2026-07-28 10:41:13.957 | DEBUG | cwl_loader:load_cwl_from_yaml:357 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2026-07-28 10:41:13.957 | DEBUG | cwl_loader:load_cwl_from_yaml:361 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2026-07-28 10:41:13.957 | DEBUG | cwl_loader:load_cwl_from_yaml:367 - All steps[].run link are resolvable!
2026-07-28 10:41:13.958 | DEBUG | cwl_loader:load_cwl_from_yaml:370 - Sorting Process instances by dependencies....
2026-07-28 10:41:13.958 | DEBUG | cwl_loader:load_cwl_from_yaml:372 - Sorting process is over.
2026-07-28 10:41:13.959 | DEBUG | cwl_loader:_load_cwl_from_stream:450 - Stream from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl successfully load!
cwlVersion: v1.2
$graph:
- id: rio_warp_stack
class: CommandLineTool
inputs:
- id: tiffs
type:
name: _:1a5a4efc-fdea-45f0-b5d3-d97b2ececa39
items: string
type: array
- id: epsg_code
type: string
outputs:
- id: stacked
type: File
outputBinding:
glob: warped.tif
requirements:
- class: DockerRequirement
dockerPull: ghcr.io/eoap/how-to/rio:1.0.0
- class: EnvVarRequirement
envDef:
- envName: GDAL_TIFF_INTERNAL_MASK
envValue: YES
- envName: GDAL_HTTP_MERGE_CONSECUTIVE_RANGES
envValue: YES
- envName: CPL_VSIL_CURL_ALLOWED_EXTENSIONS
envValue: .tif
- class: InitialWorkDirRequirement
listing:
- entryname: run.sh
entry: |-
#!/bin/bash
rio stack $@
rio warp --dst-crs $(inputs.epsg_code) stacked.tif warped.tif
cwlVersion: v1.2
baseCommand:
- /bin/bash
- run.sh
arguments:
- valueFrom: |
${
var arr = [];
for(var i=0; i<inputs.tiffs.length; i++) {
arr.push(inputs.tiffs[i]);
}
return arr;
}
- stacked.tif
- id: stac
class: CommandLineTool
inputs:
- id: stac_item
type: string
- id: common_band_name
type: string
outputs:
- id: hrefs
type: string
outputBinding:
loadContents: true
glob: message
outputEval: |
${
const assets = JSON.parse(self[0].contents).assets;
const bandKey = Object.keys(assets).find(key =>
assets[key]['eo:bands'] &&
assets[key]['eo:bands'].length === 1 &&
assets[key]['eo:bands'].some(band => band.common_name === inputs.common_band_name)
);
if (!bandKey) {
throw new Error(`No valid asset found for band: ${inputs.common_band_name}`);
}
return assets[bandKey].href;
}
requirements:
- class: DockerRequirement
dockerPull: docker.io/curlimages/curl:latest
cwlVersion: v1.2
baseCommand: curl
arguments:
- $( inputs.stac_item )
stdout: message
- id: main
class: Workflow
inputs:
- id: stac-item
type: string
- id: epsg_code
default: native
type: string
- id: bands
type:
name: _:1a994293-5d88-445a-8d4e-7a57a02fd7fc
items: string
type: array
outputs:
- id: rgb-tif
outputSource: step_color/rgb
type: File
- id: stack
outputSource:
- step_stack/stacked
- step_warp_stack/stacked
pickValue: the_only_non_null
type: File
requirements:
- class: InlineJavascriptRequirement
- class: NetworkAccess
networkAccess: true
- class: ScatterFeatureRequirement
- class: MultipleInputFeatureRequirement
cwlVersion: v1.2
steps:
- id: step_curl
in:
- id: stac_item
source: stac-item
- id: common_band_name
source: bands
out:
- hrefs
run: '#stac'
scatter: step_curl/common_band_name
scatterMethod: dotproduct
- id: step_stack
in:
- id: tiffs
source: step_curl/hrefs
- id: epsg_code
source: epsg_code
out:
- stacked
run: '#rio_stack'
when: $( inputs.epsg_code == "native")
- id: step_warp_stack
in:
- id: tiffs
source: step_curl/hrefs
- id: epsg_code
source: epsg_code
out:
- stacked
run: '#rio_warp_stack'
when: $( inputs.epsg_code != "native")
- id: step_color
in:
- id: stacked
source:
- step_stack/stacked
- step_warp_stack/stacked
pickValue: the_only_non_null
out:
- rgb
run: '#rio_color'
- id: rio_stack
class: CommandLineTool
inputs:
- id: tiffs
type:
name: _:f83e7c99-e29f-4a38-bfab-ffd3dbb1009e
items: string
type: array
outputs:
- id: stacked
type: File
outputBinding:
glob: stacked.tif
requirements:
- class: DockerRequirement
dockerPull: ghcr.io/eoap/how-to/rio:1.0.0
- class: EnvVarRequirement
envDef:
- envName: GDAL_TIFF_INTERNAL_MASK
envValue: YES
- envName: GDAL_HTTP_MERGE_CONSECUTIVE_RANGES
envValue: YES
- envName: CPL_VSIL_CURL_ALLOWED_EXTENSIONS
envValue: .tif
- class: InitialWorkDirRequirement
listing:
- entryname: run.sh
entry: |-
#!/bin/bash
rio stack $@
cwlVersion: v1.2
baseCommand:
- /bin/bash
- run.sh
arguments:
- valueFrom: |
${
var arr = [];
for(var i=0; i<inputs.tiffs.length; i++) {
arr.push(inputs.tiffs[i]);
}
return arr;
}
- stacked.tif
- id: rio_color
class: CommandLineTool
inputs:
- id: stacked
type: File
outputs:
- id: rgb
type: File
outputBinding:
glob: rgb.tif
requirements:
- class: DockerRequirement
dockerPull: ghcr.io/eoap/how-to/rio:1.0.0
- class: InitialWorkDirRequirement
listing:
- entryname: run.sh
entry: |-
#!/bin/bash
rio color -j -1 --out-dtype uint8 $1 rgb.tif "gamma 3 0.95, sigmoidal rgb 35 0.13"
cwlVersion: v1.2
baseCommand:
- /bin/bash
- run.sh
arguments:
- $( inputs.stacked.path )