temporalio 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +37 -67
  3. data/Gemfile +3 -0
  4. data/README.md +17 -2
  5. data/Rakefile +1 -1
  6. data/ext/Cargo.toml +3 -3
  7. data/lib/temporalio/api/activity/v1/message.rb +1 -1
  8. data/lib/temporalio/api/batch/v1/message.rb +4 -1
  9. data/lib/temporalio/api/command/v1/message.rb +2 -1
  10. data/lib/temporalio/api/common/v1/message.rb +5 -1
  11. data/lib/temporalio/api/enums/v1/activity.rb +1 -1
  12. data/lib/temporalio/api/enums/v1/batch_operation.rb +1 -1
  13. data/lib/temporalio/api/enums/v1/common.rb +2 -1
  14. data/lib/temporalio/api/enums/v1/failed_cause.rb +1 -1
  15. data/lib/temporalio/api/enums/v1/time_skipping.rb +21 -0
  16. data/lib/temporalio/api/errordetails/v1/message.rb +2 -1
  17. data/lib/temporalio/api/history/v1/message.rb +1 -1
  18. data/lib/temporalio/api/namespace/v1/message.rb +1 -1
  19. data/lib/temporalio/api/taskqueue/v1/message.rb +2 -1
  20. data/lib/temporalio/api/worker/v1/message.rb +13 -1
  21. data/lib/temporalio/api/workflow/v1/message.rb +1 -1
  22. data/lib/temporalio/api/workflowservice/v1/request_response.rb +4 -1
  23. data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
  24. data/lib/temporalio/client/connection/workflow_service.rb +15 -0
  25. data/lib/temporalio/client/connection.rb +33 -3
  26. data/lib/temporalio/client/schedule.rb +4 -5
  27. data/lib/temporalio/client/workflow_execution.rb +2 -2
  28. data/lib/temporalio/client/workflow_handle.rb +2 -1
  29. data/lib/temporalio/client.rb +4 -6
  30. data/lib/temporalio/converters/data_converter.rb +1 -0
  31. data/lib/temporalio/converters/failure_converter.rb +7 -4
  32. data/lib/temporalio/internal/bridge/api/common/common.rb +2 -1
  33. data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +1 -1
  34. data/lib/temporalio/internal/bridge/client.rb +3 -1
  35. data/lib/temporalio/internal/bridge/runtime.rb +4 -1
  36. data/lib/temporalio/internal/bridge/worker.rb +3 -1
  37. data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +9 -0
  38. data/lib/temporalio/runtime.rb +25 -7
  39. data/lib/temporalio/scoped_logger.rb +15 -0
  40. data/lib/temporalio/version.rb +1 -1
  41. data/lib/temporalio/worker/workflow_replayer.rb +2 -0
  42. data/lib/temporalio/worker.rb +24 -4
  43. data/lib/temporalio/workflow.rb +8 -9
  44. data/rbi/temporalio/api/activity/v1/message.rbi +100 -14
  45. data/rbi/temporalio/api/batch/v1/message.rbi +229 -2
  46. data/rbi/temporalio/api/command/v1/message.rbi +22 -2
  47. data/rbi/temporalio/api/common/v1/message.rbi +548 -74
  48. data/rbi/temporalio/api/enums/v1/activity.rbi +1 -0
  49. data/rbi/temporalio/api/enums/v1/batch_operation.rbi +9 -0
  50. data/rbi/temporalio/api/enums/v1/common.rbi +18 -0
  51. data/rbi/temporalio/api/enums/v1/failed_cause.rbi +4 -0
  52. data/rbi/temporalio/api/enums/v1/time_skipping.rbi +22 -0
  53. data/rbi/temporalio/api/errordetails/v1/message.rbi +59 -2
  54. data/rbi/temporalio/api/history/v1/message.rbi +27 -7
  55. data/rbi/temporalio/api/namespace/v1/message.rbi +95 -4
  56. data/rbi/temporalio/api/taskqueue/v1/message.rbi +113 -2
  57. data/rbi/temporalio/api/worker/v1/message.rbi +742 -2
  58. data/rbi/temporalio/api/workflow/v1/message.rbi +22 -2
  59. data/rbi/temporalio/api/workflowservice/v1/request_response.rbi +701 -117
  60. data/rbi/temporalio/api/workflowservice/v1/service_services.rbi +8 -0
  61. data/rbi/temporalio/client/connection/workflow_service.rbi +3 -0
  62. data/rbi/temporalio/client/connection.rbi +2 -0
  63. data/rbi/temporalio/converters/failure_converter.rbi +7 -2
  64. data/rbi/temporalio/internal/bridge/api/common/common.rbi +115 -0
  65. data/rbi/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rbi +42 -2
  66. data/rbi/temporalio/internal/bridge/runtime.rbi +24 -4
  67. data/rbi/temporalio/internal/bridge/worker.rbi +2 -0
  68. data/rbi/temporalio/runtime.rbi +13 -4
  69. data/rbi/temporalio/scoped_logger.rbi +1 -1
  70. data/rbi/temporalio/worker.rbi +9 -2
  71. data/rbi/temporalio/workflow/future.rbi +1 -1
  72. data/sig/temporalio/api/activity/v1/message.rbs +48 -2
  73. data/sig/temporalio/api/batch/v1/message.rbs +86 -0
  74. data/sig/temporalio/api/command/v1/message.rbs +10 -0
  75. data/sig/temporalio/api/common/v1/message.rbs +240 -39
  76. data/sig/temporalio/api/enums/v1/activity.rbs +9 -5
  77. data/sig/temporalio/api/enums/v1/batch_operation.rbs +33 -3
  78. data/sig/temporalio/api/enums/v1/common.rbs +23 -0
  79. data/sig/temporalio/api/enums/v1/failed_cause.rbs +18 -6
  80. data/sig/temporalio/api/enums/v1/time_skipping.rbs +58 -0
  81. data/sig/temporalio/api/errordetails/v1/message.rbs +19 -0
  82. data/sig/temporalio/api/history/v1/message.rbs +13 -3
  83. data/sig/temporalio/api/namespace/v1/message.rbs +43 -0
  84. data/sig/temporalio/api/taskqueue/v1/message.rbs +44 -0
  85. data/sig/temporalio/api/worker/v1/message.rbs +410 -0
  86. data/sig/temporalio/api/workflow/v1/message.rbs +10 -0
  87. data/sig/temporalio/api/workflowservice/v1/request_response.rbs +311 -40
  88. data/sig/temporalio/client/connection/workflow_service.rbs +4 -0
  89. data/sig/temporalio/client/connection.rbs +14 -1
  90. data/sig/temporalio/converters/failure_converter.rbs +4 -1
  91. data/sig/temporalio/internal/bridge/api/common/common.rbs +50 -0
  92. data/sig/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rbs +20 -0
  93. data/sig/temporalio/internal/bridge/client.rbs +5 -1
  94. data/sig/temporalio/internal/bridge/runtime.rbs +9 -3
  95. data/sig/temporalio/internal/bridge/worker.rbs +5 -1
  96. data/sig/temporalio/runtime.rbs +14 -3
  97. data/sig/temporalio/scoped_logger.rbs +1 -1
  98. data/sig/temporalio/worker.rbs +8 -2
  99. metadata +4 -1
