Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
36 changes: 30 additions & 6 deletions temporal/api/common/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}
2 changes: 0 additions & 2 deletions temporal/api/history/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whether we delete this flag is still under discussion, if so we need to change the server logic before merging this PR

// The wall-clock time when the time-skipping state changed event was generated.
google.protobuf.Timestamp wall_clock_time = 3;
}
Expand Down
8 changes: 8 additions & 0 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) = {
Expand Down
Loading