Skip to content

Commit 27475f8

Browse files
committed
rm the flexibility of disable propagation for simplicity
and add propagated_skipped_duration to propagate virtual time
1 parent 0460021 commit 27475f8

4 files changed

Lines changed: 37 additions & 23 deletions

File tree

openapi/openapiv2.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16756,6 +16756,10 @@
1675616756
"priority": {
1675716757
"$ref": "#/definitions/v1Priority",
1675816758
"title": "Priority metadata"
16759+
},
16760+
"timeSkippingConfig": {
16761+
"$ref": "#/definitions/v1TimeSkippingConfig",
16762+
"description": "The propagated time-skipping config for the child workflow."
1675916763
}
1676016764
}
1676116765
},
@@ -17128,11 +17132,11 @@
1712817132
"properties": {
1712917133
"enabled": {
1713017134
"type": "boolean",
17131-
"description": "Enables or disables time skipping for this workflow execution.\nBy default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \nat the time they are started.\nChanges made after a transitively related workflow has started are not propagated."
17135+
"description": "Enables or disables time skipping for this workflow execution."
1713217136
},
17133-
"disablePropagation": {
17134-
"type": "boolean",
17135-
"description": "If set, the enabled field is not propagated to transitively related workflows."
17137+
"propagatedSkippedDuration": {
17138+
"type": "string",
17139+
"description": "If this execution was started by a previous execution that already skipped some time,\nit inherits the virtual time through the propagated skipped duration."
1713617140
},
1713717141
"maxSkippedDuration": {
1713817142
"type": "string",

openapi/openapiv3.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14549,6 +14549,10 @@ components:
1454914549
allOf:
1455014550
- $ref: '#/components/schemas/Priority'
1455114551
description: Priority metadata
14552+
timeSkippingConfig:
14553+
allOf:
14554+
- $ref: '#/components/schemas/TimeSkippingConfig'
14555+
description: The propagated time-skipping config for the child workflow.
1455214556
StartWorkflowExecutionRequest:
1455314557
type: object
1455414558
properties:
@@ -15103,10 +15107,13 @@ components:
1510315107
properties:
1510415108
enabled:
1510515109
type: boolean
15106-
description: "Enables or disables time skipping for this workflow execution.\n By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \n at the time they are started.\n Changes made after a transitively related workflow has started are not propagated."
15107-
disablePropagation:
15108-
type: boolean
15109-
description: If set, the enabled field is not propagated to transitively related workflows.
15110+
description: Enables or disables time skipping for this workflow execution.
15111+
propagatedSkippedDuration:
15112+
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
15113+
type: string
15114+
description: |-
15115+
If this execution was started by a previous execution that already skipped some time,
15116+
it inherits the virtual time through the propagated skipped duration.
1511015117
maxSkippedDuration:
1511115118
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
1511215119
type: string

temporal/api/history/v1/message.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
770770
bool inherit_build_id = 19 [deprecated = true];
771771
// Priority metadata
772772
temporal.api.common.v1.Priority priority = 20;
773+
774+
// The propagated time-skipping config for the child workflow.
775+
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 21;
773776
}
774777

775778
message StartChildWorkflowExecutionFailedEventAttributes {

temporal/api/workflow/v1/message.proto

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -590,28 +590,28 @@ message WorkflowExecutionOptions {
590590
// User timers are not classified as in-flight work and will be skipped over.
591591
// When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.
592592
message TimeSkippingConfig {
593+
reserved 2;
594+
reserved "disable_propagation";
593595

594596
// Enables or disables time skipping for this workflow execution.
595-
// By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset)
596-
// at the time they are started.
597-
// Changes made after a transitively related workflow has started are not propagated.
598597
bool enabled = 1;
599598

600-
// If set, the enabled field is not propagated to transitively related workflows.
601-
bool disable_propagation = 2;
599+
// If this execution was started by a previous execution that already skipped some time,
600+
// it inherits the virtual time through the propagated skipped duration.
601+
google.protobuf.Duration propagated_skipped_duration = 3;
602602

603-
// Optional bound that limits how long time skipping remains active.
604-
// Once the bound is reached, time skipping is automatically disabled.
605-
// It can later be re-enabled via UpdateWorkflowExecutionOptions.
603+
// Optional bound that limits how far virtual time can advance while time skipping is active.
604+
// Once the bound is reached, time skipping is automatically disabled,
605+
// but can be re-enabled via UpdateWorkflowExecutionOptions.
606606
//
607-
// This is particularly useful in testing scenarios where workflows
608-
// are expected to receive signals, updates, or other events while
609-
// timers are in progress.
607+
// This is useful in testing scenarios where a workflow is expected to receive
608+
// signals, updates, or other external events while timers are in progress.
610609
//
611-
// This bound is not propagated to transitively related workflows.
612-
// When bound is also needed for transitively related workflows,
613-
// it is recommended to set disable_propagation to true
614-
// and configure TimeSkippingConfig explicitly for transitively related workflows.
610+
// Bound scope:
611+
// - Each bound is independent for each workflow execution.
612+
// When a bound is propagated to a child workflow, the child's bound is only applied to that child execution.
613+
// - Continue-as-new is an exception: continued workflow executions are treated as extensions of the
614+
// original execution, so the bound is shared across all executions in the chain.
615615
oneof bound {
616616

617617
// Maximum total virtual time that can be skipped.

0 commit comments

Comments
 (0)