@@ -46,20 +46,32 @@ module Temporalio
46
46
  end
47
47
 
48
48
  LoggingOptions = Data.define(
49
- :log_filter
49
+ :log_filter,
50
+ :log_format
50
51
  # TODO(cretz): forward_to
51
52
  )
52
53
 
54
+ # Formats for Core logs written to the console.
55
+ module ConsoleLogFormat
56
+ COMPACT = :compact
57
+ PRETTY = :pretty
58
+ JSON = :json
59
+ end
60
+
53
61
  # Logging options for runtime telemetry.
54
62
  #
55
63
  # @!attribute log_filter
56
64
  # @return [LoggingFilterOptions, String] Logging filter for Core, default is new {LoggingFilterOptions} with no
57
65
  # parameters.
66
+ # @!attribute log_format
67
+ # @return [ConsoleLogFormat, nil] Format for Core logs written to the console. If unset, this defaults to compact
68
+ # output.
58
69
  class LoggingOptions
59
70
  # Create logging options
60
71
  #
61
72
  # @param log_filter [LoggingFilterOptions, String] Logging filter for Core.
62
- def initialize(log_filter: LoggingFilterOptions.new)
73
+ # @param log_format [ConsoleLogFormat, nil] Format for Core logs written to the console.
74
+ def initialize(log_filter: LoggingFilterOptions.new, log_format: nil)
63
75
  super
