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
* Remove directInvoke
Signed-off-by: Jorgen Johnson <[email protected]>
* Redefine schedule.interval to be about scheduled execution of workflows (rather than about limiting when workflows can be invoked)
Signed-off-by: Jorgen Johnson <[email protected]>
* Integrate PR feedback
Signed-off-by: Jorgen Johnson <[email protected]>
Co-authored-by: Jorgen Johnson <[email protected]>
Copy file name to clipboardExpand all lines: schema/workflow.json
+7-12Lines changed: 7 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -138,9 +138,9 @@
138
138
"exectimeout": {
139
139
"type": "object",
140
140
"properties": {
141
-
"interval": {
141
+
"duration": {
142
142
"type": "string",
143
-
"description": "Timeout interval (ISO 8601 duration format)",
143
+
"description": "Timeout duration (ISO 8601 duration format)",
144
144
"minLength": 1
145
145
},
146
146
"interrupt": {
@@ -155,7 +155,7 @@
155
155
}
156
156
},
157
157
"required": [
158
-
"interval"
158
+
"duration"
159
159
]
160
160
},
161
161
"transition": {
@@ -1550,7 +1550,7 @@
1550
1550
"minLength": 1
1551
1551
},
1552
1552
"schedule": {
1553
-
"description": "Define the time/repeating intervals or cron at which workflow instances can/should be started",
1553
+
"description": "Define the time/repeating intervals or cron at which workflow instances should be automatically started.",
1554
1554
"$ref": "#/definitions/schedule"
1555
1555
}
1556
1556
},
@@ -1565,7 +1565,7 @@
1565
1565
"oneOf": [
1566
1566
{
1567
1567
"type": "string",
1568
-
"description": "Time interval (can be repeating) described with ISO 8601 format. Declares when workflow instances can be created.",
1568
+
"description": "Time interval (must be repeating interval) described with ISO 8601 format. Declares when workflow instances will be automatically created. (UTC timezone is assumed)",
1569
1569
"minLength": 1
1570
1570
},
1571
1571
{
@@ -1574,20 +1574,15 @@
1574
1574
"properties": {
1575
1575
"interval": {
1576
1576
"type": "string",
1577
-
"description": "Time interval (ISO 8601 format) describing when workflow instances can be created.",
1577
+
"description": "Time interval (must be repeating interval) described with ISO 8601 format. Declares when workflow instances will be automatically created.",
1578
1578
"minLength": 1
1579
1579
},
1580
1580
"cron": {
1581
1581
"$ref": "#/definitions/crondef"
1582
1582
},
1583
-
"directInvoke": {
1584
-
"description": "Define if workflow instances can be created outside of the defined interval/cron",
1585
-
"type": "boolean",
1586
-
"default": false
1587
-
},
1588
1583
"timezone": {
1589
1584
"type": "string",
1590
-
"description": "Timezone name used to evaluate the cron expression. Not used for interval as timezone can be specified there directly. If not specified, should default to local machine timezone."
1585
+
"description": "Timezone name used to evaluate the interval & cron-expression. (default: UTC)"
| interrupt | If `false`, workflow instance is allowed to finish current execution. If `true`, current workflow execution is stopped immediately. Default is `false` | boolean | no |
733
733
| runBefore | Name of a workflow state to be executed before workflow instance is terminated | string | no |
The `interval` property defines the time interval of the execution timeout. Once a workflow instance is created,
768
+
The `duration` property defines the time duration of the execution timeout. Once a workflow instance is created,
769
769
and the amount of the defined time is reached, the workflow instance should be terminated.
770
770
771
771
The `interrupt` property defines if the currently running instance should be allowed to finish its current
@@ -3107,7 +3107,7 @@ If the start definition is of type `object`, it has the following structure:
3107
3107
| Parameter | Description | Type | Required |
3108
3108
| --- | --- | --- | --- |
3109
3109
| stateName | Name of the starting workflow state | object | yes |
3110
-
| [schedule](#Schedule-Definition) | Define the time/repeating intervals or cron at which workflow instances can/should be started | object | yes |
3110
+
| [schedule](#Schedule-Definition) | Define the time/repeating intervals or cron at which workflow instances should be automatically started. | object | yes |
3111
3111
3112
3112
<details><summary><strong>Click to view example definition</strong></summary>
3113
3113
<p>
@@ -3150,19 +3150,10 @@ If `string` type, it defines the name of the workflow starting state.
3150
3150
If `object` type, it provides the ability to set the workflow starting state name, as well as the `schedule` property.
3151
3151
3152
3152
The `schedule` property allows to define scheduled workflow instance creation.
3153
-
Scheduled starts have two different choices. You can define time-based intervals during which workflow instances are **allowed**
3154
-
to be created (can be repeating), or cron-based times at which a workflow instance **should** be created (automatically).
3153
+
Scheduled starts have two different choices. You can define a repeating interval or cron-based schedule at which a workflow
3154
+
instance **should** be created (automatically).
3155
3155
3156
-
To better explain interval-based scheduled starts, let's say
3157
-
we have a workflow that orchestrates an online auction and should be "available" only from when the auction starts until it ends.
3158
-
Customer bids should only be allowed during this time interval. Bids made before or after the defined time interval should not be allowed.
3159
-
3160
-
There are two cases to discuss when dealing with interval-based scheduled starts:
3161
-
3162
-
1. **Starting States in [Parallel](#Parallel-State) state [branches](#parallel-state-branch)**: if a state in a parallel state branch defines a scheduled start state that is not "active" at the time the branch is executed, the parent workflow should not wait until it becomes active, and just complete the execution of the branch.
3163
-
2. **Starting states in [SubFlow](#SubFlow-State) states**: if a state in a workflow definition (referenced by SubFlow state) defines a scheduled start state that is not "active" at the time the SubFlow state is executed, the parent workflow should not wait until it becomes active, and just complete the execution of the SubFlow state.
3164
-
3165
-
You can also define cron-based scheduled starts, which allow to define periodically started workflow instances based on a [cron](http://crontab.org/) definition.
3156
+
You can also define cron-based scheduled starts, which allows you to specify periodically started workflow instances based on a [cron](http://crontab.org/) definition.
3166
3157
Cron-based scheduled starts can handle absolute time intervals (i.e., not calculated in respect to some particular point in time).
3167
3158
One use case for cron-based scheduled starts is a workflow that performs periodical data batch processing.
3168
3159
In this case we could use a cron definition
@@ -3192,22 +3183,21 @@ the needed events at the defined times to trigger workflow instance creation.
3192
3183
#### Schedule Definition
3193
3184
3194
3185
`Schedule`definition can have two types, either `string` or `object`.
3195
-
If `string` type, it defines time interval describing when the workflow instance can be created.
3186
+
If `string` type, it defines time interval describing when the workflow instance should be automatically created.
3196
3187
This can be used as a short-cut definition when you don't need to define any other parameters, for example:
If you need to define the `cron`, `directInvoke` or the `timezone` parameters in your `schedule` definition, you can define
3193
+
If you need to define the `cron` or the `timezone` parameters in your `schedule` definition, you can define
3203
3194
it with its `object` type which has the following properties:
3204
3195
3205
3196
| Parameter | Description | Type | Required |
3206
3197
| --- | --- | --- | --- |
3207
-
| interval | Time interval (can be repeating) described with ISO 8601 format. Declares when workflow instances can be created | string | yes if `cron` not defined |
3198
+
| interval | Time interval (must be repeating interval) described with ISO 8601 format. Declares when workflow instances will be automatically created. | string | yes if `cron` not defined |
3208
3199
| [cron](#Cron-Definition) | Cron expression defining when workflow instances should be created (automatically) | object | yes if `interval` not defined |
3209
-
| directInvoke | Defines if workflow instances can be created outside of the interval/cron interval. Default value is `false` | boolean | no |
3210
-
| timezone | Timezone name (for example "America/Los_Angeles") used to evaluate the cron expression against. Not used for `interval` property as timezone can be specified there directly. If not specified, should default to local machine timezone | string | no |
3200
+
| timezone | Timezone name used to evaluate the interval & cron-expression. If the interval specifies a date-time w/ timezone then proper timezone conversion will be applied. (default: UTC). | string | no |
3211
3201
3212
3202
<details><summary><strong>Click to view example definition</strong></summary>
3213
3203
<p>
@@ -3222,8 +3212,7 @@ it with its `object` type which has the following properties:
3222
3212
3223
3213
```json
3224
3214
{
3225
-
"cron": "0 0/15 * * * ?",
3226
-
"directInvoke": true
3215
+
"cron": "0 0/15 * * * ?"
3227
3216
}
3228
3217
```
3229
3218
@@ -3232,7 +3221,6 @@ it with its `object` type which has the following properties:
3232
3221
3233
3222
```yaml
3234
3223
cron: 0 0/15 * * * ?
3235
-
directInvoke: true
3236
3224
```
3237
3225
3238
3226
</td>
@@ -3241,31 +3229,27 @@ directInvoke: true
3241
3229
3242
3230
</details>
3243
3231
3244
-
The `interval` property uses the ISO 8601 time interval format (can be repeating) to describe when workflow instances are allowed be created.
3245
-
There is a number of ways to express the time interval:
3232
+
The `interval` property uses the ISO 8601 time repeating interval format to describe when workflow instances will be automatically created.
3233
+
There are a number of supported ways to express the repeating interval:
3246
3234
3247
-
1. **Start** + **End**: Defines the start and end time, for example "2020-03-20T13:00:00Z/2021-05-11T15:30:00Z", meaning workflow instances can be
3248
-
created from March 20th 2020 at 1PM UTC until May 11th 2021 at 3:30pm UTC.
3249
-
2. **Start** + **Duration**: Defines the start time and the duration, for example: "2020-03-20T13:00:00Z/P1Y2M10DT2H30M", meaning workflow instances can be created
3250
-
from March 20th 2020 at 1pm UTC and continue to do so for 1 year, 2 months, 10 days 2 hours and 30 minutes.
3251
-
3. **Duration** + **End**: Defines the duration and an end, for example: "P1Y2M10DT2H30M/2020-05-11T15:30:00Z", meaning that workflow instances can be created from
3252
-
when the first instance is created until 1 year, 2 months, 10 days 2 hours and 30 minutes from that time, or until May 11th 2020 at 3:30PM UTC, whichever comes first.
3253
-
4. **Duration**: Defines the duration only, for example: ""P1Y2M10DT2H30M"", meaning workflow instances can be created for 1 year, 2 months, 10 days 2 hours and 30 minutes
3254
-
from the time the first instance is created.
3235
+
1. `R/<Start>/<Duration>`: Defines the start time and a duration, for example: "R/2020-03-20T13:00:00Z/PT2H", meaning workflow
3236
+
instances will be automatically created every 2 hours starting from March 20th 2020 at 1pm UTC.
3237
+
2. `R/<Duration>/<End>`: Defines a duration and an end, for example: "R/PT2H/2020-05-11T15:30:00Z", meaning that workflow instances will be
3238
+
automatically created every 2 hours until until May 11th 2020 at 3:30PM UTC.
3239
+
3. `R/<Duration>`: Defines a duration only, for example: "R/PT2H", meaning workflow instances will be automatically created every 2 hours.
3255
3240
3256
3241
The `cron` property uses a [cron expression](http://crontab.org/)
3257
-
to describe a repeating interval upon which a workflow instance should be created (automatically).
3242
+
to describe a repeating interval upon which a workflow instance should be created automatically.
3258
3243
For more information see the [cron definition](#Cron-Definition) section.
3259
3244
3260
-
The `timezone` property is used to define a time zone name to evaluate the cron expression against. If not specified, it should default to the local
3261
-
machine time zone. See [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of timezone names.
3245
+
The `timezone` property is used to define a time zone name to evaluate the cron or interval expression against. If not specified, it should default
3246
+
to UTC time zone. See [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of timezone names. For ISO 8601 date time
3247
+
values in `interval` or `cron.validUntil`, runtimes should treat `timezone` as the 'local time' (UTC if `interval` is not defined by the user).
3262
3248
3263
3249
Note that when the workflow starting state is an [Event](#Event-State)
3264
3250
defining cron-based scheduled starts for the runtime implementations would mean that there needs to be an event service that issues
3265
3251
the needed events at the defined times to trigger workflow instance creation.
3266
3252
3267
-
The `directInvoke` property defines if workflow instances are allowed to be created outside of the defined interval or cron expression.
3268
-
3269
3253
#### Cron Definition
3270
3254
3271
3255
`Cron`definition can have two types, either `string` or `object`.
0 commit comments