Getting Started
Workflows take the form of OGC Application Packages which include a Common Workflow Language (CWL) script that defines the step(s) to be computed within a workflow, also defining outputs from each step as well as the overall inputs and outputs for the workflow. An example CWL script can be found here. This script takes as input a URL to an image file, a function name and a scale factor, as a percentage. It then carries out the specified function on the image, in this case that is a resize by the provided scale factor. This image is then output, along with a STAC catalogue defining the resulting image asset.
Some best practices when creating application packages can be found here and include requirements that a workflow needs to comply with in order to work with the WR API. This includes specifying the type of inputs supported as well as the required output format to successfully work with the WR STAGEOUT steps.
Specific restrictions of note which must be followed:
The Workflow Runner also includes two built-in steps that are run automatically, when required, for each workflow.
{
"stac_version": "1.0.0",
"id": "catalog",
"type": "Catalog",
"description": "Root catalog",
"links": [
{
"type": "application/geo+json",
"rel": "item",
"href": "item.json"
},
{
"type": "application/json",
"rel": "self",
"href": "catalog.json"
}
]
}
And an example of a STAC Feature, item.json, generated from the same workflow:
{
"stac_version": "1.0.0",
"id": " item -1728909682.980245290",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-180, -90],
[-180, 90],
[180, 90],
[180, -90],
[-180, -90]
]
]
},
"properties": {
"created": "2024-10-14T12:41:22.980Z",
"datetime": "2024-10-14T12:41:22.980Z",
"updated": "2024-10-14T12:41:22.980Z"
},
"bbox": [-180, -90, 180, 90],
"assets": {
" item": {
"type": "image/png",
"roles": ["data"],
"href": "item.png",
"file:size": 19133
}
},
"links": [
{
"type": "application/json",
"rel": "parent",
"href": "catalog.json"
},
{
"type": "application/geo+json",
"rel": "self",
"href": "item.json"
},
{
"type": "application/json",
"rel": "root",
"href": "catalog.json"
}
]
}
It is vital that these outputs are generated correctly and are captured in the workflow outputs as the WR uses the links in these files to ensure the outputs are captured and harvested into the Resource Catalogue.
Note, for the time being Collections need not be generated by the workflow, as a Collection is automatically generated in the STAGEOUT step and it is this Collection, “col_{job_id}” that will be ingested into the User Workspace Catalogue. Any Collections will not be used in the STAGEOUT step and should not be generated at this time.