diff --git a/Makefile b/Makefile index dc8ab5025..02aaeeb41 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ $(PROTO_OUT): mkdir $(PROTO_OUT) ##### Compile proto files for go ##### -grpc: buf-lint api-linter buf-breaking clean go-grpc fix-path +grpc: buf-lint api-linter clean go-grpc fix-path go-grpc: clean $(PROTO_OUT) printf $(COLOR) "Compile for go-gRPC..." diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index da89fac56..cab0b27c3 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -19281,9 +19281,9 @@ "$ref": "#/definitions/v1TimeSkippingConfig", "description": "The propagated time-skipping configuration for the child workflow." }, - "initialSkippedDuration": { - "type": "string", - "description": "Propagate the duration skipped to the child workflow." + "timeSkippingStatePropagation": { + "$ref": "#/definitions/v1TimeSkippingStatePropagation", + "description": "The time-skipping state propagated from the parent workflow. This can be nil if no time skipping\nhas occurred or there is no previous run." } } }, @@ -19674,16 +19674,31 @@ "type": "boolean", "description": "Enables or disables time skipping for this workflow execution." }, - "maxSkippedDuration": { + "fastForward": { + "type": "string", + "description": "Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.\nWhen the fast-forward completes, time skipping is disabled by the call that initiated the fast-forward, and this\naction is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by\nsetting `enabled` to true via UpdateWorkflowExecutionOptions.\nThe current workflow execution is a chain of runs (retries, cron, continue-as-new);\nchild workflows are separate executions, so this fast_forward won't affect them.\n\nFor a given workflow execution, only one active fast-forward is allowed at a time.\nIf a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous\none completes, the new one will override the previous one.\nIf the fast-forward duration exceeds the remaining execution timeout, time will only\nbe fast-forwarded up to the end of the execution." + }, + "disableChildPropagation": { + "type": "boolean", + "description": "By default, child workflows inherit the \"enabled\" flag when they are started.\nThis flag disables that inheritance." + } + }, + "description": "The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new).\nWhen time skipping is 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; the virtual clock may also skip to the\ntime point of the registered fast forward when there is no in-flight work.\nWhen time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be\nadded to the workflow history to capture the state changes.\n\nFor child workflows, by default, if the parent execution is skipping time, the child execution will also skip time,\nbut a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the\n\"enabled\" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the\nparent execution as its start time." + }, + "v1TimeSkippingStatePropagation": { + "type": "object", + "properties": { + "initialSkippedDuration": { "type": "string", - "description": "Maximum total virtual time that can be skipped." + "description": "The time skipped by the previous execution that started this workflow.\nIt can happen in child workflows and a chain of runs (CaN, cron, retry)." }, - "maxElapsedDuration": { + "fastForwardTargetTime": { "type": "string", - "description": "Maximum elapsed time since time skipping was enabled.\nThis includes both skipped time and real time elapsing." + "format": "date-time", + "description": "If there is a fast-forward action set for the previous run in a chain of runs,\nthe target time should be propagated to the next run as well." } }, - "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.\n\nPropagation behavior of time skipping:\nThe enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n(1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n(2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n(3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." + "description": "The time-skipping state that needs to be propagated from a parent workflow to a child workflow,\nor through a chain of runs." }, "v1TimeoutFailureInfo": { "type": "object", @@ -19980,6 +19995,11 @@ "workflowExecutionOptions": { "$ref": "#/definitions/v1WorkflowExecutionOptions", "description": "Workflow Execution options after update." + }, + "updateTime": { + "type": "string", + "format": "date-time", + "description": "The Workflow Execution time when the options were updated. When time skipping is\nenabled, this is the workflow's virtual time rather than wall-clock time." } } }, @@ -20985,7 +21005,7 @@ }, "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", - "description": "Time-skipping configuration for this workflow execution.\nIf not set, the time-skipping configuration is not updated by this request;\nthe existing configuration is preserved." + "description": "The time-skipping configuration for this workflow execution.\nWhen `fast_forward` is set, time will be fast-forwarded to a future point relative\nto the current workflow timestamp. Each call takes effect, even if\n`fast_forward` is set to the same duration, since the target time is recalculated\nfrom the current timestamp on every call.\n\nThis field must be updated as a whole; updating individual sub-fields is not supported.\nWhen setting the update mask in `UpdateWorkflowExecutionOptionsRequest`, \n`BatchOperationUpdateWorkflowExecutionOptions`, etc., use a mask that covers the entire field." } } }, @@ -21264,9 +21284,9 @@ "$ref": "#/definitions/v1TimeSkippingConfig", "description": "Initial time-skipping configuration for this workflow execution, recorded at start time.\nThis may have been set explicitly via the start workflow request, or propagated from a\nparent/previous execution.\n\nThe configuration may be updated after start via UpdateWorkflowExecutionOptions, which\nwill be reflected in the WorkflowExecutionOptionsUpdatedEvent." }, - "initialSkippedDuration": { - "type": "string", - "description": "The time skipped by the previous execution that started this workflow.\nIt can happen in cases of child workflows and continue-as-new workflows." + "timeSkippingStatePropagation": { + "$ref": "#/definitions/v1TimeSkippingStatePropagation", + "description": "The time-skipping state propagated from a previous run of this workflow. This can be nil\nif no time skipping has occurred or there is no previous run." } }, "title": "Always the first event in workflow history" @@ -21309,11 +21329,11 @@ "targetTime": { "type": "string", "format": "date-time", - "description": "The virtual time after time skipping was applied." + "description": "The virtual time point that time skipping advanced to." }, - "disabledAfterBound": { + "disabledAfterFastForward": { "type": "boolean", - "description": "when true, time skipping was disabled automatically due to a bound being reached." + "description": "When true, time skipping has been disabled automatically due to a call to fast_forward completing." }, "wallClockTime": { "type": "string", @@ -21321,7 +21341,7 @@ "description": "The wall-clock time when the time-skipping state changed event was generated." } }, - "description": "Attributes for an event indicating that time skipping state changed for a workflow execution,\neither time was advanced or time skipping was disabled automatically due to a bound being reached.\nThe worker_may_ignore field in HistoryEvent should always be set true for this event." + "description": "Attributes for an event indicating that time skipping state changed for a workflow execution,\neither time was advanced or time skipping was disabled automatically due to the fast_forward completing.\nThe worker_may_ignore field in HistoryEvent should always be set true for this event." }, "v1WorkflowExecutionTimedOutEventAttributes": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 36b02e47c..dadf0215b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16736,10 +16736,12 @@ components: allOf: - $ref: '#/components/schemas/TimeSkippingConfig' description: The propagated time-skipping configuration for the child workflow. - initialSkippedDuration: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: Propagate the duration skipped to the child workflow. + timeSkippingStatePropagation: + allOf: + - $ref: '#/components/schemas/TimeSkippingStatePropagation' + description: |- + The time-skipping state propagated from the parent workflow. This can be nil if no time skipping + has occurred or there is no previous run. StartNexusOperationExecutionRequest: type: object properties: @@ -17427,17 +17429,59 @@ components: enabled: type: boolean description: Enables or disables time skipping for this workflow execution. - maxSkippedDuration: + fastForward: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string - description: Maximum total virtual time that can be skipped. - maxElapsedDuration: + description: |- + Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time. + When the fast-forward completes, time skipping is disabled by the call that initiated the fast-forward, and this + action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by + setting `enabled` to true via UpdateWorkflowExecutionOptions. + The current workflow execution is a chain of runs (retries, cron, continue-as-new); + child workflows are separate executions, so this fast_forward won't affect them. + + For a given workflow execution, only one active fast-forward is allowed at a time. + If a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous + one completes, the new one will override the previous one. + If the fast-forward duration exceeds the remaining execution timeout, time will only + be fast-forwarded up to the end of the execution. + disableChildPropagation: + type: boolean + description: |- + By default, child workflows inherit the "enabled" flag when they are started. + This flag disables that inheritance. + description: |- + The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new). + When time skipping is enabled, virtual time advances automatically whenever there is no in-flight work. + In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, + and possibly other features added in the future. + User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the + time point of the registered fast forward when there is no in-flight work. + When time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be + added to the workflow history to capture the state changes. + + For child workflows, by default, if the parent execution is skipping time, the child execution will also skip time, + but a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the + "enabled" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the + parent execution as its start time. + TimeSkippingStatePropagation: + type: object + properties: + initialSkippedDuration: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: |- - Maximum elapsed time since time skipping was enabled. - This includes both skipped time and real time elapsing. - description: "Configuration for time skipping during a workflow execution.\n When enabled, virtual time advances automatically whenever there is no in-flight work.\n In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\n and possibly other features added in the future.\n User timers are not classified as in-flight work and will be skipped over.\n When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.\n \n Propagation behavior of time skipping:\n The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." + The time skipped by the previous execution that started this workflow. + It can happen in child workflows and a chain of runs (CaN, cron, retry). + fastForwardTargetTime: + type: string + description: |- + If there is a fast-forward action set for the previous run in a chain of runs, + the target time should be propagated to the next run as well. + format: date-time + description: |- + The time-skipping state that needs to be propagated from a parent workflow to a child workflow, + or through a chain of runs. TimeoutFailureInfo: type: object properties: @@ -18102,6 +18146,12 @@ components: allOf: - $ref: '#/components/schemas/WorkflowExecutionOptions' description: Workflow Execution options after update. + updateTime: + type: string + description: |- + The Workflow Execution time when the options were updated. When time skipping is + enabled, this is the workflow's virtual time rather than wall-clock time. + format: date-time UpdateWorkflowExecutionRequest: type: object properties: @@ -19481,10 +19531,7 @@ components: timeSkippingConfig: allOf: - $ref: '#/components/schemas/TimeSkippingConfig' - description: |- - Time-skipping configuration for this workflow execution. - If not set, the time-skipping configuration is not updated by this request; - the existing configuration is preserved. + description: "The time-skipping configuration for this workflow execution.\n When `fast_forward` is set, time will be fast-forwarded to a future point relative\n to the current workflow timestamp. Each call takes effect, even if\n `fast_forward` is set to the same duration, since the target time is recalculated\n from the current timestamp on every call.\n\n This field must be updated as a whole; updating individual sub-fields is not supported.\n When setting the update mask in `UpdateWorkflowExecutionOptionsRequest`, \n `BatchOperationUpdateWorkflowExecutionOptions`, etc., use a mask that covers the entire field." WorkflowExecutionOptionsUpdatedEventAttributes: type: object properties: @@ -19849,12 +19896,12 @@ components: The configuration may be updated after start via UpdateWorkflowExecutionOptions, which will be reflected in the WorkflowExecutionOptionsUpdatedEvent. - initialSkippedDuration: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string + timeSkippingStatePropagation: + allOf: + - $ref: '#/components/schemas/TimeSkippingStatePropagation' description: |- - The time skipped by the previous execution that started this workflow. - It can happen in cases of child workflows and continue-as-new workflows. + The time-skipping state propagated from a previous run of this workflow. This can be nil + if no time skipping has occurred or there is no previous run. description: Always the first event in workflow history WorkflowExecutionTerminatedEventAttributes: type: object @@ -19872,12 +19919,12 @@ components: properties: targetTime: type: string - description: The virtual time after time skipping was applied. + description: The virtual time point that time skipping advanced to. format: date-time - disabledAfterBound: + disabledAfterFastForward: type: boolean description: |- - when true, time skipping was disabled automatically due to a bound being reached. + When true, time skipping has been disabled automatically due to a call to fast_forward completing. (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "after" is used to indicate temporal ordering. --) wallClockTime: @@ -19886,7 +19933,7 @@ components: format: date-time description: |- Attributes for an event indicating that time skipping state changed for a workflow execution, - either time was advanced or time skipping was disabled automatically due to a bound being reached. + either time was advanced or time skipping was disabled automatically due to the fast_forward completing. The worker_may_ignore field in HistoryEvent should always be set true for this event. WorkflowExecutionTimedOutEventAttributes: type: object diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 98908cf89..43ca7664d 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -11,6 +11,7 @@ option csharp_namespace = "Temporalio.Api.Common.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/event_type.proto"; @@ -393,3 +394,52 @@ message OnConflictOptions { // Attaches the links to the running execution. bool attach_links = 3; } + +// The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new). +// When time skipping is enabled, virtual time advances automatically whenever there is no in-flight work. +// In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, +// and possibly other features added in the future. +// User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the +// time point of the registered fast forward when there is no in-flight work. +// When time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be +// added to the workflow history to capture the state changes. +// +// For child workflows, by default, if the parent execution is skipping time, the child execution will also skip time, +// but a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the +// "enabled" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the +// parent execution as its start time. +message TimeSkippingConfig { + // Enables or disables time skipping for this workflow execution. + bool enabled = 1; + + // Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time. + // When the fast-forward completes, time skipping is disabled by the call that initiated the fast-forward, and this + // action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by + // setting `enabled` to true via UpdateWorkflowExecutionOptions. + // The current workflow execution is a chain of runs (retries, cron, continue-as-new); + // child workflows are separate executions, so this fast_forward won't affect them. + // + // For a given workflow execution, only one active fast-forward is allowed at a time. + // If a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous + // one completes, the new one will override the previous one. + // If the fast-forward duration exceeds the remaining execution timeout, time will only + // be fast-forwarded up to the end of the execution. + google.protobuf.Duration fast_forward = 2; + + // By default, child workflows inherit the "enabled" flag when they are started. + // This flag disables that inheritance. + bool disable_child_propagation = 3; +} + +// The time-skipping state that needs to be propagated from a parent workflow to a child workflow, +// or through a chain of runs. +message TimeSkippingStatePropagation { + + // The time skipped by the previous execution that started this workflow. + // It can happen in child workflows and a chain of runs (CaN, cron, retry). + google.protobuf.Duration initial_skipped_duration = 1; + + // If there is a fast-forward action set for the previous run in a chain of runs, + // the target time should be propagated to the next run as well. + google.protobuf.Timestamp fast_forward_target_time = 2; +} diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 32f4f83cc..d98f05002 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -204,13 +204,18 @@ message WorkflowExecutionStartedEventAttributes { // // The configuration may be updated after start via UpdateWorkflowExecutionOptions, which // will be reflected in the WorkflowExecutionOptionsUpdatedEvent. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 41; + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 41; + + reserved 42; + reserved "initial_skipped_duration"; + + // The time-skipping state propagated from a previous run of this workflow. This can be nil + // if no time skipping has occurred or there is no previous run. + temporal.api.common.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 43; - // The time skipped by the previous execution that started this workflow. - // It can happen in cases of child workflows and continue-as-new workflows. - google.protobuf.Duration initial_skipped_duration = 42; } + // Wrapper for a target deployment version that the SDK declined to upgrade to. // See declined_target_version_upgrade on WorkflowExecutionStartedEventAttributes. message DeclinedTargetVersionUpgrade { @@ -777,10 +782,14 @@ message StartChildWorkflowExecutionInitiatedEventAttributes { temporal.api.common.v1.Priority priority = 20; // The propagated time-skipping configuration for the child workflow. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 21; + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 21; - // Propagate the duration skipped to the child workflow. - google.protobuf.Duration initial_skipped_duration = 30; + reserved 22; + reserved "initial_skipped_duration"; + + // The time-skipping state propagated from the parent workflow. This can be nil if no time skipping + // has occurred or there is no previous run. + temporal.api.common.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 23; } message StartChildWorkflowExecutionFailedEventAttributes { @@ -907,7 +916,7 @@ message WorkflowExecutionOptionsUpdatedEventAttributes { // Ignored if nil. temporal.api.common.v1.Priority priority = 6; // If set, the time-skipping configuration was changed. Contains the full updated configuration. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 7; + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 7; // Updates to workflow updates options. repeated WorkflowUpdateOptionsUpdate workflow_update_options = 8; } @@ -1003,17 +1012,16 @@ message WorkflowExecutionUnpausedEventAttributes { } // Attributes for an event indicating that time skipping state changed for a workflow execution, -// either time was advanced or time skipping was disabled automatically due to a bound being reached. +// either time was advanced or time skipping was disabled automatically due to the fast_forward completing. // The worker_may_ignore field in HistoryEvent should always be set true for this event. message WorkflowExecutionTimeSkippingTransitionedEventAttributes { - - // The virtual time after time skipping was applied. + // The virtual time point that time skipping advanced to. google.protobuf.Timestamp target_time = 1; - // when true, time skipping was disabled automatically due to a bound being reached. + // When true, time skipping has been disabled automatically due to a call to fast_forward completing. // (-- api-linter: core::0140::prepositions=disabled // aip.dev/not-precedent: "after" is used to indicate temporal ordering. --) - bool disabled_after_bound = 2; + bool disabled_after_fast_forward = 2; // The wall-clock time when the time-skipping state changed event was generated. google.protobuf.Timestamp wall_clock_time = 3; diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index fdca1df4d..4d35cb74b 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -585,52 +585,16 @@ message WorkflowExecutionOptions { // If set, overrides the workflow's priority sent by the SDK. temporal.api.common.v1.Priority priority = 2; - // Time-skipping configuration for this workflow execution. - // If not set, the time-skipping configuration is not updated by this request; - // the existing configuration is preserved. - TimeSkippingConfig time_skipping_config = 3; -} - -// Configuration for time skipping during a workflow execution. -// When enabled, virtual time advances automatically whenever there is no in-flight work. -// In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, -// and possibly other features added in the future. -// User timers are not classified as in-flight work and will be skipped over. -// When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists. -// -// Propagation behavior of time skipping: -// The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows: -// (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are -// inherited from the current execution. The configured bound is shared between the inherited skipped -// duration and any additional duration skipped by the new run. -// (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the -// current workflow started; the accumulated skipped duration of the current run is not propagated. -// (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays -// all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that -// point, the resulting run ends up with the same final time-skipping configuration as the previous run. -message TimeSkippingConfig { - reserved 2, 6; - reserved "disable_propagation", "max_target_time"; - - // Enables or disables time skipping for this workflow execution. - bool enabled = 1; - - // Optional bound that limits the gap between the virtual time of this execution and wall-clock time. - // Once the bound is reached, time skipping is automatically disabled, - // but can be re-enabled by setting `enabled` to true via UpdateWorkflowExecutionOptions. - // This bound cannot be set to a value smaller than the execution's currently skipped duration. + // The time-skipping configuration for this workflow execution. + // When `fast_forward` is set, time will be fast-forwarded to a future point relative + // to the current workflow timestamp. Each call takes effect, even if + // `fast_forward` is set to the same duration, since the target time is recalculated + // from the current timestamp on every call. // - // This is useful in testing scenarios where a workflow is expected to receive - // signals, updates, or other external events while timers are in progress. - oneof bound { - // Maximum total virtual time that can be skipped. - google.protobuf.Duration max_skipped_duration = 4; - - // Maximum elapsed time since time skipping was enabled. - // This includes both skipped time and real time elapsing. - // (-- api-linter: core::0142::time-field-names=disabled --) - google.protobuf.Duration max_elapsed_duration = 5; - } + // This field must be updated as a whole; updating individual sub-fields is not supported. + // When setting the update mask in `UpdateWorkflowExecutionOptionsRequest`, + // `BatchOperationUpdateWorkflowExecutionOptions`, etc., use a mask that covers the entire field. + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 3; } // Used to override the versioning behavior (and pinned deployment version, if applicable) of a diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b19ca0001..263c3c8a0 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -210,7 +210,7 @@ message StartWorkflowExecutionRequest { temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28; // Time-skipping configuration. If not set, time skipping is disabled. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 29; + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 29; } message StartWorkflowExecutionResponse { @@ -899,7 +899,7 @@ message SignalWithStartWorkflowExecutionRequest { // Priority metadata temporal.api.common.v1.Priority priority = 26; // Time-skipping configuration. If not set, time skipping is disabled. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 27; + temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 27; } message SignalWithStartWorkflowExecutionResponse { @@ -2387,6 +2387,10 @@ message UpdateWorkflowExecutionOptionsRequest { message UpdateWorkflowExecutionOptionsResponse { // Workflow Execution options after update. temporal.api.workflow.v1.WorkflowExecutionOptions workflow_execution_options = 1; + + // The Workflow Execution time when the options were updated. When time skipping is + // enabled, this is the workflow's virtual time rather than wall-clock time. + google.protobuf.Timestamp update_time = 2; } // [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later