Skip to content

Commit 1f73c30

Browse files
committed
move time skipping config from workflow folder to the common folder
1 parent a93ee40 commit 1f73c30

4 files changed

Lines changed: 58 additions & 58 deletions

File tree

temporal/api/common/v1/message.proto

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ option csharp_namespace = "Temporalio.Api.Common.V1";
1111

1212
import "google/protobuf/duration.proto";
1313
import "google/protobuf/empty.proto";
14+
import "google/protobuf/timestamp.proto";
1415

1516
import "temporal/api/enums/v1/common.proto";
1617
import "temporal/api/enums/v1/event_type.proto";
@@ -393,3 +394,52 @@ message OnConflictOptions {
393394
// Attaches the links to the running execution.
394395
bool attach_links = 3;
395396
}
397+
398+
// The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new).
399+
// When time skipping is enabled, virtual time advances automatically whenever there is no in-flight work.
400+
// In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,
401+
// and possibly other features added in the future.
402+
// User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the
403+
// time point of the registered fast forward when there is no in-flight work.
404+
// When time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be
405+
// added to the workflow history to capture the state changes.
406+
//
407+
// For child workflows, by default, if the parent execution is skipping time, the child execution will also skip time,
408+
// but a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the
409+
// "enabled" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the
410+
// parent execution as its start time.
411+
message TimeSkippingConfig {
412+
// Enables or disables time skipping for this workflow execution.
413+
bool enabled = 1;
414+
415+
// Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.
416+
// When the fast-forward completes, time skipping is disabled by the call that initiated the fast-forward, and this
417+
// action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by
418+
// setting `enabled` to true via UpdateWorkflowExecutionOptions.
419+
// The current workflow execution is a chain of runs (retries, cron, continue-as-new);
420+
// child workflows are separate executions, so this fast_forward won't affect them.
421+
//
422+
// For a given workflow execution, only one active fast-forward is allowed at a time.
423+
// If a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous
424+
// one completes, the new one will override the previous one.
425+
// If the fast-forward duration exceeds the remaining execution timeout, time will only
426+
// be fast-forwarded up to the end of the execution.
427+
google.protobuf.Duration fast_forward = 2;
428+
429+
// By default, child workflows inherit the "enabled" flag when they are started.
430+
// This flag disables that inheritance.
431+
bool disable_child_propagation = 3;
432+
}
433+
434+
// The time-skipping state that needs to be propagated from a parent workflow to a child workflow,
435+
// or through a chain of runs.
436+
message TimeSkippingStatePropagation {
437+
438+
// The time skipped by the previous execution that started this workflow.
439+
// It can happen in child workflows and a chain of runs (CaN, cron, retry).
440+
google.protobuf.Duration initial_skipped_duration = 1;
441+
442+
// If there is a fast-forward action set for the previous run in a chain of runs,
443+
// the target time should be propagated to the next run as well.
444+
google.protobuf.Timestamp fast_forward_target_time = 2;
445+
}

temporal/api/history/v1/message.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ message WorkflowExecutionStartedEventAttributes {
204204
//
205205
// The configuration may be updated after start via UpdateWorkflowExecutionOptions, which
206206
// will be reflected in the WorkflowExecutionOptionsUpdatedEvent.
207-
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 41;
207+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 41;
208208

209209
reserved 42;
210210
reserved "initial_skipped_duration";
211211

212212
// The time-skipping state propagated from a previous run of this workflow. This can be nil
213213
// if no time skipping has occurred or there is no previous run.
214-
temporal.api.workflow.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 43;
214+
temporal.api.common.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 43;
215215

216216
}
217217

@@ -782,14 +782,14 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
782782
temporal.api.common.v1.Priority priority = 20;
783783

784784
// The propagated time-skipping configuration for the child workflow.
785-
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 21;
785+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 21;
786786

787787
reserved 22;
788788
reserved "initial_skipped_duration";
789789

790790
// The time-skipping state propagated from the parent workflow. This can be nil if no time skipping
791791
// has occurred or there is no previous run.
792-
temporal.api.workflow.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 23;
792+
temporal.api.common.v1.TimeSkippingStatePropagation time_skipping_state_propagation = 23;
793793
}
794794

