You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification.md
+25-17Lines changed: 25 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1769,6 +1769,7 @@ definition "id" must be a constant value.
1769
1769
| version | Workflow version. MUST respect the [semantic versioning](https://semver.org/) format | string | no |
1770
1770
| annotations | List of helpful terms describing the workflows intended purpose, subject areas, or other important qualities | array | no |
1771
1771
| dataInputSchema | Used to validate the workflow data input against a defined JSON Schema| string or object | no |
1772
+
| dataOutputSchema | Used to validate the workflow data output against a defined JSON Schema| string or object | no |
1772
1773
| [constants](#Workflow-Constants) | Workflow constants | string or object | no |
1773
1774
| [secrets](#Workflow-Secrets) | Workflow secrets | string or array | no |
1774
1775
| [start](#Start-Definition) | Workflow start definition | string or object | no |
@@ -1859,22 +1860,33 @@ The `version` property can be used to provide a specific workflow version. It mu
1859
1860
The `annotations` property defines a list of helpful terms describing the workflows intended purpose, subject areas, or other important qualities,
1860
1861
for example "machine learning", "monitoring", "networking", etc
1861
1862
1862
-
The `dataInputSchema` property can be used to validate the workflow data input against a defined JSON Schema.
1863
-
This check should be done before any states are executed. `dataInputSchema` can have two different types.
1864
-
If it is an object type it has the following definition:
1863
+
The `dataInputSchema` and `dataOutputSchema` properties can be used to validate input and output data against a defined JSON Schema.
1864
+
1865
+
The `dataInputSchema` property validates the [workflow data input](#Workflow-Data-Input). Validation should be performed before any states are executed. In case of
1866
+
a start [Event state](#Event-state) the input schema is ignored, if present. The `failOnValidationErrors` property determines if workflow execution should continue in case of validation errors.
1867
+
1868
+
The `dataOutputSchema` property validates the [Workflow data output](#workflow-data-output). Validation is performed on the output of the workflow execution.
1869
+
The `failOnValidationErrors` property determines what should be done when the workflow output does not match the provided schema.
1870
+
If `failOnValidationErrors` is true, an error should be thrown. If executed within a subprocess, that error can be be handled by the parent workflow.
1871
+
If `failOnValidationErrors` is false, the error should not be propagated. It is up to the implementor to warn the user about that fact. For example, printing a log.
1872
+
1873
+
Both properties can be expressed as object or string type.
1874
+
1875
+
If using object type, their `schema` property might be an URI, which points to the JSON schema used to validate the workflow data input, or it might be the JSON schema object. `failOnValidationErrors` is optional, default value is `true`.
1876
+
1877
+
Example for Json schema reference
1865
1878
1866
1879
```json
1867
1880
"dataInputSchema": {
1868
-
"schema": "URL_to_json_schema",
1881
+
"schema": "URI to json schema",
1869
1882
"failOnValidationErrors": false
1870
1883
}
1871
1884
```
1872
1885
1873
-
It's `schema` property can be an URI, which points to the JSON schema used to validate the workflow data input, or it can be the JSON schema object.
1874
-
If it's a JSON schema object, it has the following definition:
1886
+
Example for Json schema included in the workflow file
1875
1887
1876
1888
```json
1877
-
"dataInputSchema": {
1889
+
"dataOutputSchema": {
1878
1890
"schema": {
1879
1891
"title": "MyJSONSchema",
1880
1892
"properties":{
@@ -1886,22 +1898,18 @@ If it's a JSON schema object, it has the following definition:
1886
1898
}
1887
1899
}
1888
1900
},
1889
-
"failOnValidationErrors": false
1901
+
"failOnValidationErrors": true
1890
1902
}
1891
1903
1892
1904
```
1893
-
It' `failOnValidationErrors` property determines if workflow execution should continue in case of validation
1894
-
errors. The default value of `failOnValidationErrors` is `true`.
1895
-
If `dataInputSchema` has the string type, it has the following definition:
1896
1905
1897
-
```json
1898
-
"dataInputSchema": "URL_to_json_schema"
1899
-
```
1906
+
If using string type, then the string value is the external schema URI and `failOnValidationErrors` default value of `true` is assumed.
1900
1907
1901
-
In this case the `failOnValidationErrors` default value of `true` is assumed.
1908
+
Example using string type
1902
1909
1903
-
The `dataInputSchema` property validates the [workflow data input](#Workflow-Data-Input). In case of
1904
-
a starting [Event state](#Event-state), it is not used to validate its event payloads.
1910
+
```json
1911
+
"dataInputSchema": "URI_to_json_schema"
1912
+
```
1905
1913
1906
1914
The `secrets` property allows you to use sensitive information such as passwords, OAuth tokens, ssh keys, etc. inside your
0 commit comments