Skip to content

Commit c686992

Browse files
committed
add fine-grained control to automatic timeskipping
1 parent 1feee4f commit c686992

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

openapi/openapiv2.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16296,6 +16296,10 @@
1629616296
"enabled": {
1629716297
"type": "boolean",
1629816298
"description": "If set, enables automatic time-skipping for this workflow execution.\nIt can also be disabled by setting this field to false.\nSpecial attention for transitively related workflows:\n- By default, Child workflows and Continue-As-New workflows will \ninherit the enabled config but only at the time they are started.\n- But if the enabled config is flipped after a child/continue-as-new workflow is started, \nthe propagation won't happen. It not recommended flip the parent's enabled config\nwhen there are in-flight child/continue-as-new workflows."
16299+
},
16300+
"maxAutoSkipDuration": {
16301+
"type": "string",
16302+
"description": "The duration bound for auto-skip.\nWhen reached, the time-skipping will be disabled automatically.\nBut it can also be re-enabled through UpdateWorkflowExecutionOptions.\nThis field is designed for complex testing scenarios where the workflow expects to receive signals/updates/etc during a user timer.\nwhere the workflow expects to receive signals/updates/etc during a user timer.\n\nAn example: the duration is 55 minutes, and the workflow has a timer for 1hour.\nAnd server will only skip 55 minutes, and turn off the time-skipping."
1629916303
}
1630016304
},
1630116305
"description": "Configuration for automatic time skipping on a workflow execution.\nOnce enabled, time automatically advances when there is no in-flight \nactivities, child workflows, or Nexus operations."
@@ -17870,6 +17874,10 @@
1787017874
"toTime": {
1787117875
"type": "string",
1787217876
"format": "date-time"
17877+
},
17878+
"boundReachedAndTimeSkippingDisabled": {
17879+
"type": "boolean",
17880+
"description": "when true, it means the automatic time-skipping was enabled with a bound \nand now the bound is reached and the time-skipping is disabled automatically."
1787317881
}
1787417882
},
1787517883
"description": "Attributes for an event marking that a duration was skipped for a workflow execution,\neither via manual time-skipping api call or automatic time-skipping."

openapi/openapiv3.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14456,6 +14456,10 @@ components:
1445614456
enabled:
1445714457
type: boolean
1445814458
description: "If set, enables automatic time-skipping for this workflow execution.\n It can also be disabled by setting this field to false.\n Special attention for transitively related workflows:\n - By default, Child workflows and Continue-As-New workflows will \n inherit the enabled config but only at the time they are started.\n - But if the enabled config is flipped after a child/continue-as-new workflow is started, \n the propagation won't happen. It not recommended flip the parent's enabled config\n when there are in-flight child/continue-as-new workflows."
14459+
maxAutoSkipDuration:
14460+
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
14461+
type: string
14462+
description: "The duration bound for auto-skip.\n When reached, the time-skipping will be disabled automatically.\n But it can also be re-enabled through UpdateWorkflowExecutionOptions.\n This field is designed for complex testing scenarios where the workflow expects to receive signals/updates/etc during a user timer.\n where the workflow expects to receive signals/updates/etc during a user timer.\n \n An example: the duration is 55 minutes, and the workflow has a timer for 1hour.\n And server will only skip 55 minutes, and turn off the time-skipping."
1445914463
description: "Configuration for automatic time skipping on a workflow execution.\n Once enabled, time automatically advances when there is no in-flight \n activities, child workflows, or Nexus operations."
1446014464
TimeoutFailureInfo:
1446114465
type: object
@@ -16654,6 +16658,9 @@ components:
1665416658
(-- api-linter: core::0140::prepositions=disabled
1665516659
aip.dev/not-precedent: "to" is used to indicate target time point. --)
1665616660
format: date-time
16661+
boundReachedAndTimeSkippingDisabled:
16662+
type: boolean
16663+
description: "when true, it means the automatic time-skipping was enabled with a bound \n and now the bound is reached and the time-skipping is disabled automatically."
1665716664
description: |-
1665816665
Attributes for an event marking that a duration was skipped for a workflow execution,
1665916666
either via manual time-skipping api call or automatic time-skipping.

temporal/api/history/v1/message.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,9 @@ message WorkflowExecutionTimeSkippedEventAttributes {
974974
// (-- api-linter: core::0140::prepositions=disabled
975975
// aip.dev/not-precedent: "to" is used to indicate target time point. --)
976976
google.protobuf.Timestamp to_time = 1;
977+
// when true, it means the automatic time-skipping was enabled with a bound
978+
// and now the bound is reached and the time-skipping is disabled automatically.
979+
bool bound_reached_and_time_skipping_disabled = 2;
977980
}
978981

979982
// Event marking that an operation was scheduled by a workflow via the ScheduleNexusOperation command.

temporal/api/workflow/v1/message.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,16 @@ message TimeSkippingConfig {
588588
// when there are in-flight child/continue-as-new workflows.
589589
bool enabled = 1;
590590

591+
// The duration bound for auto-skip.
592+
// When reached, the time-skipping will be disabled automatically.
593+
// But it can also be re-enabled through UpdateWorkflowExecutionOptions.
594+
// This field is designed for complex testing scenarios where the workflow expects to receive signals/updates/etc during a user timer.
595+
// where the workflow expects to receive signals/updates/etc during a user timer.
596+
//
597+
// An example: the duration is 55 minutes, and the workflow has a timer for 1hour.
598+
// And server will only skip 55 minutes, and turn off the time-skipping.
599+
google.protobuf.Duration max_auto_skip_duration = 3;
600+
591601
}
592602

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

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,4 +2955,4 @@ message DeleteActivityExecutionRequest {
29552955
}
29562956

29572957
message DeleteActivityExecutionResponse {
2958-
}
2958+
}

0 commit comments

Comments
 (0)