64
76
  end
65
77
 
@@ -73,7 +85,8 @@ module Temporalio
73
85
  log_filter._to_bridge
74
86
  else
75
87
  raise 'Log filter must be string or LoggingFilterOptions'
76
- end
88
+ end,
89
+ log_format: log_format&.to_s
77
90
  )
78
91
  end
79
92
  end
@@ -101,8 +114,8 @@ module Temporalio
101
114
  # @!visibility private
102
115
  def _to_bridge
103
116
  # @type self: LoggingFilterOptions
104
- "#{other_level},temporalio_sdk_core=#{core_level},temporalio_client=#{core_level}," \
105
- "temporalio_sdk=#{core_level},temporalio_bridge=#{core_level}"
117
+ "#{other_level},temporalio_common=#{core_level},temporalio_sdk_core=#{core_level}," \
118
+ "temporalio_client=#{core_level},temporalio_sdk=#{core_level},temporalio_bridge=#{core_level}"
106
119
  end
107
120
  end
108
121
 
@@ -332,9 +345,12 @@ module Temporalio
332
345
  # @param telemetry [TelemetryOptions] Telemetry options to set.
333
346
  # @param worker_heartbeat_interval [Float, nil] Interval for worker heartbeats in seconds. Can be nil to disable
334
347
  # heartbeating. Interval must be between 1s and 60s.
348
+ # @param disable_environment_info [Boolean] When true, worker heartbeats omit runtime, hosting, and platform
349
+ # information. Defaults to false, which advertises this process as CRuby with `RUBY_VERSION`.
335
350
  def initialize(
336
351
  telemetry: TelemetryOptions.new,
337
- worker_heartbeat_interval: 60
352
+ worker_heartbeat_interval: 60,
353
+ disable_environment_info: false
338
354
  )
339
355
  if !worker_heartbeat_interval.nil? && !worker_heartbeat_interval.positive?
340
356
  raise 'Worker heartbeat interval must be positive'
@@ -346,7 +362,9 @@ module Temporalio
346
362
  @core_runtime = Internal::Bridge::Runtime.new(
347
363
  Internal::Bridge::Runtime::Options.new(
348
364
  telemetry: telemetry._to_bridge,
349
- worker_heartbeat_interval:
365
+ worker_heartbeat_interval:,
366
+ disable_environment_info:,
367
+ runtime_version: RUBY_VERSION
350
368
  )
351
369
  )
352
370
  @metric_meter = Internal::Metric::Meter.create_from_runtime(self) || Metric::Meter.null
@@ -42,6 +42,21 @@ module Temporalio
42
42
  end
43
43
  alias log add
44
44
 
45
+ # returns the logger log level as an integer.
46
+ def level
47
+ lvl = super
48
+
49
+ return lvl if lvl.is_a?(Integer)
50
+
51
+ return Logger::UNKNOWN unless lvl.respond_to?(:upcase)
52
+
53
+ if Logger::Severity.const_defined?(lvl.upcase, false)
54
+ Logger::Severity.const_get(lvl.upcase, false)
55
+ else
56
+ Logger::UNKNOWN
57
+ end
58
+ end
59
+
45
60
  # @see Logger.debug
46
61
  def debug(progname = nil, &)
47
62
  add(Logger::DEBUG, nil, progname, &)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Temporalio
4
- VERSION = '1.6.0'
4
+ VERSION = '1.7.0'
5
5
  end
@@ -240,10 +240,12 @@ module Temporalio
240
240
  default_heartbeat_throttle_interval: 1.0,
241
241
  max_worker_activities_per_second: nil,
242
242
  max_task_queue_activities_per_second: nil,
243
+ max_eager_activity_reservations_per_workflow_task: 3,
243
244
  graceful_shutdown_period: 0.0,
244
245
  nondeterminism_as_workflow_fail:,
245
246
  nondeterminism_as_workflow_fail_for_types:,
246
247
  deployment_options: Worker.default_deployment_options._to_bridge_options,
