Skip to content

Commit b747a3c

Browse files
Add explanation for additional properties (#343)
* Add explanation for additional properties Signed-off-by: Tihomir Surdilovic <[email protected]> * Update specification.md Co-authored-by: Ricardo Zanini <[email protected]> Co-authored-by: Ricardo Zanini <[email protected]>
1 parent 2c21817 commit b747a3c

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ _Status description:_
2525
| ✔️| Replaced SubFlow state with subflow action type | [spec doc](../specification.md) |
2626
| ✔️| Add workflow `dataInputSchema` property | [spec doc](../specification.md) |
2727
| ✔️| Rename switch state `default` to `defaultCondition` to avoid keyword conflicts for SDK's | [spec doc](../specification.md) |
28+
| ✔️| Add description of additional properties | [spec doc](../specification.md) |
2829
| 🚩 | Workflow invocation bindings | |
2930
| 🚩 | CE Subscriptions & Discovery | |
3031
| 🚩 | Error types | [issue](https://github.com/serverlessworkflow/specification/issues/200) |

specification.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ definition "id" must be a constant value.
13941394
| [functions](#Function-Definition) | Workflow function definitions. Can be either inline function definitions (if array) or URI pointing to a resource containing json/yaml function definitions (if string) | array or string| no |
13951395
| [retries](#Retry-Definition) | Workflow retries definitions. Can be either inline retries definitions (if array) or URI pointing to a resource containing json/yaml retry definitions (if string) | array or string| no |
13961396
| [states](#State-Definition) | Workflow states | array | yes |
1397-
| [metadata](#Workflow-Metadata) | Metadata information| object | no |
1397+
| [metadata](#Workflow-Metadata) | Metadata information | object | no |
13981398

13991399
<details><summary><strong>Click to view example definition</strong></summary>
14001400
<p>
@@ -1591,6 +1591,52 @@ This allows you to explicitly model workflows where an instance should be kept a
15911591

15921592
You can reference the [specification examples](#Examples) to see the `keepActive` property in action.
15931593

1594+
#### Additional Properties
1595+
1596+
Specifying additional properties, namely properties which are not defined by the specification
1597+
are only allowed in the [Workflow Definition](#Workflow-Definition-Structure).
1598+
Additional properties serve the same purpose as [Workflow Metadata](#Workflow-Metadata).
1599+
They allow you to enrich the workflow definition with custom information.
1600+
1601+
Additional properties, just like workflow metadata, should not affect workflow execution.
1602+
Implementations may choose to use additional properties or ignore them.
1603+
1604+
It is recommended to use workflow metadata instead of additional properties in the workflow definition.
1605+
1606+
Let's take a look at an example of additional properties:
1607+
1608+
```json
1609+
{
1610+
"id": "myworkflow",
1611+
"version": "1.0",
1612+
"name": "My Test Workflow",
1613+
"start": "My First State",
1614+
"loglevel": "Info",
1615+
"environment": "Production",
1616+
"category": "Sales",
1617+
"states": [ ... ]
1618+
}
1619+
```
1620+
1621+
In this example, we specify the `loglevel`, `environment`, and `category` additional properties.
1622+
1623+
Note the same can be also specified using workflow metadata, which is the preferred approach:
1624+
1625+
```json
1626+
{
1627+
"id": "myworkflow",
1628+
"version": "1.0",
1629+
"name": "Py Test Workflow",
1630+
"start": "My First State",
1631+
"metadata": {
1632+
"loglevel": "Info",
1633+
"environment": "Production",
1634+
"category": "Sales"
1635+
},
1636+
"states": [ ... ]
1637+
}
1638+
```
1639+
15941640
#### ExecTimeout Definition
15951641

15961642
| Parameter | Description | Type | Required |

0 commit comments

Comments
 (0)