diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6c2cdb0e2..8e56ded6d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -19775,7 +19775,7 @@ }, "fastForward": { "type": "string", - "description": "Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.\nAfter the fast-forward completes, time skipping is disabled, and this\naction is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by\nsetting `enabled` to true or setting `fast_forward` again 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." + "description": "Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.\nAfter the fast-forward target time is reached, time will not skip anymore. But time skipping can be resumed by\nsetting a new `fast_forward` or just enabling time skipping with no `fast_forward` via UpdateWorkflowExecutionOptions.\n\nFor a given 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.\n\nFor workflows, the current workflow execution refers to a chain of runs (retries, cron, continue-as-new);\nchild workflows are separate executions, so this fast_forward won't affect them." }, "disablePropagation": { "type": "boolean", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f33babffa..cf9d0ba0d 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -17534,17 +17534,17 @@ components: type: string description: |- Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time. - After the fast-forward completes, time skipping is disabled, and this - action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by - setting `enabled` to true or setting `fast_forward` again 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. + After the fast-forward target time is reached, time will not skip anymore. But time skipping can be resumed by + setting a new `fast_forward` or just enabling time skipping with no `fast_forward` via UpdateWorkflowExecutionOptions. - For a given workflow execution, only one active fast-forward is allowed at a time. + For a given 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. + + For workflows, the current workflow execution refers to a chain of runs (retries, cron, continue-as-new); + child workflows are separate executions, so this fast_forward won't affect them. disablePropagation: type: boolean description: |- diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index a60b35fff..8232ac27e 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -413,17 +413,17 @@ message TimeSkippingConfig { bool enabled = 1; // Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time. - // After the fast-forward completes, time skipping is disabled, and this - // action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by - // setting `enabled` to true or setting `fast_forward` again 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. + // After the fast-forward target time is reached, time will not skip anymore. But time skipping can be resumed by + // setting a new `fast_forward` or just enabling time skipping with no `fast_forward` via UpdateWorkflowExecutionOptions. // - // For a given workflow execution, only one active fast-forward is allowed at a time. + // For a given 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. + // + // For workflows, the current workflow execution refers to a chain of runs (retries, cron, continue-as-new); + // child workflows are separate executions, so this fast_forward won't affect them. google.protobuf.Duration fast_forward = 2; // By default, executions started by another execution (e.g. a child workflow of a parent workflow or @@ -444,3 +444,27 @@ message TimeSkippingStatePropagation { // the target time should be propagated to the next run as well. google.protobuf.Timestamp fast_forward_target_time = 2; } + + +message TimeSkippingInfo { + // Current virtual time of the execution. If the execution hasn't skipped + // any time yet, it will be the same with wall clock time. + google.protobuf.Timestamp current_time = 1; + + // The current fast-forward information of the execution. Nil if + // the execution has no fast-forward set. + // `create_time` and `target_time` can be used to verify whether + // fast-forward configuration was overridden by another request, + // and `has_completed` shows whether the fast-forward duration has completed. + temporal.api.common.v1.TimeSkippingFastForwardInfo fast_forward = 2; + + // TimeSkippingFastForward describes the current time-skipping fast-forward on an execution. + message TimeSkippingFastForwardInfo { + // The virtual time at which the fast-forward was created. + google.protobuf.Timestamp create_time = 1; + // The target virtual time at which the fast-forward completes. + google.protobuf.Timestamp target_time = 2; + // True once `target_time` has been reached. + bool has_completed = 3; + } +} diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 2fdb678bc..b0884469e 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -1023,12 +1023,10 @@ message WorkflowExecutionUnpausedEventAttributes { message WorkflowExecutionTimeSkippingTransitionedEventAttributes { // The virtual time point that time skipping advanced to. google.protobuf.Timestamp target_time = 1; - // 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_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/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index bec02b9e5..b501447f2 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1255,6 +1255,14 @@ service WorkflowService { }; } + // Returns time-skipping info for a workflow execution: its current virtual time and + // the current fast-forward (registered via the TimeSkippingConfig), if any. + // When `wait_fast_forward_completion` is set, the call behaves as a long poll and + // does not resolve until the fast-forward completes or a timeout is hit. + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: We do not expose time-skipping info over HTTP because there is currently no identified use case. --) + rpc GetWorkflowTimeSkipping(GetWorkflowTimeSkippingRequest) returns (GetWorkflowTimeSkippingResponse) {} + // StartBatchOperation starts a new batch operation rpc StartBatchOperation(StartBatchOperationRequest) returns (StartBatchOperationResponse) { option (google.api.http) = {