Skip to content

Commit 907c659

Browse files
committed
refine propagation design of TimeSkippingConfig
1 parent b9a414c commit 907c659

3 files changed

Lines changed: 39 additions & 28 deletions

File tree

openapi/openapiv2.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17134,9 +17134,9 @@
1713417134
"type": "boolean",
1713517135
"description": "Enables or disables time skipping for this workflow execution."
1713617136
},
17137-
"disablePropagation": {
17137+
"disableChildWorkflowPropagation": {
1713817138
"type": "boolean",
17139-
"description": "By default, the time skipping configuration is propagated to transitively related workflows.\nIf set, transitively related workflows will be started with time skipping disabled."
17139+
"description": "By default, the time skipping configuration (enabled and bound) is propagated to child workflows,\nusing the same values as the parent workflow.\nIf set, child workflows will be started with time skipping disabled.\nRegardless of this field, the start time of the child workflow uses the parent's virtual time."
1714017140
},
1714117141
"maxSkippedDuration": {
1714217142
"type": "string",
@@ -17150,6 +17150,10 @@
1715017150
"type": "string",
1715117151
"format": "date-time",
1715217152
"description": "Absolute virtual timestamp at which time skipping is disabled.\nTime skipping will not advance beyond this point."
17153+
},
17154+
"propagatedSkippedDuration": {
17155+
"type": "string",
17156+
"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."
1715317157
}
1715417158
},
1715517159
"description": "Configuration for time skipping during a workflow execution.\nWhen enabled, virtual time advances automatically whenever there is no in-flight work.\nIn-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\nand possibly other features added in the future.\nUser timers are not classified as in-flight work and will be skipped over.\nWhen time advances, it skips to the earlier of the next user timer or the configured bound, if either exists."

openapi/openapiv3.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15110,11 +15110,13 @@ components:
1511015110
enabled:
1511115111
type: boolean
1511215112
description: Enables or disables time skipping for this workflow execution.
15113-
disablePropagation:
15113+
disableChildWorkflowPropagation:
1511415114
type: boolean
1511515115
description: |-
15116-
By default, the time skipping configuration is propagated to transitively related workflows.
15117-
If set, transitively related workflows will be started with time skipping disabled.
15116+
By default, the time skipping configuration (enabled and bound) is propagated to child workflows,
15117+
using the same values as the parent workflow.
15118+
If set, child workflows will be started with time skipping disabled.
15119+
Regardless of this field, the start time of the child workflow uses the parent's virtual time.
1511815120
maxSkippedDuration:
1511915121
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
1512015122
type: string
@@ -15131,6 +15133,12 @@ components:
1513115133
Absolute virtual timestamp at which time skipping is disabled.
1513215134
Time skipping will not advance beyond this point.
1513315135
format: date-time
15136+
propagatedSkippedDuration:
15137+
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
15138+
type: string
15139+
description: |-
15140+
If this execution was started by a previous execution that already skipped some time,
15141+
it inherits the virtual time through the propagated skipped duration.
1513415142
description: |-
1513515143
Configuration for time skipping during a workflow execution.
1513615144
When enabled, virtual time advances automatically whenever there is no in-flight work.

temporal/api/workflow/v1/message.proto

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -590,36 +590,30 @@ 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.
595597
bool enabled = 1;
596598

597-
// By default, the time skipping configuration is propagated to transitively related workflows.
598-
// If set, transitively related workflows will be started with time skipping disabled.
599-
bool disable_propagation = 2;
599+
// By default, the time skipping configuration (enabled and bound) is propagated to child workflows,
600+
// using the same values as the parent workflow.
601+
// If set, child workflows will be started with time skipping disabled.
602+
// Regardless of this field, the start time of the child workflow uses the parent's virtual time.
603+
bool disable_child_workflow_propagation = 3;
600604

601-
// Optional bound that limits how long time skipping remains active.
602-
// Once the bound is reached, time skipping is automatically disabled.
603-
// It can later be re-enabled via UpdateWorkflowExecutionOptions.
605+
// Optional bound that limits how far virtual time can advance while time skipping is active.
606+
// Once the bound is reached, time skipping is automatically disabled,
607+
// but can be re-enabled via UpdateWorkflowExecutionOptions.
604608
//
605-
// This is particularly useful in testing scenarios where workflows
606-
// are expected to receive signals, updates, or other events while
607-
// timers are in progress.
609+
// This is useful in testing scenarios where a workflow is expected to receive
610+
// signals, updates, or other external events while timers are in progress.
608611
//
609-
// The bound is propagated to transitively related workflows differently
610-
// depending on the type and semantics of the related workflow:
611-
// - Child workflows: the bound is propagated with the same value as the
612-
// parent workflow, and the child begins execution at the parent's virtual
613-
// time. If the bound is duration-based, each child calculates its skipped
614-
// duration independently from its own start.
615-
//
616-
// - Continue-as-new workflows: the bound is propagated with the same value
617-
// as the previous workflow. If the bound is duration-based, the
618-
// continue-as-new workflow shares the accumulated duration with the
619-
// previous workflow.
620-
//
621-
// - Reset workflows: the entire TimeSkippingConfig is restored to the value
622-
// it had at the event this workflow was reset to.
612+
// Bound scope:
613+
// - Each bound is independent for each workflow execution.
614+
// When a bound is propagated to a child workflow, the child's bound is only applied to that child execution.
615+
// - Continue-as-new is an exception: continued workflow executions are treated as extensions of the
616+
// original execution, so the bound is shared across all executions in the chain.
623617
oneof bound {
624618

625619
// Maximum total virtual time that can be skipped.
@@ -634,6 +628,11 @@ message TimeSkippingConfig {
634628
// Time skipping will not advance beyond this point.
635629
google.protobuf.Timestamp max_target_time = 6;
636630
}
631+
632+
// If this execution was started by a previous execution that already skipped some time,
633+
// it inherits the virtual time through the propagated skipped duration.
634+
google.protobuf.Duration propagated_skipped_duration = 7;
635+
637636
}
638637

639638
// Used to override the versioning behavior (and pinned deployment version, if applicable) of a

0 commit comments

Comments
 (0)