248
+ disable_payload_error_limit: true,
247
249
  plugins: options.plugins.map(&:name).uniq.sort
248
250
  )
249
251
  )
@@ -61,6 +61,7 @@ module Temporalio
61
61
  :default_heartbeat_throttle_interval,
62
62
  :max_activities_per_second,
63
63
  :max_task_queue_activities_per_second,
64
+ :max_eager_activity_reservations_per_workflow_task,
64
65
  :graceful_shutdown_period,
65
66
  :disable_eager_activity_execution,
66
67
  :illegal_workflow_calls,
@@ -71,7 +72,8 @@ module Temporalio
71
72
  :patch_activation_callback,
72
73
  :workflow_task_poller_behavior,
73
74
  :activity_task_poller_behavior,
74
- :debug_mode
75
+ :debug_mode,
76
+ :disable_payload_error_limit
75
77
  )
76
78
 
77
79
  # Options as returned from {options} for `**to_h` splat use in {initialize}. See {initialize} for details.
@@ -415,6 +417,9 @@ module Temporalio
415
417
  # @param max_task_queue_activities_per_second [Float, nil] Sets the maximum number of activities per second the task
416
418
  # queue will dispatch, controlled server-side. Note that this only takes effect upon an activity poll request. If
417
419
  # multiple workers on the same queue have different values set, they will thrash with the last poller winning.
420
+ # @param max_eager_activity_reservations_per_workflow_task [Integer] Maximum number of activity slots that may be
421
+ # reserved for eager execution when completing a workflow task. Defaults to 3 and must be positive. To disable
422
+ # eager activity execution, set `disable_eager_activity_execution: true`.
418
423
  # @param graceful_shutdown_period [Float] Amount of time after shutdown is called that activities are given to
419
424
  # complete before their tasks are canceled.
420
425
  # @param disable_eager_activity_execution [Boolean] If true, disables eager activity execution. Eager activity
@@ -452,6 +457,9 @@ module Temporalio
452
457
  # @param debug_mode [Boolean] If true, deadlock detection is disabled. Deadlock detection will fail workflow tasks
453
458
  # if they block the thread for too long. This defaults to true if the `TEMPORAL_DEBUG` environment variable is
454
459
  # `true` or `1`.
460
+ # @param disable_payload_error_limit [Boolean] If true, the worker will not proactively fail workflow/activity
461
+ # tasks whose payloads exceed the namespace error limits; oversized payloads are sent to the server, which
462
+ # enforces the limit. Defaults to false (the worker fails such tasks before sending).
455
463
  def initialize(
456
464
  client:,
457
465
  task_queue:,
@@ -474,6 +482,7 @@ module Temporalio
474
482
  default_heartbeat_throttle_interval: 30,
475
483
  max_activities_per_second: nil,
476
484
  max_task_queue_activities_per_second: nil,
485
+ max_eager_activity_reservations_per_workflow_task: 3,
477
486
  graceful_shutdown_period: 0,
478
487
  disable_eager_activity_execution: false,
479
488
  illegal_workflow_calls: Worker.default_illegal_workflow_calls,
@@ -484,7 +493,8 @@ module Temporalio
484
493
  patch_activation_callback: nil,
485
494
  workflow_task_poller_behavior: PollerBehavior::SimpleMaximum.new(max_concurrent_workflow_task_polls),
486
495
  activity_task_poller_behavior: PollerBehavior::SimpleMaximum.new(max_concurrent_activity_task_polls),
487
- debug_mode: %w[true 1].include?(ENV['TEMPORAL_DEBUG'].to_s.downcase)
496
+ debug_mode: %w[true 1].include?(ENV['TEMPORAL_DEBUG'].to_s.downcase),
497
+ disable_payload_error_limit: false
488
498
  )
489
499
  Internal::ProtoUtils.assert_non_reserved_name(task_queue)
490
500
 
@@ -510,6 +520,7 @@ module Temporalio
510
520
  default_heartbeat_throttle_interval:,
511
521
  max_activities_per_second:,
512
522
  max_task_queue_activities_per_second:,
523
+ max_eager_activity_reservations_per_workflow_task:,
513
524
  graceful_shutdown_period:,
514
525
  disable_eager_activity_execution:,
