Skip to content

Commit 729f74b

Browse files
Adding action condition (#531)
* Adding action condition 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 b749530 commit 729f74b

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ _Status description:_
3030
| ✔️| Added "resultEventTimeout" for action eventref | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
3131
| ✔️| Added example for "continueAs" | [examples doc](https://github.com/serverlessworkflow/specification/blob/main/examples/README.md) |
3232
| ✔️️| Support for async action invocation | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
33+
| ✔️️| Support for action condition | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
3334
| ✏️️| Add "completedBy" functionality | |
3435
| ✏️️| Define workflow context | |
3536
| ✏️️| Start work on TCK | |

schema/workflow.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@
468468
"actionDataFilter": {
469469
"description": "Action data filter",
470470
"$ref": "#/definitions/actiondatafilter"
471+
},
472+
"condition": {
473+
"description": "Expression, if defined, must evaluate to true for this action to be performed. If false, action is disregarded",
474+
"type": "string",
475+
"minLength": 1
471476
}
472477
},
473478
"additionalProperties": false,

specification.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,7 @@ This is visualized in the diagram below:
37323732
| retryableErrors | List of references to defined [workflow errors](#Defining Errors) for which the action should be retried. Used only when `autoRetries` is set to `false` | array | no |
37333733
| [actionDataFilter](#Action-data-filters) | Action data filter definition | object | no |
37343734
| sleep | Defines time periods workflow execution should sleep before / after function execution | object | no |
3735+
| [condition](#Workflow-Expressions) | Expression, if defined, must evaluate to true for this action to be performed. If false, action is disregarded | boolean | no |
37353736

37363737
<details><summary><strong>Click to view example definition</strong></summary>
37373738
<p>
@@ -3810,6 +3811,10 @@ The `retryableErrors` property is a list that references one or more unique name
38103811
This is the list of known errors for which the action should be retried for.
38113812
It should be used only when the workflow top-level `autoRetries` property is set to `false`.
38123813

3814+
The `condition` property is a [workflow expression](#Workflow-Expressions). If defined, it must evaluate to `true`
3815+
for this action to be performed. If it evaluates to `false` the action is skipped.
3816+
If the `condition` property is not defined, the action is always performed.
3817+
38133818
##### Subflow Action
38143819

38153820
Often you want to group your workflows into small logical units that solve a particular business problem and can be reused in

0 commit comments

Comments
 (0)