Skip to content

Commit d665e2d

Browse files
committed
POC automatic timeskipping
1 parent 1168863 commit d665e2d

6 files changed

Lines changed: 120 additions & 2 deletions

File tree

openapi/openapiv2.json

Lines changed: 42 additions & 2 deletions
Large diffs are not rendered by default.

openapi/openapiv3.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10157,6 +10157,7 @@ components:
1015710157
- EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED
1015810158
- EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED
1015910159
- EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED
10160+
- EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPED
1016010161
type: string
1016110162
format: enum
1016210163
version:
@@ -10315,6 +10316,8 @@ components:
1031510316
$ref: '#/components/schemas/WorkflowExecutionPausedEventAttributes'
1031610317
workflowExecutionUnpausedEventAttributes:
1031710318
$ref: '#/components/schemas/WorkflowExecutionUnpausedEventAttributes'
10319+
workflowExecutionTimeSkippedEventAttributes:
10320+
$ref: '#/components/schemas/WorkflowExecutionTimeSkippedEventAttributes'
1031810321
description: |-
1031910322
History events are the method by which Temporal SDKs advance (or recreate) workflow state.
1032010323
See the `EventType` enum for more info about what each event is for.
@@ -11067,6 +11070,8 @@ components:
1106711070
Calls are retried internally by the server.
1106811071
(-- api-linter: core::0140::prepositions=disabled
1106911072
aip.dev/not-precedent: "to" is used to indicate interval. --)
11073+
(-- api-linter: core::0142::time-field-names=disabled
11074+
aip.dev/not-precedent: "timeout" is an acceptable suffix for duration fields in this API. --)
1107011075
nexusHeader:
1107111076
type: object
1107211077
additionalProperties:
@@ -12258,6 +12263,7 @@ components:
1225812263
- EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED
1225912264
- EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED
1226012265
- EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED
12266+
- EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPED
1226112267
type: string
1226212268
description: The event type of the history event generated by the request.
1226312269
format: enum
@@ -13571,6 +13577,10 @@ components:
1357113577
allOf:
1357213578
- $ref: '#/components/schemas/Priority'
1357313579
description: Priority metadata
13580+
timeSkippingConfig:
13581+
allOf:
13582+
- $ref: '#/components/schemas/TimeSkippingConfig'
13583+
description: Time skipping configuration. If set, enables time skipping for this workflow from the start.
1357413584
SignalWithStartWorkflowExecutionResponse:
1357513585
type: object
1357613586
properties:
@@ -14033,6 +14043,10 @@ components:
1403314043
allOf:
1403414044
- $ref: '#/components/schemas/WorkerDeploymentOptions'
1403514045
description: Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`.
14046+
timeSkippingConfig:
14047+
allOf:
14048+
- $ref: '#/components/schemas/TimeSkippingConfig'
14049+
description: Time skipping configuration. If set, enables time skipping for this workflow from the start.
1403614050
StartWorkflowExecutionResponse:
1403714051
type: object
1403814052
properties:
@@ -14436,6 +14450,15 @@ components:
1443614450
TerminatedFailureInfo:
1443714451
type: object
1443814452
properties: {}
14453+
TimeSkippingConfig:
14454+
type: object
14455+
properties:
14456+
enabled:
14457+
type: boolean
14458+
description: |-
14459+
If set, enables automatic time skipping for this workflow execution.
14460+
Can be disabled by setting this field to false.
14461+
description: "Configuration for automatic time skipping on a workflow execution.\n Once enabled, time automatically advances when there is no in-flight \n activity, child workflow, or Nexus operation.\n Fine-grained control for time skipping is to be added later."
1443914462
TimeoutFailureInfo:
1444014463
type: object
1444114464
properties:
@@ -15859,6 +15882,7 @@ components:
1585915882
- EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED
1586015883
- EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED
1586115884
- EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED
15885+
- EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPED
1586215886
type: string
1586315887
format: enum
1586415888
description: EventReference is a direct reference to a history event through the event ID.
@@ -15929,6 +15953,7 @@ components:
1592915953
- EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED
1593015954
- EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED
1593115955
- EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED
15956+
- EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPED
1593215957
type: string
1593315958
format: enum
1593415959
description: RequestIdReference is a indirect reference to a history event through the request ID.
@@ -16278,6 +16303,10 @@ components:
1627816303
allOf:
1627916304
- $ref: '#/components/schemas/Priority'
1628016305
description: If set, overrides the workflow's priority sent by the SDK.
16306+
timeSkippingConfig:
16307+
allOf:
16308+
- $ref: '#/components/schemas/TimeSkippingConfig'
16309+
description: Time skipping opt-in configuration for this workflow execution.
1628116310
WorkflowExecutionOptionsUpdatedEventAttributes:
1628216311
type: object
1628316312
properties:
@@ -16309,6 +16338,10 @@ components:
1630916338
description: |-
1631016339
Priority override upserted in this event. Represents the full priority; not just partial fields.
1631116340
Ignored if nil.
16341+
timeSkippingConfig:
16342+
allOf:
16343+
- $ref: '#/components/schemas/TimeSkippingConfig'
16344+
description: Time skipping configuration upserted in this event.
1631216345
WorkflowExecutionPauseInfo:
1631316346
type: object
1631416347
properties:
@@ -16614,6 +16647,18 @@ components:
1661416647
identity:
1661516648
type: string
1661616649
description: id of the client who requested termination
16650+
WorkflowExecutionTimeSkippedEventAttributes:
16651+
type: object
16652+
properties:
16653+
toTime:
16654+
type: string
16655+
description: |-
16656+
(-- api-linter: core::0140::prepositions=disabled
16657+
aip.dev/not-precedent: "to" is used to indicate target time point. --)
16658+
format: date-time
16659+
description: |-
16660+
Attributes for an event marking that a duration was skipped for a workflow execution,
16661+
either via explicit api call or automatic time skipping.
1661716662
WorkflowExecutionTimedOutEventAttributes:
1661816663
type: object
1661916664
properties:

temporal/api/enums/v1/event_type.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,6 @@ enum EventType {
173173
EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED = 58;
174174
// An event that indicates that the previously paused workflow execution has been unpaused.
175175
EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED = 59;
176+
// An event that indicates that a time point was skipped for this workflow execution.
177+
EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPED = 60;
176178
}

temporal/api/history/v1/message.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,8 @@ message WorkflowExecutionOptionsUpdatedEventAttributes {
873873
// Priority override upserted in this event. Represents the full priority; not just partial fields.
874874
// Ignored if nil.
875875
temporal.api.common.v1.Priority priority = 6;
876+
// Time skipping configuration upserted in this event.
877+
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 7;
876878
}
877879

878880
// Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes
@@ -965,6 +967,14 @@ message WorkflowExecutionUnpausedEventAttributes {
965967
string request_id = 3;
966968
}
967969

970+
// Attributes for an event marking that a duration was skipped for a workflow execution,
971+
// either via explicit api call or automatic time skipping.
972+
message WorkflowExecutionTimeSkippedEventAttributes {
973+
// (-- api-linter: core::0140::prepositions=disabled
974+
// aip.dev/not-precedent: "to" is used to indicate target time point. --)
975+
google.protobuf.Timestamp to_time = 1;
976+
}
977+
968978
// Event marking that an operation was scheduled by a workflow via the ScheduleNexusOperation command.
969979
message NexusOperationScheduledEventAttributes {
970980
// Endpoint name, must exist in the endpoint registry.
@@ -982,6 +992,8 @@ message NexusOperationScheduledEventAttributes {
982992
// Calls are retried internally by the server.
983993
// (-- api-linter: core::0140::prepositions=disabled
984994
// aip.dev/not-precedent: "to" is used to indicate interval. --)
995+
// (-- api-linter: core::0142::time-field-names=disabled
996+
// aip.dev/not-precedent: "timeout" is an acceptable suffix for duration fields in this API. --)
985997
google.protobuf.Duration schedule_to_close_timeout = 5;
986998
// Header to attach to the Nexus request. Note these headers are not the same as Temporal headers on internal
987999
// activities and child workflows, these are transmitted to Nexus operations that may be external and are not
@@ -1199,6 +1211,7 @@ message HistoryEvent {
11991211
NexusOperationCancelRequestFailedEventAttributes nexus_operation_cancel_request_failed_event_attributes = 62;
12001212
WorkflowExecutionPausedEventAttributes workflow_execution_paused_event_attributes = 63;
12011213
WorkflowExecutionUnpausedEventAttributes workflow_execution_unpaused_event_attributes = 64;
1214+
WorkflowExecutionTimeSkippedEventAttributes workflow_execution_time_skipped_event_attributes = 65;
12021215
}
12031216
}
12041217

temporal/api/workflow/v1/message.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,20 @@ message WorkflowExecutionOptions {
566566

567567
// If set, overrides the workflow's priority sent by the SDK.
568568
temporal.api.common.v1.Priority priority = 2;
569+
570+
// Time skipping opt-in configuration for this workflow execution.
571+
TimeSkippingConfig time_skipping_config = 3;
572+
}
573+
574+
// Configuration for automatic time skipping on a workflow execution.
575+
// Once enabled, time automatically advances when there is no in-flight
576+
// activity, child workflow, or Nexus operation.
577+
// Fine-grained control for time skipping is to be added later.
578+
message TimeSkippingConfig {
579+
580+
// If set, enables automatic time skipping for this workflow execution.
581+
// Can be disabled by setting this field to false.
582+
bool enabled = 1;
569583
}
570584

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

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ message StartWorkflowExecutionRequest {
197197
temporal.api.common.v1.Priority priority = 27;
198198
// Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`.
199199
temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28;
200+
// Time skipping configuration. If set, enables time skipping for this workflow from the start.
201+
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 29;
200202
}
201203

202204
message StartWorkflowExecutionResponse {
@@ -836,6 +838,8 @@ message SignalWithStartWorkflowExecutionRequest {
836838
temporal.api.workflow.v1.VersioningOverride versioning_override = 25;
837839
// Priority metadata
838840
temporal.api.common.v1.Priority priority = 26;
841+
// Time skipping configuration. If set, enables time skipping for this workflow from the start.
842+
temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 27;
839843
}
840844

841845
message SignalWithStartWorkflowExecutionResponse {

0 commit comments

Comments
 (0)