515
526
  illegal_workflow_calls:,
@@ -520,7 +531,8 @@ module Temporalio
520
531
  patch_activation_callback:,
521
532
  workflow_task_poller_behavior:,
522
533
  activity_task_poller_behavior:,
523
- debug_mode:
534
+ debug_mode:,
535
+ disable_payload_error_limit:
524
536
  ).freeze
525
537
  # Collect applicable client plugins and worker plugins, then validate and apply to options
526
538
  @plugins = client.options.plugins.grep(Plugin) + plugins
@@ -541,6 +553,11 @@ module Temporalio
541
553
  raise ArgumentError,
542
554
  'default_versioning_behavior must be UNSPECIFIED when use_worker_versioning is false'
543
555
  end
556
+ unless @options.max_eager_activity_reservations_per_workflow_task.positive?
557
+ raise ArgumentError,
558
+ 'max_eager_activity_reservations_per_workflow_task must be positive; ' \
559
+ 'use disable_eager_activity_execution: true to disable eager activity execution'
560
+ end
544
561
 
545
562
  should_enforce_versioning_behavior =
546
563
  @options.deployment_options.use_worker_versioning &&
@@ -577,11 +594,14 @@ module Temporalio
577
594
  default_heartbeat_throttle_interval: @options.default_heartbeat_throttle_interval,
578
595
  max_worker_activities_per_second: @options.max_activities_per_second,
579
596
  max_task_queue_activities_per_second: @options.max_task_queue_activities_per_second,
597
+ max_eager_activity_reservations_per_workflow_task:
598
+ @options.max_eager_activity_reservations_per_workflow_task,
580
599
  graceful_shutdown_period: @options.graceful_shutdown_period,
581
600
  nondeterminism_as_workflow_fail:,
582
601
  nondeterminism_as_workflow_fail_for_types:,
583
602
  deployment_options: @options.deployment_options._to_bridge_options,
584
- plugins: (@options.client.options.plugins + @options.plugins).map(&:name).uniq.sort
603
+ plugins: (@options.client.options.plugins + @options.plugins).map(&:name).uniq.sort,
604
+ disable_payload_error_limit: @options.disable_payload_error_limit
585
605
  )
586
606
  )
587
607
 
@@ -68,7 +68,7 @@ module Temporalio
68
68
 
69
69
  # Get current details for this workflow that may appear in UI/CLI. Unlike static details set at start, this value
70
70
  # can be updated throughout the life of the workflow. This can be in Temporal markdown format and can span multiple
71
- # lines. This is currently experimental.
71
+ # lines.
72
72
  #
73
73
  # @return [String] Current details. Default is empty string.
74
74
  def self.current_details
@@ -77,7 +77,7 @@ module Temporalio
77
77
 
78
78
  # Set current details for this workflow that may appear in UI/CLI. Unlike static details set at start, this value
79
79
  # can be updated throughout the life of the workflow. This can be in Temporal markdown format and can span multiple
80
- # lines. This is currently experimental.
80
+ # lines.
81
81
  #
82
82
  # @param details [String] Current details. Can use empty string to unset.
83
83
  def self.current_details=(details)
@@ -136,7 +136,7 @@ module Temporalio
136
136
  # @param args [Array<Object>] Arguments to the activity.
137
137
  # @param task_queue [String] Task queue to run the activity on. Defaults to the current workflow's task queue.
138
138
  # @param summary [String, nil] Single-line summary for this activity that may appear in CLI/UI. This can be in
139
- # single-line Temporal markdown format. This is currently experimental.
139
+ # single-line Temporal markdown format.
140
140
  # @param schedule_to_close_timeout [Float, nil] Max amount of time the activity can take from first being scheduled
141
141
  # to being completed before it times out. This is inclusive of all retries.
142
142
  # @param schedule_to_start_timeout [Float, nil] Max amount of time the activity can take to be started from first
@@ -235,7 +235,7 @@ module Temporalio
235
235
  # @param activity [Class<Activity::Definition>, Symbol, String] Activity definition class or name.
236
236
  # @param args [Array<Object>] Arguments to the activity.
237
237
  # @param summary [String, nil] Single-line summary for this activity that may appear in CLI/UI. This can be in
