Skip to content

Commit 9721ff7

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

5 files changed

Lines changed: 44 additions & 1 deletion

File tree

openapi/openapiv2.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16296,6 +16296,15 @@
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+
"until": {
16301+
"type": "string",
16302+
"format": "date-time",
16303+
"description": "Absolute timestamp to auto-skip until."
16304+
},
16305+
"duration": {
16306+
"type": "string",
16307+
"description": "Duration from the workflow's current virtual time (at the time the config\nis applied) to auto-skip for. The server resolves this to an absolute\ntimestamp stored in TimeSkippingInfo."
1629916308
}
1630016309
},
1630116310
"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 +17879,10 @@
1787017879
"toTime": {
1787117880
"type": "string",
1787217881
"format": "date-time"
17882+
},
17883+
"boundReachedAndTimeSkippingDisabled": {
17884+
"type": "boolean",
17885+
"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."
1787317886
}
1787417887
},
1787517888
"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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14456,6 +14456,20 @@ 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+
until:
14460+
type: string
14461+
description: |-
14462+
Absolute timestamp to auto-skip until.
14463+
(-- api-linter: core::0142::time-field-names=disabled
14464+
aip.dev/not-precedent: `until` is intentionally used as a short, readable name in a oneof. --)
14465+
format: date-time
14466+
duration:
14467+
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
14468+
type: string
14469+
description: |-
14470+
Duration from the workflow's current virtual time (at the time the config
14471+
is applied) to auto-skip for. The server resolves this to an absolute
14472+
timestamp stored in TimeSkippingInfo.
1445914473
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."
1446014474
TimeoutFailureInfo:
1446114475
type: object
@@ -16654,6 +16668,9 @@ components:
1665416668
(-- api-linter: core::0140::prepositions=disabled
1665516669
aip.dev/not-precedent: "to" is used to indicate target time point. --)
1665616670
format: date-time
16671+
boundReachedAndTimeSkippingDisabled:
16672+
type: boolean
16673+
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."
1665716674
description: |-
1665816675
Attributes for an event marking that a duration was skipped for a workflow execution,
1665916676
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)