795795
message StartChildWorkflowExecutionFailedEventAttributes {
@@ -916,7 +916,7 @@ message WorkflowExecutionOptionsUpdatedEventAttributes {
916916
// Ignored if nil.
917917
temporal.api.common.v1.Priority priority = 6;
918918
// If set, the time-skipping configuration was changed. Contains the full updated configuration.
919-
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 7;
919+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 7;
920920
// Updates to workflow updates options.
921921
repeated WorkflowUpdateOptionsUpdate workflow_update_options = 8;
922922
}

temporal/api/workflow/v1/message.proto

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -593,59 +593,9 @@ message WorkflowExecutionOptions {
593593
// to the current workflow timestamp. Each call takes effect, even if
594594
// `fast_forward` is set to the same duration, since the target time is recalculated
595595
// from the current timestamp on every call.
596-
TimeSkippingConfig time_skipping_config = 3;
596+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 3;
597597
}
598598

599-
// The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new).
600-
// When time skipping is enabled, virtual time advances automatically whenever there is no in-flight work.
601-
// In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,
602-
// and possibly other features added in the future.
603-
// User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the
604-
// time point of the registered fast forward when there is no in-flight work.
605-
// When time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be
606-
// added to the workflow history to capture the state changes.
607-
//
608-
// For child workflows, by default, if the parent execution is skipping time, the child execution will also skip time,
609-
// but a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the
610-
// "enabled" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the
611-
// parent execution as its start time.
612-
message TimeSkippingConfig {
613-
// Enables or disables time skipping for this workflow execution.
614-
bool enabled = 1;
615-
616-
// Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.
617-
// When the fast-forward completes, time skipping is disabled by the call that initiated the fast-forward, and this
618-
// action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by
619-
// setting `enabled` to true via UpdateWorkflowExecutionOptions.
620-
// The current workflow execution is a chain of runs (retries, cron, continue-as-new);
621-
// child workflows are separate executions, so this fast_forward won't affect them.
622-
//
623-
// For a given workflow execution, only one active fast-forward is allowed at a time.
624-
// If a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous
625-
// one completes, the new one will override the previous one.
626-
// If the fast-forward duration exceeds the remaining execution timeout, time will only
627-
// be fast-forwarded up to the end of the execution.
628-
google.protobuf.Duration fast_forward = 2;
629-
630-
// By default, child workflows inherit the "enabled" flag when they are started.
631-
// This flag disables that inheritance.
632-
bool disable_child_propagation = 3;
633-
}
634-
635-
// The time-skipping state that needs to be propagated from a parent workflow to a child workflow,
636-
// or through a chain of runs.
637-
message TimeSkippingStatePropagation {
638-
639-
// The time skipped by the previous execution that started this workflow.
640-
// It can happen in child workflows and a chain of runs (CaN, cron, retry).
641-
google.protobuf.Duration initial_skipped_duration = 1;
642-
643-
// If there is a fast-forward action set for the previous run in a chain of runs,
644-
// the target time should be propagated to the next run as well.
645-
google.protobuf.Timestamp fast_forward_target_time = 2;
646-
}
647-
648-
649599
// Used to override the versioning behavior (and pinned deployment version, if applicable) of a
650600
// specific workflow execution. If set, this override takes precedence over worker-sent values.
651601
// See `WorkflowExecutionInfo.VersioningInfo` for more information.

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ message StartWorkflowExecutionRequest {
210210
temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28;
211211

212212
// Time-skipping configuration. If not set, time skipping is disabled.
213-
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 29;
213+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 29;
214214
}
215215

216216
message StartWorkflowExecutionResponse {
@@ -899,7 +899,7 @@ message SignalWithStartWorkflowExecutionRequest {
899899
// Priority metadata
900900
temporal.api.common.v1.Priority priority = 26;
901901
// Time-skipping configuration. If not set, time skipping is disabled.
902-
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 27;
902+
temporal.api.common.v1.TimeSkippingConfig time_skipping_config = 27;
903903
}
904904

905905
message SignalWithStartWorkflowExecutionResponse {

0 commit comments

Comments
 (0)