238
- # single-line Temporal markdown format. This is currently experimental.
238
+ # single-line Temporal markdown format.
239
239
  # @param schedule_to_close_timeout [Float, nil] Max amount of time the activity can take from first being scheduled
240
240
  # to being completed before it times out. This is inclusive of all retries.
241
241
  # @param schedule_to_start_timeout [Float, nil] Max amount of time the activity can take to be started from first
@@ -393,7 +393,7 @@ module Temporalio
393
393
  # value cannot be negative. Since Temporal timers are server-side, timer resolution may not end up as precise as
394
394
  # system timers.
395
395
  # @param summary [String, nil] A simple string identifying this timer that may be visible in UI/CLI. While it can be
396
- # normal text, it is best to treat as a timer ID. This is currently experimental.
396
+ # normal text, it is best to treat as a timer ID.
397
397
  # @param cancellation [Cancellation] Cancellation for this timer.
398
398
  # @raise [Error::CanceledError] Sleep canceled.
399
399
  def self.sleep(duration, summary: nil, cancellation: Workflow.cancellation)
@@ -407,11 +407,10 @@ module Temporalio
407
407
  # @param id [String] Unique identifier for the workflow execution. Defaults to a new UUID from {random}.
408
408
  # @param task_queue [String] Task queue to run the workflow on. Defaults to the current workflow's task queue.
409
409
  # @param static_summary [String, nil] Fixed single-line summary for this workflow execution that may appear in
410
- # CLI/UI. This can be in single-line Temporal markdown format. This is currently experimental.
410
+ # CLI/UI. This can be in single-line Temporal markdown format.
411
411
  # @param static_details [String, nil] Fixed details for this workflow execution that may appear in CLI/UI. This can
412
412
  # be in Temporal markdown format and can be multiple lines. This is a fixed value on the workflow that cannot be
413
- # updated. For details that can be updated, use {Workflow.current_details=} within the workflow. This is currently
414
- # experimental.
413
+ # updated. For details that can be updated, use {Workflow.current_details=} within the workflow.
415
414
  # @param cancellation [Cancellation] Cancellation to apply to the child workflow. How cancellation is treated is
416
415
  # based on `cancellation_type`. This defaults to the workflow's cancellation.
417
416
  # @param cancellation_type [ChildWorkflowCancellationType] How the child workflow will react to cancellation.
@@ -480,7 +479,7 @@ module Temporalio
480
479
  # @param message [String] Message to use for timeout exception. Defaults to "execution expired" like
481
480
  # {::Timeout.timeout}.
482
481
  # @param summary [String] Timer summary for the timer created by this timeout. This is backed by {sleep} so see that
483
- # method for details. This is currently experimental.
482
+ # method for details.
484
483
  #
485
484
  # @yield Block to run with a timeout.
486
485
  # @return [Object] The result of the block.
@@ -10,12 +10,14 @@ class Temporalio::Api::Activity::V1::ActivityExecutionOutcome
10
10
  sig do
11
11
  params(
12
12
  result: T.nilable(Temporalio::Api::Common::V1::Payloads),
13
- failure: T.nilable(Temporalio::Api::Failure::V1::Failure)
13
+ failure: T.nilable(Temporalio::Api::Failure::V1::Failure),
14
+ retry_state: T.nilable(T.any(Symbol, String, Integer))
14
15
  ).void
15
16
  end
16
17
  def initialize(
17
18
  result: nil,
18
- failure: nil
19
+ failure: nil,
20
+ retry_state: :RETRY_STATE_UNSPECIFIED
19
21
  )
20
22
  end
21
23
 
@@ -49,6 +51,24 @@ class Temporalio::Api::Activity::V1::ActivityExecutionOutcome
49
51
  def clear_failure
50
52
  end
51
53
 
54
+ # The retry state associated with an unsuccessful activity execution.
55
+ # This field is only meaningful when `failure` is set.
56
+ sig { returns(T.any(Symbol, Integer)) }
57
+ def retry_state
58
+ end
59
+
60
+ # The retry state associated with an unsuccessful activity execution.
61
+ # This field is only meaningful when `failure` is set.
62
+ sig { params(value: T.any(Symbol, String, Integer)).void }
63
+ def retry_state=(value)
64
+ end
65
+
66
+ # The retry state associated with an unsuccessful activity execution.
67
+ # This field is only meaningful when `failure` is set.
68
+ sig { void }
69
+ def clear_retry_state
70
+ end
71
+
52
72
  sig { returns(T.nilable(Symbol)) }
