opengeospatial / opengeospatial/ogcapi-processes
Part 3 Deployable Workflows - Analysis and Proposals
Nobody has claimed this yet.
- Dominant language
- AsciiDoc
- Stars
- 63
- Forks
- 46
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 8
Description
The Part 3: Deployable Workflows proposes an alternate deployment definition based on an execution body, trying to bridge Part 1/2/3.
I would like to validate my understanding of it, and propose adjustments to improve alignments (as applicable).
Since there are 2 variants for deployment, the 2 are analyzed separately, but using an equivalent workflow example.
Variant 1: Direct Deployment with Execution Body
Analysis
POST /processes
Content-Type: application/ogc-workflow+json
{
"id": "DeployWorkflow",
"version": "1.0",
"process": "https://example.com/proceses/MainProcess",
"inputs": {
"main-in": {
"process": "https://example.com/proceses/NestedProcess",
"inputs": {
"arg": { "$input": "wf-input" }
}
}
},
"outputs": {
"out": { "$output": "wf-output" }
}
}
A new process named DeployWorkflow with input wf-input and output wf-output would be created.
The schema definition of wf-input would be the same as the one of arg from NestedProcess, whereas the schema of the wf-output would be equivalent to out of MainProcess.
Proposals
-
Add an
idfield, which is not present inprocesses-workflows/execute-workflows.yaml.- It is normal that
idwas missing considering it is not required for execution only.
However, some process ID is needed to perform the deployment.
- It is normal that
-
Alternatively to
id, reuse?w=<id>query (https://github.com/opengeospatial/ogcapi-processes/blob/master/openapi/parameters/processes-dru/w-param.yaml)- This has the advantage to reuse the same
processes-workflows/execute-workflows.yamldefinition without any modification. However, debatable whether it is intuitive or not.
- This has the advantage to reuse the same
-
Other required parameter
versionfrom Part 1 needs to be added.
Since there is no equivalent query parameter, so it might be better to have the Part 3: Deployable Workflows schema be a
oneOf[ process-core/processSummary, processes-workflows/execute-workflows ]This should be added to OpenAPI path
/processes. -
Introduce
application/ogc-workflow+json(or some equivalent) to distinguish from other deployment structures already supported (CWL, OGC App Pkg, etc.). -
This variant doesn't indicate how additional metadata for the resolved
wf-inputandwf-outputcan be defined.
Recommendations to had to the document, either:- Consider this acceptable, meaning that they copy entirely what
arg/outdefined, nothing more, nothing less. - Allow additional properties to be indicated next to
$input/$outputto extend/override whatarg/outprovide. - Recommend to use Variant 2 instead for this use case.
- Consider this acceptable, meaning that they copy entirely what
Variant 2: Embedded Deployment of Execution Body in Execution Unit
Analysis
POST /processes
Content-Type: application/ogcapppkg+json
{
"processDescription": {
"id": "DeployWorkflow",
"version": "1.0"
},
"executionUnit": {
"format": { "mediaType": "application/ogc-workflow+json" },
"value": {
"process": "https://example.com/proceses/MainProcess",
"inputs": {
"main-in": {
"process": "https://example.com/proceses/NestedProcess",
"inputs": {
"arg": { "$input": "wf-input" }
}
}
},
"outputs": {
"out": { "$output": "wf-output" }
}
}
}
}
Proposals
-
Because
wf-input/argandwf-output/outschemas should be aligned to be mapped correctly, redefininginputsandoutputswith schemas explicitly inprocessDescriptionis redundant. However, this would not be disallowed according toprocesses-core/process.yaml.-
Recommendations should be given in the standard document about this case.
More specifically,
processDescription.inputsandprocessDescription.outputscould be relevant to provide additional details, such asprocess-core/descriptionType.yamlmetadata properties.
However, adding anyinputs/outputsthere would fail validation if theschemais omitted, since it is required in their definitions. Because of this, we end up going back to redundantschemadefinitions mentioned above.
Possible recommendations:
-
Use
{ "inputs": { "wf-input": { "title": "Workflow Input", "schema": {} } } }And indicate that
schemashould be inferred by$inputin this deployment use case. -
Recommend to explicitly reference the schema:
{ "inputs": { "wf-input": { "title": "Workflow Input", "schema": {"$ref": "https://example.com/proceses/NestedProcess#/inputs/arg/schema"} } } }
-
-
If Part 3: Fields Modifiers are thrown in the mix of Deployable Workflows, notably for the
wf-inputandwf-output, then theschemamapping betweenwf-input/argandwf-output/outcould actually differ entirely.In this case, contrary to previous (1),
schemaunderprocessDescription.inputsandprocessDescription.outputscould become mandatory. This is because, without any reference schema fromDeployWorkflow(yet to be deployed), the workflow could be validated if they were omitted, since there would be no indication of the intended source and desired result for field-modifedwf-input/wf-output. -
Improve the description of Part 3: Deployable Workflows regarding media-type.
The requirement mentions usingapplication/ogcapppkg+json, but this can easily be confused with the case whereprocesses-dru/executionUnit.yamlis employed directly.
When an embedded execution unit definition is used, it is preferable to employ the qualified value withapplication/ogc-workflow+jsonto avoid ambiguity about the package contents (or use Variant 1 directly instead).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Deployable Workflows and Fields Modifiers sections, then compare processes-workflows/execute-workflows.yaml, processes-core/process.yaml, process-core/descriptionType.yaml, processes-dru/executionUnit.yaml, and processes-dru/w-param.yaml. Review both deployment variants and their media types. Done means the alternatives and schema or documentation changes have been resolved consistently in the standard and OpenAPI definitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, openapi
- Domain
- api, backend-api-design, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100