Skip to content

Commit aec285a

Browse files
Update sdk-core to incorporate time-skipping api changes (#1633)
* Bump to 467e871a * gen dem protos --------- Co-authored-by: Thomas Hardy <thomas.hardy@temporal.io>
1 parent 776998d commit aec285a

29 files changed

Lines changed: 1737 additions & 991 deletions

temporalio/api/command/v1/message_pb2.py

Lines changed: 44 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/command/v1/message_pb2.pyi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import temporalio.api.common.v1.message_pb2
1616
import temporalio.api.enums.v1.command_type_pb2
1717
import temporalio.api.enums.v1.workflow_pb2
1818
import temporalio.api.failure.v1.message_pb2
19+
import temporalio.api.sdk.v1.event_group_marker_pb2
1920
import temporalio.api.sdk.v1.user_metadata_pb2
2021
import temporalio.api.taskqueue.v1.message_pb2
2122

@@ -1083,6 +1084,7 @@ class Command(google.protobuf.message.Message):
10831084

10841085
COMMAND_TYPE_FIELD_NUMBER: builtins.int
10851086
USER_METADATA_FIELD_NUMBER: builtins.int
1087+
EVENT_GROUP_MARKERS_FIELD_NUMBER: builtins.int
10861088
SCHEDULE_ACTIVITY_TASK_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
10871089
START_TIMER_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
10881090
COMPLETE_WORKFLOW_EXECUTION_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
@@ -1117,6 +1119,13 @@ class Command(google.protobuf.message.Message):
11171119
started where the summary is used to identify the timer.
11181120
"""
11191121
@property
1122+
def event_group_markers(
1123+
self,
1124+
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
1125+
temporalio.api.sdk.v1.event_group_marker_pb2.EventGroupMarker
1126+
]:
1127+
"""Event Group Markers attached to the command by the workflow author."""
1128+
@property
11201129
def schedule_activity_task_command_attributes(
11211130
self,
11221131
) -> global___ScheduleActivityTaskCommandAttributes: ...
@@ -1191,6 +1200,10 @@ class Command(google.protobuf.message.Message):
11911200
command_type: temporalio.api.enums.v1.command_type_pb2.CommandType.ValueType = ...,
11921201
user_metadata: temporalio.api.sdk.v1.user_metadata_pb2.UserMetadata
11931202
| None = ...,
1203+
event_group_markers: collections.abc.Iterable[
1204+
temporalio.api.sdk.v1.event_group_marker_pb2.EventGroupMarker
1205+
]
1206+
| None = ...,
11941207
schedule_activity_task_command_attributes: global___ScheduleActivityTaskCommandAttributes
11951208
| None = ...,
11961209
start_timer_command_attributes: global___StartTimerCommandAttributes
@@ -1284,6 +1297,8 @@ class Command(google.protobuf.message.Message):
12841297
b"complete_workflow_execution_command_attributes",
12851298
"continue_as_new_workflow_execution_command_attributes",
12861299
b"continue_as_new_workflow_execution_command_attributes",
1300+
"event_group_markers",
1301+
b"event_group_markers",
12871302
"fail_workflow_execution_command_attributes",
12881303
b"fail_workflow_execution_command_attributes",
12891304
"modify_workflow_properties_command_attributes",

temporalio/api/common/v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
ResetOptions,
1616
RetryPolicy,
1717
SearchAttributes,
18+
TimeSkippingConfig,
19+
TimeSkippingStatePropagation,
1820
WorkerSelector,
1921
WorkerVersionCapabilities,
2022
WorkerVersionStamp,
@@ -39,6 +41,8 @@
3941
"ResetOptions",
4042
"RetryPolicy",
4143
"SearchAttributes",
44+
"TimeSkippingConfig",
45+
"TimeSkippingStatePropagation",
4246
"WorkerSelector",
4347
"WorkerVersionCapabilities",
4448
"WorkerVersionStamp",

temporalio/api/common/v1/message_pb2.py

Lines changed: 102 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalio/api/common/v1/message_pb2.pyi

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import google.protobuf.duration_pb2
1212
import google.protobuf.empty_pb2
1313
import google.protobuf.internal.containers
1414
import google.protobuf.message
15+
import google.protobuf.timestamp_pb2
1516

1617
import temporalio.api.enums.v1.common_pb2
1718
import temporalio.api.enums.v1.event_type_pb2
@@ -1255,3 +1256,115 @@ class OnConflictOptions(google.protobuf.message.Message):
12551256
) -> None: ...
12561257

12571258
global___OnConflictOptions = OnConflictOptions
1259+
1260+
class TimeSkippingConfig(google.protobuf.message.Message):
1261+
"""The configuration for time skipping of a workflow execution (a chain of runs including retries, cron, continue-as-new).
1262+
When time skipping is enabled, virtual time advances automatically whenever there is no in-flight work.
1263+
In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,
1264+
and possibly other features added in the future.
1265+
User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the
1266+
time point of the registered fast forward when there is no in-flight work.
1267+
When time is skipped, a WorkflowExecutionTimeSkippingTransitionedEvent will be
1268+
added to the workflow history to capture the state changes.
1269+
1270+
For child workflows, by default, if the parent execution is skipping time, the child execution will also skip time,
1271+
but a parent's fast_forward won't affect its child's execution. A flag is provided to disable propagation of the
1272+
"enabled" flag to child workflows; regardless of that flag, a child workflow inherits the virtual time from the
1273+
parent execution as its start time.
1274+
"""
1275+
1276+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1277+
1278+
ENABLED_FIELD_NUMBER: builtins.int
1279+
FAST_FORWARD_FIELD_NUMBER: builtins.int
1280+
DISABLE_CHILD_PROPAGATION_FIELD_NUMBER: builtins.int
1281+
enabled: builtins.bool
1282+
"""Enables or disables time skipping for this workflow execution."""
1283+
@property
1284+
def fast_forward(self) -> google.protobuf.duration_pb2.Duration:
1285+
"""Optionally fast-forward the current workflow execution by this duration ahead of current workflow execution time.
1286+
After the fast-forward completes, time skipping is disabled, and this
1287+
action is recorded in the WorkflowExecutionTimeSkippingTransitionedEvent. It can be re-enabled by
1288+
setting `enabled` to true or setting `fast_forward` again via UpdateWorkflowExecutionOptions.
1289+
The current workflow execution is a chain of runs (retries, cron, continue-as-new);
1290+
child workflows are separate executions, so this fast_forward won't affect them.
1291+
1292+
For a given workflow execution, only one active fast-forward is allowed at a time.
1293+
If a new fast-forward is set via UpdateWorkflowExecutionOptions before the previous
1294+
one completes, the new one will override the previous one.
1295+
If the fast-forward duration exceeds the remaining execution timeout, time will only
1296+
be fast-forwarded up to the end of the execution.
1297+
"""
1298+
disable_child_propagation: builtins.bool
1299+
"""By default, child workflows inherit the "enabled" flag when they are started.
1300+
This flag disables that inheritance.
1301+
"""
1302+
def __init__(
1303+
self,
1304+
*,
1305+
enabled: builtins.bool = ...,
1306+
fast_forward: google.protobuf.duration_pb2.Duration | None = ...,
1307+
disable_child_propagation: builtins.bool = ...,
1308+
) -> None: ...
1309+
def HasField(
1310+
self, field_name: typing_extensions.Literal["fast_forward", b"fast_forward"]
1311+
) -> builtins.bool: ...
1312+
def ClearField(
1313+
self,
1314+
field_name: typing_extensions.Literal[
1315+
"disable_child_propagation",
1316+
b"disable_child_propagation",
1317+
"enabled",
1318+
b"enabled",
1319+
"fast_forward",
1320+
b"fast_forward",
1321+
],
1322+
) -> None: ...
1323+
1324+
global___TimeSkippingConfig = TimeSkippingConfig
1325+
1326+
class TimeSkippingStatePropagation(google.protobuf.message.Message):
1327+
"""The time-skipping state that needs to be propagated from a parent workflow to a child workflow,
1328+
or through a chain of runs.
1329+
"""
1330+
1331+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1332+
1333+
INITIAL_SKIPPED_DURATION_FIELD_NUMBER: builtins.int
1334+
FAST_FORWARD_TARGET_TIME_FIELD_NUMBER: builtins.int
1335+
@property
1336+
def initial_skipped_duration(self) -> google.protobuf.duration_pb2.Duration:
1337+
"""The time skipped by the previous execution that started this workflow.
1338+
It can happen in child workflows and a chain of runs (CaN, cron, retry).
1339+
"""
1340+
@property
1341+
def fast_forward_target_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
1342+
"""If there is a fast-forward action set for the previous run in a chain of runs,
1343+
the target time should be propagated to the next run as well.
1344+
"""
1345+
def __init__(
1346+
self,
1347+
*,
1348+
initial_skipped_duration: google.protobuf.duration_pb2.Duration | None = ...,
1349+
fast_forward_target_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
1350+
) -> None: ...
1351+
def HasField(
1352+
self,
1353+
field_name: typing_extensions.Literal[
1354+
"fast_forward_target_time",
1355+
b"fast_forward_target_time",
1356+
"initial_skipped_duration",
1357+
b"initial_skipped_duration",
1358+
],
1359+
) -> builtins.bool: ...
1360+
def ClearField(
1361+
self,
1362+
field_name: typing_extensions.Literal[
1363+
"fast_forward_target_time",
1364+
b"fast_forward_target_time",
1365+
"initial_skipped_duration",
1366+
b"initial_skipped_duration",
1367+
],
1368+
) -> None: ...
1369+
1370+
global___TimeSkippingStatePropagation = TimeSkippingStatePropagation

temporalio/api/deployment/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from .message_pb2 import (
2+
ComputeStatus,
23
Deployment,
34
DeploymentInfo,
45
DeploymentListInfo,
@@ -14,6 +15,7 @@
1415
)
1516

1617
__all__ = [
18+
"ComputeStatus",
1719
"Deployment",
1820
"DeploymentInfo",
1921
"DeploymentListInfo",

0 commit comments

Comments
 (0)