53
73
  def value
54
74
  end
@@ -98,7 +118,8 @@ class Temporalio::Api::Activity::V1::ActivityOptions
98
118
  start_to_close_timeout: T.nilable(Google::Protobuf::Duration),
99
119
  heartbeat_timeout: T.nilable(Google::Protobuf::Duration),
100
120
  retry_policy: T.nilable(Temporalio::Api::Common::V1::RetryPolicy),
101
- priority: T.nilable(Temporalio::Api::Common::V1::Priority)
121
+ priority: T.nilable(Temporalio::Api::Common::V1::Priority),
122
+ start_delay: T.nilable(Google::Protobuf::Duration)
102
123
  ).void
103
124
  end
104
125
  def initialize(
@@ -108,7 +129,8 @@ class Temporalio::Api::Activity::V1::ActivityOptions
108
129
  start_to_close_timeout: nil,
109
130
  heartbeat_timeout: nil,
110
131
  retry_policy: nil,
111
- priority: nil
132
+ priority: nil,
133
+ start_delay: nil
112
134
  )
113
135
  end
114
136
 
@@ -262,6 +284,27 @@ class Temporalio::Api::Activity::V1::ActivityOptions
262
284
  def clear_priority
263
285
  end
264
286
 
287
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
288
+ # When updated, the time is added to the original `schedule_time`, not to the current time.
289
+ # If the resulting time is in the past, the task is made available for dispatch immediately.
290
+ sig { returns(T.nilable(Google::Protobuf::Duration)) }
291
+ def start_delay
292
+ end
293
+
294
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
295
+ # When updated, the time is added to the original `schedule_time`, not to the current time.
296
+ # If the resulting time is in the past, the task is made available for dispatch immediately.
297
+ sig { params(value: T.nilable(Google::Protobuf::Duration)).void }
298
+ def start_delay=(value)
299
+ end
300
+
301
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
302
+ # When updated, the time is added to the original `schedule_time`, not to the current time.
303
+ # If the resulting time is in the past, the task is made available for dispatch immediately.
304
+ sig { void }
305
+ def clear_start_delay
306
+ end
307
+
265
308
  sig { params(field: String).returns(T.untyped) }
266
309
  def [](field)
267
310
  end
@@ -338,7 +381,8 @@ class Temporalio::Api::Activity::V1::ActivityExecutionInfo
338
381
  total_heartbeat_count: T.nilable(Integer),
339
382
  sdk_name: T.nilable(String),
340
383
  sdk_version: T.nilable(String),
341
- start_delay: T.nilable(Google::Protobuf::Duration)
384
+ start_delay: T.nilable(Google::Protobuf::Duration),
385
+ execution_time: T.nilable(Google::Protobuf::Timestamp)
342
386
  ).void
343
387
  end
344
388
  def initialize(
@@ -378,7 +422,8 @@ class Temporalio::Api::Activity::V1::ActivityExecutionInfo
378
422
  total_heartbeat_count: 0,
379
423
  sdk_name: "",
380
424
  sdk_version: "",
381
- start_delay: nil
425
+ start_delay: nil,
426
+ execution_time: nil
382
427
  )
383
428
  end
384
429
 
@@ -673,17 +718,20 @@ class Temporalio::Api::Activity::V1::ActivityExecutionInfo
673
718
  def clear_schedule_time
674
719
  end
675
720
 
676
- # Scheduled time + schedule to close timeout.
721
+ # The time at which the activity's Schedule-to-Close timeout expires.
722
+ # Calculated as `schedule_time` + `start_delay` + `schedule_to_close_timeout`.
677
723
  sig { returns(T.nilable(Google::Protobuf::Timestamp)) }
678
724
  def expiration_time
679
725
  end
680
726
 
681
- # Scheduled time + schedule to close timeout.
727
+ # The time at which the activity's Schedule-to-Close timeout expires.
728
+ # Calculated as `schedule_time` + `start_delay` + `schedule_to_close_timeout`.
682
729
  sig { params(value: T.nilable(Google::Protobuf::Timestamp)).void }
683
730
  def expiration_time=(value)
684
731
  end
685
732
 
686
- # Scheduled time + schedule to close timeout.
733
+ # The time at which the activity's Schedule-to-Close timeout expires.
734
+ # Calculated as `schedule_time` + `start_delay` + `schedule_to_close_timeout`.
687
735
  sig { void }
688
736
  def clear_expiration_time
689
737
  end
@@ -979,21 +1027,39 @@ class Temporalio::Api::Activity::V1::ActivityExecutionInfo
979
1027
  def clear_sdk_version
980
1028
  end
981
1029
 
982
- # Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
1030
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
983
1031
  sig { returns(T.nilable(Google::Protobuf::Duration)) }
984
1032
  def start_delay
985
1033
  end
986
1034
 
987
- # Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
1035
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
988
1036
  sig { params(value: T.nilable(Google::Protobuf::Duration)).void }
989
1037
  def start_delay=(value)
990
1038
  end
991
1039
 
992
- # Time to wait before dispatching the first activity task. This delay is not applied to retry attempts.
1040
+ # Time to wait before making the first activity task available for dispatch. This delay is not applied to retry attempts.
993
1041
  sig { void }
994
1042
  def clear_start_delay
995
1043
  end
996
1044
 
1045
+ # The time at which the first activity task is made available for dispatch, computed as
1046
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1047
+ sig { returns(T.nilable(Google::Protobuf::Timestamp)) }
1048
+ def execution_time
1049
+ end
1050
+
1051
+ # The time at which the first activity task is made available for dispatch, computed as
1052
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1053
+ sig { params(value: T.nilable(Google::Protobuf::Timestamp)).void }
1054
+ def execution_time=(value)
1055
+ end
1056
+
1057
+ # The time at which the first activity task is made available for dispatch, computed as
1058
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1059
+ sig { void }
1060
+ def clear_execution_time
1061
+ end
1062
+
997
1063
  sig { params(field: String).returns(T.untyped) }
998
1064
  def [](field)
999
1065
  end
@@ -1046,7 +1112,8 @@ class Temporalio::Api::Activity::V1::ActivityExecutionListInfo
1046
1112
  task_queue: T.nilable(String),
1047
1113
  state_transition_count: T.nilable(Integer),
1048
1114
  state_size_bytes: T.nilable(Integer),
1049
- execution_duration: T.nilable(Google::Protobuf::Duration)
1115
+ execution_duration: T.nilable(Google::Protobuf::Duration),
1116
+ execution_time: T.nilable(Google::Protobuf::Timestamp)
1050
1117
  ).void
1051
1118
  end
1052
1119
  def initialize(
@@ -1060,7 +1127,8 @@ class Temporalio::Api::Activity::V1::ActivityExecutionListInfo
1060
1127
  task_queue: "",
1061
1128
  state_transition_count: 0,
1062
1129
  state_size_bytes: 0,
1063
- execution_duration: nil
1130
+ execution_duration: nil,
1131
+ execution_time: nil
1064
1132
  )
1065
1133
  end
1066
1134
 
@@ -1235,6 +1303,24 @@ class Temporalio::Api::Activity::V1::ActivityExecutionListInfo
1235
1303
  def clear_execution_duration
1236
1304
  end
1237
1305
 
1306
+ # The time at which the first activity task is made available for dispatch, computed as
1307
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1308
+ sig { returns(T.nilable(Google::Protobuf::Timestamp)) }
1309
+ def execution_time
1310
+ end
1311
+
1312
+ # The time at which the first activity task is made available for dispatch, computed as
1313
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1314
+ sig { params(value: T.nilable(Google::Protobuf::Timestamp)).void }
1315
+ def execution_time=(value)
1316
+ end
1317
+
1318
+ # The time at which the first activity task is made available for dispatch, computed as
1319
+ # `schedule_time + start_delay`. Same as `schedule_time` if `start_delay` is not set.
1320
+ sig { void }
1321
+ def clear_execution_time
1322
+ end
1323
+
1238
1324
  sig { params(field: String).returns(T.untyped) }
1239
1325
  def [](field)
1240
1326
  end