From f081daf50d73c48f9872062b9ac768a0e960dfe9 Mon Sep 17 00:00:00 2001 From: Kevin Stewart Date: Mon, 2 Nov 2026 10:08:33 -0800 Subject: [PATCH 1/3] temporal: Add Workflow Updates and Update-With-Start --- README.md | 131 +++++++- .../temporal/api/enums/v1/event_type_pb.rb | 2 +- lib/gen/temporal/api/enums/v1/update_pb.rb | 3 +- lib/gen/temporal/api/history/v1/message_pb.rb | 3 +- .../workflowservice/v1/request_response_pb.rb | 6 +- .../api/workflowservice/v1/service_pb.rb | 2 +- .../workflowservice/v1/service_services_pb.rb | 1 + lib/temporal.rb | 5 + lib/temporal/client.rb | 2 + lib/temporal/client_updates.rb | 78 +++++ lib/temporal/connection/grpc.rb | 19 +- lib/temporal/connection/serializer.rb | 2 + .../connection/serializer/protocol_message.rb | 18 ++ lib/temporal/connection/workflow_updates.rb | 99 ++++++ lib/temporal/testing/temporal_override.rb | 15 + lib/temporal/update_handle.rb | 40 +++ lib/temporal/workflow/command.rb | 1 + lib/temporal/workflow/context.rb | 78 ++++- lib/temporal/workflow/executor.rb | 7 +- lib/temporal/workflow/future.rb | 16 + lib/temporal/workflow/history.rb | 45 ++- lib/temporal/workflow/history/event_target.rb | 12 +- .../workflow/history/update_request.rb | 23 ++ lib/temporal/workflow/state_manager.rb | 47 ++- lib/temporal/workflow/task_processor.rb | 5 +- lib/temporal/workflow/update_execution.rb | 108 +++++++ lib/temporal/workflow/update_registry.rb | 122 +++++++ rbi/temporal-ruby.rbi | 2 + scripts/backport_workflow_updates.rb | 114 +++++++ spec/integration/update_with_start_spec.rb | 301 ++++++++++++++++++ spec/unit/lib/temporal/client_updates_spec.rb | 123 +++++++ .../lib/temporal/workflow/context_spec.rb | 3 +- .../workflow/update_execution_spec.rb | 139 ++++++++ .../unit/lib/temporal/workflow/update_spec.rb | 281 ++++++++++++++++ 34 files changed, 1828 insertions(+), 25 deletions(-) create mode 100644 lib/temporal/client_updates.rb create mode 100644 lib/temporal/connection/serializer/protocol_message.rb create mode 100644 lib/temporal/connection/workflow_updates.rb create mode 100644 lib/temporal/update_handle.rb create mode 100644 lib/temporal/workflow/history/update_request.rb create mode 100644 lib/temporal/workflow/update_execution.rb create mode 100644 lib/temporal/workflow/update_registry.rb create mode 100644 scripts/backport_workflow_updates.rb create mode 100644 spec/integration/update_with_start_spec.rb create mode 100644 spec/unit/lib/temporal/client_updates_spec.rb create mode 100644 spec/unit/lib/temporal/workflow/update_execution_spec.rb create mode 100644 spec/unit/lib/temporal/workflow/update_spec.rb diff --git a/README.md b/README.md index 1d355dfed..afca45632 100644 --- a/README.md +++ b/README.md @@ -423,10 +423,137 @@ run_id = Temporal.start_workflow(RenewSubscriptionWorkflow, user_id, This is opt-in. The existing workflow keeps its original input; arguments in the second start call are not delivered to it. The default remains to raise `Temporal::WorkflowExecutionAlreadyStartedFailure`. The separate `workflow_id_reuse_policy` controls what happens after the prior run closes. -`workflow_id_conflict_policy` is supported only for ordinary `start_workflow` calls, not -signal-with-start, `schedule_workflow`, or `Temporal::Testing.local!`. +`workflow_id_conflict_policy` is supported for ordinary `start_workflow` calls and the +Update-With-Start APIs below, not signal-with-start, `schedule_workflow`, or +`Temporal::Testing.local!`. + +## Workflow Updates and Update-With-Start + +Updates are requests with a durable result. A handler can validate a request, change workflow state, +await Activities or timers, and return a value or an error to its caller. Unlike a query, an accepted +Update is recorded in history and is replayed after a worker restart. Unlike a signal, it has a result. +This implementation is tested against **Temporal Server 1.32.0**. Deploy workers with Update support +before enabling clients that send Updates to their task queues. + +Register handlers synchronously in `execute`, before its first blocking operation. Update arguments +are positional, just like workflow and Activity arguments. A validator raises to reject a request; +its return value is ignored. Validators must be deterministic, synchronous and read-only: no state +mutation, I/O, Activities, timers, Future callbacks, side effects or blocking. Validators are **not** run again when +replaying an already accepted Update. + +```ruby +class BillingCoordinator < Temporal::Workflow + def execute(account_id) + busy = false + stopped = false + + workflow.on_update('cancel_invoice', validator: ->(invoice_id) { + raise ArgumentError, 'invoice ID required' if invoice_id.to_s.empty? + }) do |invoice_id| + # Handlers interleave whenever they await an Activity/timer/condition. + # Serialize operations that must observe and modify consistent shared state. + workflow.wait_until { !busy } + busy = true + begin + # The Activity must make its external operation idempotent. A stable + # business operation ID can be passed to the external system as its key. + CancelInvoiceActivity.execute!(account_id, invoice_id, workflow.current_update[:id]) + ensure + busy = false + end + end + + workflow.on_signal('stop') { stopped = true } + workflow.wait_until { stopped } + workflow.wait_until { workflow.all_update_handlers_finished? } + end +end + +result = Temporal.execute_update_with_start_workflow( + BillingCoordinator, 'cancel_invoice', 'invoice-123', + start_args: ['account-456'], + options: { workflow_id: 'billing-account-456', task_queue: 'billing', + workflow_id_reuse_policy: :allow }, + workflow_id_conflict_policy: :use_existing, + update_id: 'cancel-request-789', + request_id: 'start-request-789', + timeout: 60 +) +``` + +This uses the server's atomic `ExecuteMultiOperation` (Start + Update) API. If no run exists, the +server starts one and delivers the Update. For a running workflow, the required conflict policy is +`:use_existing` or `:fail`. The existing `workflow_id_reuse_policy` controls closed workflows +(`:allow`, `:allow_failed`, or `:reject`). Start arguments/options are only applied when starting a +new run. Cron schedules, start delays and Signal-With-Start options cannot be combined with this API. +A validator rejection does **not** undo a workflow that was started by Update-With-Start. + +To return after durable acceptance and wait for the result later: + +```ruby +handle = Temporal.start_update_with_start_workflow( + BillingCoordinator, 'cancel_invoice', 'invoice-123', + start_args: ['account-456'], options: { workflow_id: 'billing-account-456' }, + workflow_id_conflict_policy: :use_existing, update_id: 'cancel-request-789', + wait_for_stage: :accepted # :completed is also supported +) +result = handle.result(timeout: 60) + +# Save all four fields before exiting the client process: +# handle.namespace, handle.workflow_id, handle.run_id, handle.update_id +saved = Temporal.get_workflow_update_handle( + handle.workflow_id, handle.run_id, handle.update_id, namespace: handle.namespace +) +result = saved.result(timeout: 60) + +# Update an already running execution, with no start operation: +result = Temporal.execute_workflow_update( + BillingCoordinator, 'cancel_invoice', handle.workflow_id, handle.run_id, 'invoice-124', + update_id: 'cancel-request-790', timeout: 60 +) +# start_workflow_update has the same arguments and returns an accepted handle. +``` + +`WorkflowUpdateFailed` represents a validator rejection or handler exception; `cause` is the +converted application error. Handler errors fail the Update, leaving the Workflow running. RPC +failures remain gRPC errors; expiration of the overall wait budget raises `Temporal::TimeoutError`. +A timeout does not cancel the Update. Reuse both IDs after an ambiguous Update-With-Start failure, +or retrieve the handle by the saved run ID. The SDK retains request IDs across its internal retries. +`workflow_started` on a handle reflects the first successful server start response; after a lost +response it cannot establish which caller originally created the run. + +Update IDs deduplicate **within one Workflow run**, not across new runs or reset branches. They do +not provide exactly-once external effects: handlers replay, Activities retry, and resets can reapply +Updates. Use idempotent Activities and stable business keys at the external boundary. Validators and +handlers must follow the same determinism/versioning rules as the rest of the Workflow. Update +headers use the configured converter and header propagators; a handler can read decoded headers +from `workflow.current_update[:headers]` and its ID/name from `:id`/`:name`. + +Normal workflow completion waits for accepted handlers to finish. Before continuing as new, +explicitly wait for `workflow.all_update_handlers_finished?`; a handler cannot complete, fail, or +continue the Workflow itself. Future `done`/`failed` callbacks registered inside an Update inherit +that Update's context and restrictions, even if another part of the workflow created the Future. +The Update waits for these callbacks as well as the handler to finish. A callback exception is +delivered to the suspended handler's rescue/ensure blocks, or fails the Update if the handler has +already returned. Other owned callbacks still finish before the outcome is sent. Do not make a +callback wait for its own Update to complete. External termination/timeouts can still interrupt +in-flight Updates. +The local `Temporal::Testing.local!` simulator does not implement Updates and raises rather than +sending these requests to a server. Use the integration suite with an isolated Temporal test server: + +```sh +temporal server start-dev --headless --ip 127.0.0.1 --port 17233 +TEMPORAL_UPDATE_INTEGRATION=1 TEMPORAL_UPDATE_PORT=17233 \ + bundle exec rspec spec/integration/update_with_start_spec.rb +``` + +The generated protobuf additions are a narrow backport of the Update/ExecuteMultiOperation surface +from [Temporal API v1.44.0](https://github.com/temporalio/api/tree/v1.44.0/temporal/api). +`make proto` applies `scripts/backport_workflow_updates.rb` after ordinary generation; the script can +also be run directly and is idempotent. Other API definitions and the proto submodule pin are retained. + ## Execution Options There are lots of ways in which you can configure your Workflows and Activities. The common ones diff --git a/lib/gen/temporal/api/enums/v1/event_type_pb.rb b/lib/gen/temporal/api/enums/v1/event_type_pb.rb index 02b28b765..17a228ed4 100644 --- a/lib/gen/temporal/api/enums/v1/event_type_pb.rb +++ b/lib/gen/temporal/api/enums/v1/event_type_pb.rb @@ -5,7 +5,7 @@ require 'google/protobuf' -descriptor_data = "\n&temporal/api/enums/v1/event_type.proto\x12\x15temporal.api.enums.v1*\x8e\x11\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12)\n%EVENT_TYPE_WORKFLOW_EXECUTION_STARTED\x10\x01\x12+\n\'EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED\x10\x02\x12(\n$EVENT_TYPE_WORKFLOW_EXECUTION_FAILED\x10\x03\x12+\n\'EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT\x10\x04\x12&\n\"EVENT_TYPE_WORKFLOW_TASK_SCHEDULED\x10\x05\x12$\n EVENT_TYPE_WORKFLOW_TASK_STARTED\x10\x06\x12&\n\"EVENT_TYPE_WORKFLOW_TASK_COMPLETED\x10\x07\x12&\n\"EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT\x10\x08\x12#\n\x1f\x45VENT_TYPE_WORKFLOW_TASK_FAILED\x10\t\x12&\n\"EVENT_TYPE_ACTIVITY_TASK_SCHEDULED\x10\n\x12$\n EVENT_TYPE_ACTIVITY_TASK_STARTED\x10\x0b\x12&\n\"EVENT_TYPE_ACTIVITY_TASK_COMPLETED\x10\x0c\x12#\n\x1f\x45VENT_TYPE_ACTIVITY_TASK_FAILED\x10\r\x12&\n\"EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT\x10\x0e\x12-\n)EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED\x10\x0f\x12%\n!EVENT_TYPE_ACTIVITY_TASK_CANCELED\x10\x10\x12\x1c\n\x18\x45VENT_TYPE_TIMER_STARTED\x10\x11\x12\x1a\n\x16\x45VENT_TYPE_TIMER_FIRED\x10\x12\x12\x1d\n\x19\x45VENT_TYPE_TIMER_CANCELED\x10\x13\x12\x32\n.EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED\x10\x14\x12*\n&EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED\x10\x15\x12\x43\n?EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED\x10\x16\x12@\n\n\x15workflow_task_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\"\n\x1a\x63ontinued_execution_run_id\x18\n \x01(\t\x12@\n\tinitiator\x18\x0b \x01(\x0e\x32-.temporal.api.enums.v1.ContinueAsNewInitiator\x12;\n\x11\x63ontinued_failure\x18\x0c \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\r \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12!\n\x19original_execution_run_id\x18\x0e \x01(\t\x12\x10\n\x08identity\x18\x0f \x01(\t\x12\x1e\n\x16\x66irst_execution_run_id\x18\x10 \x01(\t\x12\x39\n\x0cretry_policy\x18\x11 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x0f\n\x07\x61ttempt\x18\x12 \x01(\x05\x12L\n\"workflow_execution_expiration_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x15\n\rcron_schedule\x18\x14 \x01(\t\x12\x44\n\x1b\x66irst_workflow_task_backoff\x18\x15 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12*\n\x04memo\x18\x16 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x17 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12\x45\n\x16prev_auto_reset_points\x18\x18 \x01(\x0b\x32%.temporal.api.workflow.v1.ResetPoints\x12.\n\x06header\x18\x19 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12&\n\x1eparent_initiated_event_version\x18\x1a \x01(\x03\"\xa5\x01\n)WorkflowExecutionCompletedEventAttributes\x12\x30\n\x06result\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x1c\n\x14new_execution_run_id\x18\x03 \x01(\t\"\xdb\x01\n&WorkflowExecutionFailedEventAttributes\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x36\n\x0bretry_state\x18\x02 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12\x1c\n\x14new_execution_run_id\x18\x04 \x01(\t\"\x80\x01\n(WorkflowExecutionTimedOutEventAttributes\x12\x36\n\x0bretry_state\x18\x01 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\x12\x1c\n\x14new_execution_run_id\x18\x02 \x01(\t\"\xb8\x06\n.WorkflowExecutionContinuedAsNewEventAttributes\x12\x1c\n\x14new_execution_run_id\x18\x01 \x01(\t\x12;\n\rworkflow_type\x18\x02 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x38\n\ntask_queue\x18\x03 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x04 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12=\n\x14workflow_run_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12>\n\x15workflow_task_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12(\n workflow_task_completed_event_id\x18\x07 \x01(\x03\x12?\n\x16\x62\x61\x63koff_start_interval\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12@\n\tinitiator\x18\t \x01(\x0e\x32-.temporal.api.enums.v1.ContinueAsNewInitiator\x12\x31\n\x07\x66\x61ilure\x18\n \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\x0b \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12.\n\x06header\x18\x0c \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12*\n\x04memo\x18\r \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x0e \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\"\xb2\x01\n$WorkflowTaskScheduledEventAttributes\x12\x38\n\ntask_queue\x18\x01 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12?\n\x16start_to_close_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x0f\n\x07\x61ttempt\x18\x03 \x01(\x05\"\xa3\x01\n\"WorkflowTaskStartedEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12\x1f\n\x17suggest_continue_as_new\x18\x04 \x01(\x08\x12\x1a\n\x12history_size_bytes\x18\x05 \x01(\x03\"\xda\x02\n$WorkflowTaskCompletedEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x17\n\x0f\x62inary_checksum\x18\x04 \x01(\t\x12\x42\n\x0eworker_version\x18\x05 \x01(\x0b\x32*.temporal.api.common.v1.WorkerVersionStamp\x12H\n\x0csdk_metadata\x18\x06 \x01(\x0b\x32\x32.temporal.api.sdk.v1.WorkflowTaskCompletedMetadata\x12\x43\n\x11metering_metadata\x18\r \x01(\x0b\x32(.temporal.api.common.v1.MeteringMetadata\"\x95\x01\n#WorkflowTaskTimedOutEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12\x38\n\x0ctimeout_type\x18\x03 \x01(\x0e\x32\".temporal.api.enums.v1.TimeoutType\"\xbb\x02\n!WorkflowTaskFailedEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12=\n\x05\x63\x61use\x18\x03 \x01(\x0e\x32..temporal.api.enums.v1.WorkflowTaskFailedCause\x12\x31\n\x07\x66\x61ilure\x18\x04 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x10\n\x08identity\x18\x05 \x01(\t\x12\x13\n\x0b\x62\x61se_run_id\x18\x06 \x01(\t\x12\x12\n\nnew_run_id\x18\x07 \x01(\t\x12\x1a\n\x12\x66ork_event_version\x18\x08 \x01(\x03\x12\x17\n\x0f\x62inary_checksum\x18\t \x01(\t\"\x83\x05\n$ActivityTaskScheduledEventAttributes\x12\x13\n\x0b\x61\x63tivity_id\x18\x01 \x01(\t\x12;\n\ractivity_type\x18\x02 \x01(\x0b\x32$.temporal.api.common.v1.ActivityType\x12\x38\n\ntask_queue\x18\x04 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12.\n\x06header\x18\x05 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12/\n\x05input\x18\x06 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x42\n\x19schedule_to_close_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x42\n\x19schedule_to_start_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12?\n\x16start_to_close_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12:\n\x11heartbeat_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12(\n workflow_task_completed_event_id\x18\x0b \x01(\x03\x12\x39\n\x0cretry_policy\x18\x0c \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicyJ\x04\x08\x03\x10\x04\"\xaf\x01\n\"ActivityTaskStartedEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x04 \x01(\x05\x12\x36\n\x0clast_failure\x18\x05 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xa0\x01\n$ActivityTaskCompletedEventAttributes\x12\x30\n\x06result\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x1a\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x12\x10\n\x08identity\x18\x04 \x01(\t\"\xd6\x01\n!ActivityTaskFailedEventAttributes\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x1a\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x12\x10\n\x08identity\x18\x04 \x01(\t\x12\x36\n\x0bretry_state\x18\x05 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\"\xc6\x01\n#ActivityTaskTimedOutEventAttributes\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x1a\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x12\x36\n\x0bretry_state\x18\x04 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\"r\n*ActivityTaskCancelRequestedEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\"\xca\x01\n#ActivityTaskCanceledEventAttributes\x12\x31\n\x07\x64\x65tails\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12(\n latest_cancel_requested_event_id\x18\x02 \x01(\x03\x12\x1a\n\x12scheduled_event_id\x18\x03 \x01(\x03\x12\x18\n\x10started_event_id\x18\x04 \x01(\x03\x12\x10\n\x08identity\x18\x05 \x01(\t\"\x99\x01\n\x1bTimerStartedEventAttributes\x12\x10\n\x08timer_id\x18\x01 \x01(\t\x12>\n\x15start_to_fire_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\"G\n\x19TimerFiredEventAttributes\x12\x10\n\x08timer_id\x18\x01 \x01(\t\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\"\x86\x01\n\x1cTimerCanceledEventAttributes\x12\x10\n\x08timer_id\x18\x01 \x01(\t\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12\x10\n\x08identity\x18\x04 \x01(\t\"\xc7\x01\n/WorkflowExecutionCancelRequestedEventAttributes\x12\r\n\x05\x63\x61use\x18\x01 \x01(\t\x12#\n\x1b\x65xternal_initiated_event_id\x18\x02 \x01(\x03\x12N\n\x1b\x65xternal_workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x10\n\x08identity\x18\x04 \x01(\t\"\x87\x01\n(WorkflowExecutionCanceledEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x31\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\"\xe9\x02\n\x1dMarkerRecordedEventAttributes\x12\x13\n\x0bmarker_name\x18\x01 \x01(\t\x12T\n\x07\x64\x65tails\x18\x02 \x03(\x0b\x32\x43.temporal.api.history.v1.MarkerRecordedEventAttributes.DetailsEntry\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12.\n\x06header\x18\x04 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12\x31\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x1aP\n\x0c\x44\x65tailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads:\x02\x38\x01\"\xd7\x01\n(WorkflowExecutionSignaledEventAttributes\x12\x13\n\x0bsignal_name\x18\x01 \x01(\t\x12/\n\x05input\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x03 \x01(\t\x12.\n\x06header\x18\x04 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12#\n\x1bskip_generate_workflow_task\x18\x05 \x01(\x08\"\x81\x01\n*WorkflowExecutionTerminatedEventAttributes\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x31\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x03 \x01(\t\"\x98\x02\n>RequestCancelExternalWorkflowExecutionInitiatedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x0f\n\x07\x63ontrol\x18\x04 \x01(\t\x12\x1b\n\x13\x63hild_workflow_only\x18\x05 \x01(\x08\x12\x0e\n\x06reason\x18\x06 \x01(\t\"\xd6\x02\n;RequestCancelExternalWorkflowExecutionFailedEventAttributes\x12P\n\x05\x63\x61use\x18\x01 \x01(\x0e\x32\x41.temporal.api.enums.v1.CancelExternalWorkflowExecutionFailedCause\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x11\n\tnamespace\x18\x03 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x04 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x1a\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x0f\n\x07\x63ontrol\x18\x06 \x01(\t\"\xc5\x01\n7ExternalWorkflowExecutionCancelRequestedEventAttributes\x12\x1a\n\x12initiated_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x04 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\"\xf7\x02\n7SignalExternalWorkflowExecutionInitiatedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\t \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x13\n\x0bsignal_name\x18\x04 \x01(\t\x12/\n\x05input\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x0f\n\x07\x63ontrol\x18\x06 \x01(\t\x12\x1b\n\x13\x63hild_workflow_only\x18\x07 \x01(\x08\x12.\n\x06header\x18\x08 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\"\xcf\x02\n4SignalExternalWorkflowExecutionFailedEventAttributes\x12P\n\x05\x63\x61use\x18\x01 \x01(\x0e\x32\x41.temporal.api.enums.v1.SignalExternalWorkflowExecutionFailedCause\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x11\n\tnamespace\x18\x03 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x04 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x1a\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x0f\n\x07\x63ontrol\x18\x06 \x01(\t\"\xcf\x01\n0ExternalWorkflowExecutionSignaledEventAttributes\x12\x1a\n\x12initiated_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x05 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x0f\n\x07\x63ontrol\x18\x04 \x01(\t\"\x9e\x01\n-UpsertWorkflowSearchAttributesEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x43\n\x11search_attributes\x18\x02 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\"\x8a\x01\n)WorkflowPropertiesModifiedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x33\n\rupserted_memo\x18\x02 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\"\xa4\x07\n3StartChildWorkflowExecutionInitiatedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x12 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x38\n\ntask_queue\x18\x04 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x43\n\x1aworkflow_execution_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12=\n\x14workflow_run_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12>\n\x15workflow_task_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x45\n\x13parent_close_policy\x18\t \x01(\x0e\x32(.temporal.api.enums.v1.ParentClosePolicy\x12\x0f\n\x07\x63ontrol\x18\n \x01(\t\x12(\n workflow_task_completed_event_id\x18\x0b \x01(\x03\x12N\n\x18workflow_id_reuse_policy\x18\x0c \x01(\x0e\x32,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x39\n\x0cretry_policy\x18\r \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x0e \x01(\t\x12.\n\x06header\x18\x0f \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12*\n\x04memo\x18\x10 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x11 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\"\xd2\x02\n0StartChildWorkflowExecutionFailedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x08 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12L\n\x05\x63\x61use\x18\x04 \x01(\x0e\x32=.temporal.api.enums.v1.StartChildWorkflowExecutionFailedCause\x12\x0f\n\x07\x63ontrol\x18\x05 \x01(\t\x12\x1a\n\x12initiated_event_id\x18\x06 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\x07 \x01(\x03\"\xa7\x02\n,ChildWorkflowExecutionStartedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x06 \x01(\t\x12\x1a\n\x12initiated_event_id\x18\x02 \x01(\x03\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12.\n\x06header\x18\x05 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\"\xc5\x02\n.ChildWorkflowExecutionCompletedEventAttributes\x12\x30\n\x06result\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x1a\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\"\xfb\x02\n+ChildWorkflowExecutionFailedEventAttributes\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x08 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x1a\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\x12\x36\n\x0bretry_state\x18\x07 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\"\xc5\x02\n-ChildWorkflowExecutionCanceledEventAttributes\x12\x31\n\x07\x64\x65tails\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x03 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x1a\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\"\xca\x02\n-ChildWorkflowExecutionTimedOutEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x07 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x1a\n\x12initiated_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\x12\x36\n\x0bretry_state\x18\x06 \x01(\x0e\x32!.temporal.api.enums.v1.RetryState\"\x94\x02\n/ChildWorkflowExecutionTerminatedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x06 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x1a\n\x12initiated_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\"\xd2\x02\n3WorkflowPropertiesModifiedExternallyEventAttributes\x12\x16\n\x0enew_task_queue\x18\x01 \x01(\t\x12\x42\n\x19new_workflow_task_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x41\n\x18new_workflow_run_timeout\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12G\n\x1enew_workflow_execution_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x33\n\rupserted_memo\x18\x05 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\"\x90\x01\n3ActivityPropertiesModifiedExternallyEventAttributes\x12\x1a\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12=\n\x10new_retry_policy\x18\x02 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\"\xdc\x01\n.WorkflowExecutionUpdateAcceptedEventAttributes\x12\x1c\n\x14protocol_instance_id\x18\x01 \x01(\t\x12#\n\x1b\x61\x63\x63\x65pted_request_message_id\x18\x02 \x01(\t\x12,\n$accepted_request_sequencing_event_id\x18\x03 \x01(\x03\x12\x39\n\x10\x61\x63\x63\x65pted_request\x18\x04 \x01(\x0b\x32\x1f.temporal.api.update.v1.Request\"\x8f\x01\n/WorkflowExecutionUpdateCompletedEventAttributes\x12*\n\x04meta\x18\x01 \x01(\x0b\x32\x1c.temporal.api.update.v1.Meta\x12\x30\n\x07outcome\x18\x02 \x01(\x0b\x32\x1f.temporal.api.update.v1.Outcome\"\x8f\x02\n.WorkflowExecutionUpdateRejectedEventAttributes\x12\x1c\n\x14protocol_instance_id\x18\x01 \x01(\t\x12#\n\x1brejected_request_message_id\x18\x02 \x01(\t\x12,\n$rejected_request_sequencing_event_id\x18\x03 \x01(\x03\x12\x39\n\x10rejected_request\x18\x04 \x01(\x0b\x32\x1f.temporal.api.update.v1.Request\x12\x31\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xe5/\n\x0cHistoryEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x01(\x03\x12\x34\n\nevent_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x34\n\nevent_type\x18\x03 \x01(\x0e\x32 .temporal.api.enums.v1.EventType\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12\x0f\n\x07task_id\x18\x05 \x01(\x03\x12\x1a\n\x11worker_may_ignore\x18\xac\x02 \x01(\x08\x12w\n+workflow_execution_started_event_attributes\x18\x06 \x01(\x0b\x32@.temporal.api.history.v1.WorkflowExecutionStartedEventAttributesH\x00\x12{\n-workflow_execution_completed_event_attributes\x18\x07 \x01(\x0b\x32\x42.temporal.api.history.v1.WorkflowExecutionCompletedEventAttributesH\x00\x12u\n*workflow_execution_failed_event_attributes\x18\x08 \x01(\x0b\x32?.temporal.api.history.v1.WorkflowExecutionFailedEventAttributesH\x00\x12z\n-workflow_execution_timed_out_event_attributes\x18\t \x01(\x0b\x32\x41.temporal.api.history.v1.WorkflowExecutionTimedOutEventAttributesH\x00\x12q\n(workflow_task_scheduled_event_attributes\x18\n \x01(\x0b\x32=.temporal.api.history.v1.WorkflowTaskScheduledEventAttributesH\x00\x12m\n&workflow_task_started_event_attributes\x18\x0b \x01(\x0b\x32;.temporal.api.history.v1.WorkflowTaskStartedEventAttributesH\x00\x12q\n(workflow_task_completed_event_attributes\x18\x0c \x01(\x0b\x32=.temporal.api.history.v1.WorkflowTaskCompletedEventAttributesH\x00\x12p\n(workflow_task_timed_out_event_attributes\x18\r \x01(\x0b\x32<.temporal.api.history.v1.WorkflowTaskTimedOutEventAttributesH\x00\x12k\n%workflow_task_failed_event_attributes\x18\x0e \x01(\x0b\x32:.temporal.api.history.v1.WorkflowTaskFailedEventAttributesH\x00\x12q\n(activity_task_scheduled_event_attributes\x18\x0f \x01(\x0b\x32=.temporal.api.history.v1.ActivityTaskScheduledEventAttributesH\x00\x12m\n&activity_task_started_event_attributes\x18\x10 \x01(\x0b\x32;.temporal.api.history.v1.ActivityTaskStartedEventAttributesH\x00\x12q\n(activity_task_completed_event_attributes\x18\x11 \x01(\x0b\x32=.temporal.api.history.v1.ActivityTaskCompletedEventAttributesH\x00\x12k\n%activity_task_failed_event_attributes\x18\x12 \x01(\x0b\x32:.temporal.api.history.v1.ActivityTaskFailedEventAttributesH\x00\x12p\n(activity_task_timed_out_event_attributes\x18\x13 \x01(\x0b\x32<.temporal.api.history.v1.ActivityTaskTimedOutEventAttributesH\x00\x12^\n\x1etimer_started_event_attributes\x18\x14 \x01(\x0b\x32\x34.temporal.api.history.v1.TimerStartedEventAttributesH\x00\x12Z\n\x1ctimer_fired_event_attributes\x18\x15 \x01(\x0b\x32\x32.temporal.api.history.v1.TimerFiredEventAttributesH\x00\x12~\n/activity_task_cancel_requested_event_attributes\x18\x16 \x01(\x0b\x32\x43.temporal.api.history.v1.ActivityTaskCancelRequestedEventAttributesH\x00\x12o\n\'activity_task_canceled_event_attributes\x18\x17 \x01(\x0b\x32<.temporal.api.history.v1.ActivityTaskCanceledEventAttributesH\x00\x12`\n\x1ftimer_canceled_event_attributes\x18\x18 \x01(\x0b\x32\x35.temporal.api.history.v1.TimerCanceledEventAttributesH\x00\x12\x62\n marker_recorded_event_attributes\x18\x19 \x01(\x0b\x32\x36.temporal.api.history.v1.MarkerRecordedEventAttributesH\x00\x12y\n,workflow_execution_signaled_event_attributes\x18\x1a \x01(\x0b\x32\x41.temporal.api.history.v1.WorkflowExecutionSignaledEventAttributesH\x00\x12}\n.workflow_execution_terminated_event_attributes\x18\x1b \x01(\x0b\x32\x43.temporal.api.history.v1.WorkflowExecutionTerminatedEventAttributesH\x00\x12\x88\x01\n4workflow_execution_cancel_requested_event_attributes\x18\x1c \x01(\x0b\x32H.temporal.api.history.v1.WorkflowExecutionCancelRequestedEventAttributesH\x00\x12y\n,workflow_execution_canceled_event_attributes\x18\x1d \x01(\x0b\x32\x41.temporal.api.history.v1.WorkflowExecutionCanceledEventAttributesH\x00\x12\xa8\x01\nErequest_cancel_external_workflow_execution_initiated_event_attributes\x18\x1e \x01(\x0b\x32W.temporal.api.history.v1.RequestCancelExternalWorkflowExecutionInitiatedEventAttributesH\x00\x12\xa2\x01\nBrequest_cancel_external_workflow_execution_failed_event_attributes\x18\x1f \x01(\x0b\x32T.temporal.api.history.v1.RequestCancelExternalWorkflowExecutionFailedEventAttributesH\x00\x12\x99\x01\n=external_workflow_execution_cancel_requested_event_attributes\x18 \x01(\x0b\x32P.temporal.api.history.v1.ExternalWorkflowExecutionCancelRequestedEventAttributesH\x00\x12\x87\x01\n4workflow_execution_continued_as_new_event_attributes\x18! \x01(\x0b\x32G.temporal.api.history.v1.WorkflowExecutionContinuedAsNewEventAttributesH\x00\x12\x91\x01\n9start_child_workflow_execution_initiated_event_attributes\x18\" \x01(\x0b\x32L.temporal.api.history.v1.StartChildWorkflowExecutionInitiatedEventAttributesH\x00\x12\x8b\x01\n6start_child_workflow_execution_failed_event_attributes\x18# \x01(\x0b\x32I.temporal.api.history.v1.StartChildWorkflowExecutionFailedEventAttributesH\x00\x12\x82\x01\n1child_workflow_execution_started_event_attributes\x18$ \x01(\x0b\x32\x45.temporal.api.history.v1.ChildWorkflowExecutionStartedEventAttributesH\x00\x12\x86\x01\n3child_workflow_execution_completed_event_attributes\x18% \x01(\x0b\x32G.temporal.api.history.v1.ChildWorkflowExecutionCompletedEventAttributesH\x00\x12\x80\x01\n0child_workflow_execution_failed_event_attributes\x18& \x01(\x0b\x32\x44.temporal.api.history.v1.ChildWorkflowExecutionFailedEventAttributesH\x00\x12\x84\x01\n2child_workflow_execution_canceled_event_attributes\x18\' \x01(\x0b\x32\x46.temporal.api.history.v1.ChildWorkflowExecutionCanceledEventAttributesH\x00\x12\x85\x01\n3child_workflow_execution_timed_out_event_attributes\x18( \x01(\x0b\x32\x46.temporal.api.history.v1.ChildWorkflowExecutionTimedOutEventAttributesH\x00\x12\x88\x01\n4child_workflow_execution_terminated_event_attributes\x18) \x01(\x0b\x32H.temporal.api.history.v1.ChildWorkflowExecutionTerminatedEventAttributesH\x00\x12\x99\x01\n=signal_external_workflow_execution_initiated_event_attributes\x18* \x01(\x0b\x32P.temporal.api.history.v1.SignalExternalWorkflowExecutionInitiatedEventAttributesH\x00\x12\x93\x01\n:signal_external_workflow_execution_failed_event_attributes\x18+ \x01(\x0b\x32M.temporal.api.history.v1.SignalExternalWorkflowExecutionFailedEventAttributesH\x00\x12\x8a\x01\n5external_workflow_execution_signaled_event_attributes\x18, \x01(\x0b\x32I.temporal.api.history.v1.ExternalWorkflowExecutionSignaledEventAttributesH\x00\x12\x84\x01\n2upsert_workflow_search_attributes_event_attributes\x18- \x01(\x0b\x32\x46.temporal.api.history.v1.UpsertWorkflowSearchAttributesEventAttributesH\x00\x12\x86\x01\n3workflow_execution_update_accepted_event_attributes\x18. \x01(\x0b\x32G.temporal.api.history.v1.WorkflowExecutionUpdateAcceptedEventAttributesH\x00\x12\x86\x01\n3workflow_execution_update_rejected_event_attributes\x18/ \x01(\x0b\x32G.temporal.api.history.v1.WorkflowExecutionUpdateRejectedEventAttributesH\x00\x12\x88\x01\n4workflow_execution_update_completed_event_attributes\x18\x30 \x01(\x0b\x32H.temporal.api.history.v1.WorkflowExecutionUpdateCompletedEventAttributesH\x00\x12\x90\x01\n8workflow_properties_modified_externally_event_attributes\x18\x31 \x01(\x0b\x32L.temporal.api.history.v1.WorkflowPropertiesModifiedExternallyEventAttributesH\x00\x12\x90\x01\n8activity_properties_modified_externally_event_attributes\x18\x32 \x01(\x0b\x32L.temporal.api.history.v1.ActivityPropertiesModifiedExternallyEventAttributesH\x00\x12{\n-workflow_properties_modified_event_attributes\x18\x33 \x01(\x0b\x32\x42.temporal.api.history.v1.WorkflowPropertiesModifiedEventAttributesH\x00\x42\x0c\n\nattributes\"@\n\x07History\x12\x35\n\x06\x65vents\x18\x01 \x03(\x0b\x32%.temporal.api.history.v1.HistoryEventB\x8e\x01\n\x1aio.temporal.api.history.v1B\x0cMessageProtoP\x01Z%go.temporal.io/api/history/v1;history\xaa\x02\x19Temporalio.Api.History.V1\xea\x02\x1cTemporalio::Api::History::V1b\x06proto3" +descriptor_data = "\n%temporal/api/history/v1/message.proto\x12\x17temporal.api.history.v1\x1A\x1Egoogle/protobuf/duration.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A!dependencies/gogoproto/gogo.proto\x1A&temporal/api/enums/v1/event_type.proto\x1A(temporal/api/enums/v1/failed_cause.proto\x1A$temporal/api/enums/v1/workflow.proto\x1A$temporal/api/common/v1/message.proto\x1A%temporal/api/failure/v1/message.proto\x1A'temporal/api/taskqueue/v1/message.proto\x1A$temporal/api/update/v1/message.proto\x1A&temporal/api/workflow/v1/message.proto\x1A0temporal/api/sdk/v1/task_complete_metadata.proto\x1A\"temporal/api/enums/v1/update.proto\"\x90\v\n'WorkflowExecutionStartedEventAttributes\x12;\n\rworkflow_type\x18\x01 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12!\n\x19parent_workflow_namespace\x18\x02 \x01(\t\x12$\n\x1Cparent_workflow_namespace_id\x18\e \x01(\t\x12L\n\x19parent_workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12!\n\x19parent_initiated_event_id\x18\x04 \x01(\x03\x128\n\ntask_queue\x18\x05 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x06 \x01(\v2 .temporal.api.common.v1.Payloads\x12C\n\x1Aworkflow_execution_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12=\n\x14workflow_run_timeout\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12>\n\x15workflow_task_timeout\x18\t \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12\"\n\x1Acontinued_execution_run_id\x18\n \x01(\t\x12@\n\tinitiator\x18\v \x01(\x0E2-.temporal.api.enums.v1.ContinueAsNewInitiator\x12;\n\x11continued_failure\x18\f \x01(\v2 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\r \x01(\v2 .temporal.api.common.v1.Payloads\x12!\n\x19original_execution_run_id\x18\x0E \x01(\t\x12\x10\n\bidentity\x18\x0F \x01(\t\x12\x1E\n\x16first_execution_run_id\x18\x10 \x01(\t\x129\n\fretry_policy\x18\x11 \x01(\v2#.temporal.api.common.v1.RetryPolicy\x12\x0F\n\aattempt\x18\x12 \x01(\x05\x12L\n\"workflow_execution_expiration_time\x18\x13 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x12\x15\n\rcron_schedule\x18\x14 \x01(\t\x12D\n\efirst_workflow_task_backoff\x18\x15 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12*\n\x04memo\x18\x16 \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x17 \x01(\v2(.temporal.api.common.v1.SearchAttributes\x12E\n\x16prev_auto_reset_points\x18\x18 \x01(\v2%.temporal.api.workflow.v1.ResetPoints\x12.\n\x06header\x18\x19 \x01(\v2\x1E.temporal.api.common.v1.Header\x12&\n\x1Eparent_initiated_event_version\x18\x1A \x01(\x03\"\xA5\x01\n)WorkflowExecutionCompletedEventAttributes\x120\n\x06result\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x1C\n\x14new_execution_run_id\x18\x03 \x01(\t\"\xDB\x01\n&WorkflowExecutionFailedEventAttributes\x121\n\afailure\x18\x01 \x01(\v2 .temporal.api.failure.v1.Failure\x126\n\vretry_state\x18\x02 \x01(\x0E2!.temporal.api.enums.v1.RetryState\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12\x1C\n\x14new_execution_run_id\x18\x04 \x01(\t\"\x80\x01\n(WorkflowExecutionTimedOutEventAttributes\x126\n\vretry_state\x18\x01 \x01(\x0E2!.temporal.api.enums.v1.RetryState\x12\x1C\n\x14new_execution_run_id\x18\x02 \x01(\t\"\xB8\x06\n.WorkflowExecutionContinuedAsNewEventAttributes\x12\x1C\n\x14new_execution_run_id\x18\x01 \x01(\t\x12;\n\rworkflow_type\x18\x02 \x01(\v2$.temporal.api.common.v1.WorkflowType\x128\n\ntask_queue\x18\x03 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x04 \x01(\v2 .temporal.api.common.v1.Payloads\x12=\n\x14workflow_run_timeout\x18\x05 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12>\n\x15workflow_task_timeout\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12(\n workflow_task_completed_event_id\x18\a \x01(\x03\x12?\n\x16backoff_start_interval\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12@\n\tinitiator\x18\t \x01(\x0E2-.temporal.api.enums.v1.ContinueAsNewInitiator\x121\n\afailure\x18\n \x01(\v2 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\v \x01(\v2 .temporal.api.common.v1.Payloads\x12.\n\x06header\x18\f \x01(\v2\x1E.temporal.api.common.v1.Header\x12*\n\x04memo\x18\r \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x0E \x01(\v2(.temporal.api.common.v1.SearchAttributes\"\xB2\x01\n$WorkflowTaskScheduledEventAttributes\x128\n\ntask_queue\x18\x01 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12?\n\x16start_to_close_timeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12\x0F\n\aattempt\x18\x03 \x01(\x05\"\xA3\x01\n\"WorkflowTaskStartedEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x10\n\bidentity\x18\x02 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12\x1F\n\x17suggest_continue_as_new\x18\x04 \x01(\b\x12\x1A\n\x12history_size_bytes\x18\x05 \x01(\x03\"\xDA\x02\n$WorkflowTaskCompletedEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x17\n\x0Fbinary_checksum\x18\x04 \x01(\t\x12B\n\x0Eworker_version\x18\x05 \x01(\v2*.temporal.api.common.v1.WorkerVersionStamp\x12H\n\fsdk_metadata\x18\x06 \x01(\v22.temporal.api.sdk.v1.WorkflowTaskCompletedMetadata\x12C\n\x11metering_metadata\x18\r \x01(\v2(.temporal.api.common.v1.MeteringMetadata\"\x95\x01\n#WorkflowTaskTimedOutEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x128\n\ftimeout_type\x18\x03 \x01(\x0E2\".temporal.api.enums.v1.TimeoutType\"\xBB\x02\n!WorkflowTaskFailedEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12=\n\x05cause\x18\x03 \x01(\x0E2..temporal.api.enums.v1.WorkflowTaskFailedCause\x121\n\afailure\x18\x04 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x10\n\bidentity\x18\x05 \x01(\t\x12\x13\n\vbase_run_id\x18\x06 \x01(\t\x12\x12\n\nnew_run_id\x18\a \x01(\t\x12\x1A\n\x12fork_event_version\x18\b \x01(\x03\x12\x17\n\x0Fbinary_checksum\x18\t \x01(\t\"\x83\x05\n$ActivityTaskScheduledEventAttributes\x12\x13\n\vactivity_id\x18\x01 \x01(\t\x12;\n\ractivity_type\x18\x02 \x01(\v2$.temporal.api.common.v1.ActivityType\x128\n\ntask_queue\x18\x04 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12.\n\x06header\x18\x05 \x01(\v2\x1E.temporal.api.common.v1.Header\x12/\n\x05input\x18\x06 \x01(\v2 .temporal.api.common.v1.Payloads\x12B\n\x19schedule_to_close_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12B\n\x19schedule_to_start_timeout\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12?\n\x16start_to_close_timeout\x18\t \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12:\n\x11heartbeat_timeout\x18\n \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12(\n workflow_task_completed_event_id\x18\v \x01(\x03\x129\n\fretry_policy\x18\f \x01(\v2#.temporal.api.common.v1.RetryPolicyJ\x04\b\x03\x10\x04\"\xAF\x01\n\"ActivityTaskStartedEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12\x10\n\bidentity\x18\x02 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12\x0F\n\aattempt\x18\x04 \x01(\x05\x126\n\flast_failure\x18\x05 \x01(\v2 .temporal.api.failure.v1.Failure\"\xA0\x01\n$ActivityTaskCompletedEventAttributes\x120\n\x06result\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x1A\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x12\x10\n\bidentity\x18\x04 \x01(\t\"\xD6\x01\n!ActivityTaskFailedEventAttributes\x121\n\afailure\x18\x01 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x1A\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x12\x10\n\bidentity\x18\x04 \x01(\t\x126\n\vretry_state\x18\x05 \x01(\x0E2!.temporal.api.enums.v1.RetryState\"\xC6\x01\n#ActivityTaskTimedOutEventAttributes\x121\n\afailure\x18\x01 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x1A\n\x12scheduled_event_id\x18\x02 \x01(\x03\x12\x18\n\x10started_event_id\x18\x03 \x01(\x03\x126\n\vretry_state\x18\x04 \x01(\x0E2!.temporal.api.enums.v1.RetryState\"r\n*ActivityTaskCancelRequestedEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\"\xCA\x01\n#ActivityTaskCanceledEventAttributes\x121\n\adetails\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12(\n latest_cancel_requested_event_id\x18\x02 \x01(\x03\x12\x1A\n\x12scheduled_event_id\x18\x03 \x01(\x03\x12\x18\n\x10started_event_id\x18\x04 \x01(\x03\x12\x10\n\bidentity\x18\x05 \x01(\t\"\x99\x01\n\eTimerStartedEventAttributes\x12\x10\n\btimer_id\x18\x01 \x01(\t\x12>\n\x15start_to_fire_timeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\"G\n\x19TimerFiredEventAttributes\x12\x10\n\btimer_id\x18\x01 \x01(\t\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\"\x86\x01\n\x1CTimerCanceledEventAttributes\x12\x10\n\btimer_id\x18\x01 \x01(\t\x12\x18\n\x10started_event_id\x18\x02 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12\x10\n\bidentity\x18\x04 \x01(\t\"\xC7\x01\n/WorkflowExecutionCancelRequestedEventAttributes\x12\r\n\x05cause\x18\x01 \x01(\t\x12#\n\eexternal_initiated_event_id\x18\x02 \x01(\x03\x12N\n\eexternal_workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x10\n\bidentity\x18\x04 \x01(\t\"\x87\x01\n(WorkflowExecutionCanceledEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x121\n\adetails\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\"\xE9\x02\n\x1DMarkerRecordedEventAttributes\x12\x13\n\vmarker_name\x18\x01 \x01(\t\x12T\n\adetails\x18\x02 \x03(\v2C.temporal.api.history.v1.MarkerRecordedEventAttributes.DetailsEntry\x12(\n workflow_task_completed_event_id\x18\x03 \x01(\x03\x12.\n\x06header\x18\x04 \x01(\v2\x1E.temporal.api.common.v1.Header\x121\n\afailure\x18\x05 \x01(\v2 .temporal.api.failure.v1.Failure\x1AP\n\fDetailsEntry\x12\v\n\x03key\x18\x01 \x01(\t\x12/\n\x05value\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads:\x028\x01\"\xD7\x01\n(WorkflowExecutionSignaledEventAttributes\x12\x13\n\vsignal_name\x18\x01 \x01(\t\x12/\n\x05input\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x03 \x01(\t\x12.\n\x06header\x18\x04 \x01(\v2\x1E.temporal.api.common.v1.Header\x12#\n\eskip_generate_workflow_task\x18\x05 \x01(\b\"\x81\x01\n*WorkflowExecutionTerminatedEventAttributes\x12\x0E\n\x06reason\x18\x01 \x01(\t\x121\n\adetails\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x03 \x01(\t\"\x98\x02\n>RequestCancelExternalWorkflowExecutionInitiatedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x0F\n\acontrol\x18\x04 \x01(\t\x12\e\n\x13child_workflow_only\x18\x05 \x01(\b\x12\x0E\n\x06reason\x18\x06 \x01(\t\"\xD6\x02\n;RequestCancelExternalWorkflowExecutionFailedEventAttributes\x12P\n\x05cause\x18\x01 \x01(\x0E2A.temporal.api.enums.v1.CancelExternalWorkflowExecutionFailedCause\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x11\n\tnamespace\x18\x03 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x04 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x1A\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x0F\n\acontrol\x18\x06 \x01(\t\"\xC5\x01\n7ExternalWorkflowExecutionCancelRequestedEventAttributes\x12\x1A\n\x12initiated_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\x04 \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\"\xF7\x02\n7SignalExternalWorkflowExecutionInitiatedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\t \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x13\n\vsignal_name\x18\x04 \x01(\t\x12/\n\x05input\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x0F\n\acontrol\x18\x06 \x01(\t\x12\e\n\x13child_workflow_only\x18\a \x01(\b\x12.\n\x06header\x18\b \x01(\v2\x1E.temporal.api.common.v1.Header\"\xCF\x02\n4SignalExternalWorkflowExecutionFailedEventAttributes\x12P\n\x05cause\x18\x01 \x01(\x0E2A.temporal.api.enums.v1.SignalExternalWorkflowExecutionFailedCause\x12(\n workflow_task_completed_event_id\x18\x02 \x01(\x03\x12\x11\n\tnamespace\x18\x03 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x04 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x1A\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x0F\n\acontrol\x18\x06 \x01(\t\"\xCF\x01\n0ExternalWorkflowExecutionSignaledEventAttributes\x12\x1A\n\x12initiated_event_id\x18\x01 \x01(\x03\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\x05 \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x0F\n\acontrol\x18\x04 \x01(\t\"\x9E\x01\n-UpsertWorkflowSearchAttributesEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x12C\n\x11search_attributes\x18\x02 \x01(\v2(.temporal.api.common.v1.SearchAttributes\"\x8A\x01\n)WorkflowPropertiesModifiedEventAttributes\x12(\n workflow_task_completed_event_id\x18\x01 \x01(\x03\x123\n\rupserted_memo\x18\x02 \x01(\v2\x1C.temporal.api.common.v1.Memo\"\xA4\a\n3StartChildWorkflowExecutionInitiatedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\fnamespace_id\x18\x12 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x128\n\ntask_queue\x18\x04 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12C\n\x1Aworkflow_execution_timeout\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12=\n\x14workflow_run_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12>\n\x15workflow_task_timeout\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12E\n\x13parent_close_policy\x18\t \x01(\x0E2(.temporal.api.enums.v1.ParentClosePolicy\x12\x0F\n\acontrol\x18\n \x01(\t\x12(\n workflow_task_completed_event_id\x18\v \x01(\x03\x12N\n\x18workflow_id_reuse_policy\x18\f \x01(\x0E2,.temporal.api.enums.v1.WorkflowIdReusePolicy\x129\n\fretry_policy\x18\r \x01(\v2#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x0E \x01(\t\x12.\n\x06header\x18\x0F \x01(\v2\x1E.temporal.api.common.v1.Header\x12*\n\x04memo\x18\x10 \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x11 \x01(\v2(.temporal.api.common.v1.SearchAttributes\"\xD2\x02\n0StartChildWorkflowExecutionFailedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\fnamespace_id\x18\b \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12L\n\x05cause\x18\x04 \x01(\x0E2=.temporal.api.enums.v1.StartChildWorkflowExecutionFailedCause\x12\x0F\n\acontrol\x18\x05 \x01(\t\x12\x1A\n\x12initiated_event_id\x18\x06 \x01(\x03\x12(\n workflow_task_completed_event_id\x18\a \x01(\x03\"\xA7\x02\n,ChildWorkflowExecutionStartedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\fnamespace_id\x18\x06 \x01(\t\x12\x1A\n\x12initiated_event_id\x18\x02 \x01(\x03\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12.\n\x06header\x18\x05 \x01(\v2\x1E.temporal.api.common.v1.Header\"\xC5\x02\n.ChildWorkflowExecutionCompletedEventAttributes\x120\n\x06result\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12\x1A\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\"\xFB\x02\n+ChildWorkflowExecutionFailedEventAttributes\x121\n\afailure\x18\x01 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\b \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12\x1A\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\x126\n\vretry_state\x18\a \x01(\x0E2!.temporal.api.enums.v1.RetryState\"\xC5\x02\n-ChildWorkflowExecutionCanceledEventAttributes\x121\n\adetails\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x11\n\tnamespace\x18\x02 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x03 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x04 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12\x1A\n\x12initiated_event_id\x18\x05 \x01(\x03\x12\x18\n\x10started_event_id\x18\x06 \x01(\x03\"\xCA\x02\n-ChildWorkflowExecutionTimedOutEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\fnamespace_id\x18\a \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12\x1A\n\x12initiated_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\x126\n\vretry_state\x18\x06 \x01(\x0E2!.temporal.api.enums.v1.RetryState\"\x94\x02\n/ChildWorkflowExecutionTerminatedEventAttributes\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x14\n\fnamespace_id\x18\x06 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12\x1A\n\x12initiated_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\"\xD2\x02\n3WorkflowPropertiesModifiedExternallyEventAttributes\x12\x16\n\x0Enew_task_queue\x18\x01 \x01(\t\x12B\n\x19new_workflow_task_timeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12A\n\x18new_workflow_run_timeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12G\n\x1Enew_workflow_execution_timeout\x18\x04 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x123\n\rupserted_memo\x18\x05 \x01(\v2\x1C.temporal.api.common.v1.Memo\"\x90\x01\n3ActivityPropertiesModifiedExternallyEventAttributes\x12\x1A\n\x12scheduled_event_id\x18\x01 \x01(\x03\x12=\n\x10new_retry_policy\x18\x02 \x01(\v2#.temporal.api.common.v1.RetryPolicy\"\xDC\x01\n.WorkflowExecutionUpdateAcceptedEventAttributes\x12\x1C\n\x14protocol_instance_id\x18\x01 \x01(\t\x12#\n\eaccepted_request_message_id\x18\x02 \x01(\t\x12,\n$accepted_request_sequencing_event_id\x18\x03 \x01(\x03\x129\n\x10accepted_request\x18\x04 \x01(\v2\x1F.temporal.api.update.v1.Request\"\xAA\x01\n/WorkflowExecutionUpdateCompletedEventAttributes\x12*\n\x04meta\x18\x01 \x01(\v2\x1C.temporal.api.update.v1.Meta\x120\n\aoutcome\x18\x02 \x01(\v2\x1F.temporal.api.update.v1.Outcome\x12\x19\n\x11accepted_event_id\x18\x03 \x01(\x03\"\x8F\x02\n.WorkflowExecutionUpdateRejectedEventAttributes\x12\x1C\n\x14protocol_instance_id\x18\x01 \x01(\t\x12#\n\erejected_request_message_id\x18\x02 \x01(\t\x12,\n$rejected_request_sequencing_event_id\x18\x03 \x01(\x03\x129\n\x10rejected_request\x18\x04 \x01(\v2\x1F.temporal.api.update.v1.Request\x121\n\afailure\x18\x05 \x01(\v2 .temporal.api.failure.v1.Failure\"\xEE0\n\fHistoryEvent\x12\x10\n\bevent_id\x18\x01 \x01(\x03\x124\n\nevent_time\x18\x02 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x124\n\nevent_type\x18\x03 \x01(\x0E2 .temporal.api.enums.v1.EventType\x12\x0F\n\aversion\x18\x04 \x01(\x03\x12\x0F\n\atask_id\x18\x05 \x01(\x03\x12\x1A\n\x11worker_may_ignore\x18\xAC\x02 \x01(\b\x12w\n+workflow_execution_started_event_attributes\x18\x06 \x01(\v2@.temporal.api.history.v1.WorkflowExecutionStartedEventAttributesH\x00\x12{\n-workflow_execution_completed_event_attributes\x18\a \x01(\v2B.temporal.api.history.v1.WorkflowExecutionCompletedEventAttributesH\x00\x12u\n*workflow_execution_failed_event_attributes\x18\b \x01(\v2?.temporal.api.history.v1.WorkflowExecutionFailedEventAttributesH\x00\x12z\n-workflow_execution_timed_out_event_attributes\x18\t \x01(\v2A.temporal.api.history.v1.WorkflowExecutionTimedOutEventAttributesH\x00\x12q\n(workflow_task_scheduled_event_attributes\x18\n \x01(\v2=.temporal.api.history.v1.WorkflowTaskScheduledEventAttributesH\x00\x12m\n&workflow_task_started_event_attributes\x18\v \x01(\v2;.temporal.api.history.v1.WorkflowTaskStartedEventAttributesH\x00\x12q\n(workflow_task_completed_event_attributes\x18\f \x01(\v2=.temporal.api.history.v1.WorkflowTaskCompletedEventAttributesH\x00\x12p\n(workflow_task_timed_out_event_attributes\x18\r \x01(\v2<.temporal.api.history.v1.WorkflowTaskTimedOutEventAttributesH\x00\x12k\n%workflow_task_failed_event_attributes\x18\x0E \x01(\v2:.temporal.api.history.v1.WorkflowTaskFailedEventAttributesH\x00\x12q\n(activity_task_scheduled_event_attributes\x18\x0F \x01(\v2=.temporal.api.history.v1.ActivityTaskScheduledEventAttributesH\x00\x12m\n&activity_task_started_event_attributes\x18\x10 \x01(\v2;.temporal.api.history.v1.ActivityTaskStartedEventAttributesH\x00\x12q\n(activity_task_completed_event_attributes\x18\x11 \x01(\v2=.temporal.api.history.v1.ActivityTaskCompletedEventAttributesH\x00\x12k\n%activity_task_failed_event_attributes\x18\x12 \x01(\v2:.temporal.api.history.v1.ActivityTaskFailedEventAttributesH\x00\x12p\n(activity_task_timed_out_event_attributes\x18\x13 \x01(\v2<.temporal.api.history.v1.ActivityTaskTimedOutEventAttributesH\x00\x12^\n\x1Etimer_started_event_attributes\x18\x14 \x01(\v24.temporal.api.history.v1.TimerStartedEventAttributesH\x00\x12Z\n\x1Ctimer_fired_event_attributes\x18\x15 \x01(\v22.temporal.api.history.v1.TimerFiredEventAttributesH\x00\x12~\n/activity_task_cancel_requested_event_attributes\x18\x16 \x01(\v2C.temporal.api.history.v1.ActivityTaskCancelRequestedEventAttributesH\x00\x12o\n'activity_task_canceled_event_attributes\x18\x17 \x01(\v2<.temporal.api.history.v1.ActivityTaskCanceledEventAttributesH\x00\x12`\n\x1Ftimer_canceled_event_attributes\x18\x18 \x01(\v25.temporal.api.history.v1.TimerCanceledEventAttributesH\x00\x12b\n marker_recorded_event_attributes\x18\x19 \x01(\v26.temporal.api.history.v1.MarkerRecordedEventAttributesH\x00\x12y\n,workflow_execution_signaled_event_attributes\x18\x1A \x01(\v2A.temporal.api.history.v1.WorkflowExecutionSignaledEventAttributesH\x00\x12}\n.workflow_execution_terminated_event_attributes\x18\e \x01(\v2C.temporal.api.history.v1.WorkflowExecutionTerminatedEventAttributesH\x00\x12\x88\x01\n4workflow_execution_cancel_requested_event_attributes\x18\x1C \x01(\v2H.temporal.api.history.v1.WorkflowExecutionCancelRequestedEventAttributesH\x00\x12y\n,workflow_execution_canceled_event_attributes\x18\x1D \x01(\v2A.temporal.api.history.v1.WorkflowExecutionCanceledEventAttributesH\x00\x12\xA8\x01\nErequest_cancel_external_workflow_execution_initiated_event_attributes\x18\x1E \x01(\v2W.temporal.api.history.v1.RequestCancelExternalWorkflowExecutionInitiatedEventAttributesH\x00\x12\xA2\x01\nBrequest_cancel_external_workflow_execution_failed_event_attributes\x18\x1F \x01(\v2T.temporal.api.history.v1.RequestCancelExternalWorkflowExecutionFailedEventAttributesH\x00\x12\x99\x01\n=external_workflow_execution_cancel_requested_event_attributes\x18 \x01(\v2P.temporal.api.history.v1.ExternalWorkflowExecutionCancelRequestedEventAttributesH\x00\x12\x87\x01\n4workflow_execution_continued_as_new_event_attributes\x18! \x01(\v2G.temporal.api.history.v1.WorkflowExecutionContinuedAsNewEventAttributesH\x00\x12\x91\x01\n9start_child_workflow_execution_initiated_event_attributes\x18\" \x01(\v2L.temporal.api.history.v1.StartChildWorkflowExecutionInitiatedEventAttributesH\x00\x12\x8B\x01\n6start_child_workflow_execution_failed_event_attributes\x18# \x01(\v2I.temporal.api.history.v1.StartChildWorkflowExecutionFailedEventAttributesH\x00\x12\x82\x01\n1child_workflow_execution_started_event_attributes\x18$ \x01(\v2E.temporal.api.history.v1.ChildWorkflowExecutionStartedEventAttributesH\x00\x12\x86\x01\n3child_workflow_execution_completed_event_attributes\x18% \x01(\v2G.temporal.api.history.v1.ChildWorkflowExecutionCompletedEventAttributesH\x00\x12\x80\x01\n0child_workflow_execution_failed_event_attributes\x18& \x01(\v2D.temporal.api.history.v1.ChildWorkflowExecutionFailedEventAttributesH\x00\x12\x84\x01\n2child_workflow_execution_canceled_event_attributes\x18' \x01(\v2F.temporal.api.history.v1.ChildWorkflowExecutionCanceledEventAttributesH\x00\x12\x85\x01\n3child_workflow_execution_timed_out_event_attributes\x18( \x01(\v2F.temporal.api.history.v1.ChildWorkflowExecutionTimedOutEventAttributesH\x00\x12\x88\x01\n4child_workflow_execution_terminated_event_attributes\x18) \x01(\v2H.temporal.api.history.v1.ChildWorkflowExecutionTerminatedEventAttributesH\x00\x12\x99\x01\n=signal_external_workflow_execution_initiated_event_attributes\x18* \x01(\v2P.temporal.api.history.v1.SignalExternalWorkflowExecutionInitiatedEventAttributesH\x00\x12\x93\x01\n:signal_external_workflow_execution_failed_event_attributes\x18+ \x01(\v2M.temporal.api.history.v1.SignalExternalWorkflowExecutionFailedEventAttributesH\x00\x12\x8A\x01\n5external_workflow_execution_signaled_event_attributes\x18, \x01(\v2I.temporal.api.history.v1.ExternalWorkflowExecutionSignaledEventAttributesH\x00\x12\x84\x01\n2upsert_workflow_search_attributes_event_attributes\x18- \x01(\v2F.temporal.api.history.v1.UpsertWorkflowSearchAttributesEventAttributesH\x00\x12\x86\x01\n3workflow_execution_update_accepted_event_attributes\x18. \x01(\v2G.temporal.api.history.v1.WorkflowExecutionUpdateAcceptedEventAttributesH\x00\x12\x86\x01\n3workflow_execution_update_rejected_event_attributes\x18/ \x01(\v2G.temporal.api.history.v1.WorkflowExecutionUpdateRejectedEventAttributesH\x00\x12\x88\x01\n4workflow_execution_update_completed_event_attributes\x180 \x01(\v2H.temporal.api.history.v1.WorkflowExecutionUpdateCompletedEventAttributesH\x00\x12\x90\x01\n8workflow_properties_modified_externally_event_attributes\x181 \x01(\v2L.temporal.api.history.v1.WorkflowPropertiesModifiedExternallyEventAttributesH\x00\x12\x90\x01\n8activity_properties_modified_externally_event_attributes\x182 \x01(\v2L.temporal.api.history.v1.ActivityPropertiesModifiedExternallyEventAttributesH\x00\x12{\n-workflow_properties_modified_event_attributes\x183 \x01(\v2B.temporal.api.history.v1.WorkflowPropertiesModifiedEventAttributesH\x00\x12\x86\x01\n3workflow_execution_update_admitted_event_attributes\x184 \x01(\v2G.temporal.api.history.v1.WorkflowExecutionUpdateAdmittedEventAttributesH\x00B\f\n\nattributes\"@\n\aHistory\x125\n\x06events\x18\x01 \x03(\v2%.temporal.api.history.v1.HistoryEvent\"\xA4\x01\n.WorkflowExecutionUpdateAdmittedEventAttributes\x120\n\arequest\x18\x01 \x01(\v2\x1F.temporal.api.update.v1.Request\x12@\n\x06origin\x18\x02 \x01(\x0E20.temporal.api.enums.v1.UpdateAdmittedEventOriginB\x8E\x01\n\x1Aio.temporal.api.history.v1B\fMessageProtoP\x01Z%go.temporal.io/api/history/v1;history\xAA\x02\x19Temporalio.Api.History.V1\xEA\x02\x1CTemporalio::Api::History::V1b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -27,6 +27,7 @@ module Temporalio module Api module History module V1 + WorkflowExecutionUpdateAdmittedEventAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.history.v1.WorkflowExecutionUpdateAdmittedEventAttributes").msgclass WorkflowExecutionStartedEventAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.history.v1.WorkflowExecutionStartedEventAttributes").msgclass WorkflowExecutionCompletedEventAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.history.v1.WorkflowExecutionCompletedEventAttributes").msgclass WorkflowExecutionFailedEventAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.history.v1.WorkflowExecutionFailedEventAttributes").msgclass diff --git a/lib/gen/temporal/api/workflowservice/v1/request_response_pb.rb b/lib/gen/temporal/api/workflowservice/v1/request_response_pb.rb index ddecd2c16..5cf3312e5 100644 --- a/lib/gen/temporal/api/workflowservice/v1/request_response_pb.rb +++ b/lib/gen/temporal/api/workflowservice/v1/request_response_pb.rb @@ -33,7 +33,7 @@ require 'dependencies/gogoproto/gogo_pb' -descriptor_data = "\n6temporal/api/workflowservice/v1/request_response.proto\x12\x1ftemporal.api.workflowservice.v1\x1a+temporal/api/enums/v1/batch_operation.proto\x1a$temporal/api/enums/v1/workflow.proto\x1a%temporal/api/enums/v1/namespace.proto\x1a(temporal/api/enums/v1/failed_cause.proto\x1a\"temporal/api/enums/v1/common.proto\x1a!temporal/api/enums/v1/query.proto\x1a!temporal/api/enums/v1/reset.proto\x1a&temporal/api/enums/v1/task_queue.proto\x1a$temporal/api/common/v1/message.proto\x1a%temporal/api/history/v1/message.proto\x1a&temporal/api/workflow/v1/message.proto\x1a%temporal/api/command/v1/message.proto\x1a%temporal/api/failure/v1/message.proto\x1a$temporal/api/filter/v1/message.proto\x1a&temporal/api/protocol/v1/message.proto\x1a\'temporal/api/namespace/v1/message.proto\x1a#temporal/api/query/v1/message.proto\x1a)temporal/api/replication/v1/message.proto\x1a&temporal/api/schedule/v1/message.proto\x1a\'temporal/api/taskqueue/v1/message.proto\x1a$temporal/api/update/v1/message.proto\x1a%temporal/api/version/v1/message.proto\x1a#temporal/api/batch/v1/message.proto\x1a\x30temporal/api/sdk/v1/task_complete_metadata.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a!dependencies/gogoproto/gogo.proto\"\x8e\x05\n\x18RegisterNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x0bowner_email\x18\x03 \x01(\t\x12L\n#workflow_execution_retention_period\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12G\n\x08\x63lusters\x18\x05 \x03(\x0b\x32\x35.temporal.api.replication.v1.ClusterReplicationConfig\x12\x1b\n\x13\x61\x63tive_cluster_name\x18\x06 \x01(\t\x12Q\n\x04\x64\x61ta\x18\x07 \x03(\x0b\x32\x43.temporal.api.workflowservice.v1.RegisterNamespaceRequest.DataEntry\x12\x16\n\x0esecurity_token\x18\x08 \x01(\t\x12\x1b\n\x13is_global_namespace\x18\t \x01(\x08\x12\x44\n\x16history_archival_state\x18\n \x01(\x0e\x32$.temporal.api.enums.v1.ArchivalState\x12\x1c\n\x14history_archival_uri\x18\x0b \x01(\t\x12G\n\x19visibility_archival_state\x18\x0c \x01(\x0e\x32$.temporal.api.enums.v1.ArchivalState\x12\x1f\n\x17visibility_archival_uri\x18\r \x01(\t\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1b\n\x19RegisterNamespaceResponse\"\x89\x01\n\x15ListNamespacesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\x12\x44\n\x10namespace_filter\x18\x03 \x01(\x0b\x32*.temporal.api.namespace.v1.NamespaceFilter\"\x81\x01\n\x16ListNamespacesResponse\x12N\n\nnamespaces\x18\x01 \x03(\x0b\x32:.temporal.api.workflowservice.v1.DescribeNamespaceResponse\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"9\n\x18\x44\x65scribeNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"\xec\x02\n\x19\x44\x65scribeNamespaceResponse\x12@\n\x0enamespace_info\x18\x01 \x01(\x0b\x32(.temporal.api.namespace.v1.NamespaceInfo\x12:\n\x06\x63onfig\x18\x02 \x01(\x0b\x32*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x03 \x01(\x0b\x32\x37.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x18\n\x10\x66\x61ilover_version\x18\x04 \x01(\x03\x12\x1b\n\x13is_global_namespace\x18\x05 \x01(\x08\x12\x45\n\x10\x66\x61ilover_history\x18\x06 \x03(\x0b\x32+.temporal.api.replication.v1.FailoverStatus\"\xcf\x02\n\x16UpdateNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x43\n\x0bupdate_info\x18\x02 \x01(\x0b\x32..temporal.api.namespace.v1.UpdateNamespaceInfo\x12:\n\x06\x63onfig\x18\x03 \x01(\x0b\x32*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x04 \x01(\x0b\x32\x37.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x16\n\x0esecurity_token\x18\x05 \x01(\t\x12\x19\n\x11\x64\x65lete_bad_binary\x18\x06 \x01(\t\x12\x19\n\x11promote_namespace\x18\x07 \x01(\x08\"\xa3\x02\n\x17UpdateNamespaceResponse\x12@\n\x0enamespace_info\x18\x01 \x01(\x0b\x32(.temporal.api.namespace.v1.NamespaceInfo\x12:\n\x06\x63onfig\x18\x02 \x01(\x0b\x32*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x03 \x01(\x0b\x32\x37.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x18\n\x10\x66\x61ilover_version\x18\x04 \x01(\x03\x12\x1b\n\x13is_global_namespace\x18\x05 \x01(\x08\"F\n\x19\x44\x65precateNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x16\n\x0esecurity_token\x18\x02 \x01(\t\"\x1c\n\x1a\x44\x65precateNamespaceResponse\"\xd1\x08\n\x1dStartWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x38\n\ntask_queue\x18\x04 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x43\n\x1aworkflow_execution_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12=\n\x14workflow_run_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12>\n\x15workflow_task_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x10\n\x08identity\x18\t \x01(\t\x12\x12\n\nrequest_id\x18\n \x01(\t\x12N\n\x18workflow_id_reuse_policy\x18\x0b \x01(\x0e\x32,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x39\n\x0cretry_policy\x18\x0c \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\r \x01(\t\x12*\n\x04memo\x18\x0e \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x0f \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12.\n\x06header\x18\x10 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12\x1f\n\x17request_eager_execution\x18\x11 \x01(\x08\x12;\n\x11\x63ontinued_failure\x18\x12 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\x13 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12=\n\x14workflow_start_delay\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12T\n\x1bworkflow_id_conflict_policy\x18\x16 \x01(\x0e\x32/.temporal.api.enums.v1.WorkflowIdConflictPolicy\"\x8d\x01\n\x1eStartWorkflowExecutionResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12[\n\x13\x65\x61ger_workflow_task\x18\x02 \x01(\x0b\x32>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\"\xaa\x02\n\"GetWorkflowExecutionHistoryRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x19\n\x11maximum_page_size\x18\x03 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\x0c\x12\x16\n\x0ewait_new_event\x18\x05 \x01(\x08\x12P\n\x19history_event_filter_type\x18\x06 \x01(\x0e\x32-.temporal.api.enums.v1.HistoryEventFilterType\x12\x15\n\rskip_archival\x18\x07 \x01(\x08\"\xba\x01\n#GetWorkflowExecutionHistoryResponse\x12\x31\n\x07history\x18\x01 \x01(\x0b\x32 .temporal.api.history.v1.History\x12\x35\n\x0braw_history\x18\x02 \x03(\x0b\x32 .temporal.api.common.v1.DataBlob\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\x10\n\x08\x61rchived\x18\x04 \x01(\x08\"\xb0\x01\n)GetWorkflowExecutionHistoryReverseRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x19\n\x11maximum_page_size\x18\x03 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\x0c\"x\n*GetWorkflowExecutionHistoryReverseResponse\x12\x31\n\x07history\x18\x01 \x01(\x0b\x32 .temporal.api.history.v1.History\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\"\xee\x01\n\x1cPollWorkflowTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x38\n\ntask_queue\x18\x02 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x17\n\x0f\x62inary_checksum\x18\x04 \x01(\t\x12V\n\x1bworker_version_capabilities\x18\x05 \x01(\x0b\x32\x31.temporal.api.common.v1.WorkerVersionCapabilities\"\xca\x06\n\x1dPollWorkflowTaskQueueResponse\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12!\n\x19previous_started_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\x12\x0f\n\x07\x61ttempt\x18\x06 \x01(\x05\x12\x1a\n\x12\x62\x61\x63klog_count_hint\x18\x07 \x01(\x03\x12\x31\n\x07history\x18\x08 \x01(\x0b\x32 .temporal.api.history.v1.History\x12\x17\n\x0fnext_page_token\x18\t \x01(\x0c\x12\x33\n\x05query\x18\n \x01(\x0b\x32$.temporal.api.query.v1.WorkflowQuery\x12K\n\x1dworkflow_execution_task_queue\x18\x0b \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12\x38\n\x0escheduled_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x36\n\x0cstarted_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\\\n\x07queries\x18\x0e \x03(\x0b\x32K.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse.QueriesEntry\x12\x33\n\x08messages\x18\x0f \x03(\x0b\x32!.temporal.api.protocol.v1.Message\x1aT\n\x0cQueriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x33\n\x05value\x18\x02 \x01(\x0b\x32$.temporal.api.query.v1.WorkflowQuery:\x02\x38\x01\"\xa4\x06\n#RespondWorkflowTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x32\n\x08\x63ommands\x18\x02 \x03(\x0b\x32 .temporal.api.command.v1.Command\x12\x10\n\x08identity\x18\x03 \x01(\t\x12O\n\x11sticky_attributes\x18\x04 \x01(\x0b\x32\x34.temporal.api.taskqueue.v1.StickyExecutionAttributes\x12 \n\x18return_new_workflow_task\x18\x05 \x01(\x08\x12&\n\x1e\x66orce_create_new_workflow_task\x18\x06 \x01(\x08\x12\x17\n\x0f\x62inary_checksum\x18\x07 \x01(\t\x12m\n\rquery_results\x18\x08 \x03(\x0b\x32V.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest.QueryResultsEntry\x12\x11\n\tnamespace\x18\t \x01(\t\x12H\n\x14worker_version_stamp\x18\n \x01(\x0b\x32*.temporal.api.common.v1.WorkerVersionStamp\x12\x33\n\x08messages\x18\x0b \x03(\x0b\x32!.temporal.api.protocol.v1.Message\x12H\n\x0csdk_metadata\x18\x0c \x01(\x0b\x32\x32.temporal.api.sdk.v1.WorkflowTaskCompletedMetadata\x12\x43\n\x11metering_metadata\x18\r \x01(\x0b\x32(.temporal.api.common.v1.MeteringMetadata\x1a_\n\x11QueryResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.temporal.api.query.v1.WorkflowQueryResult:\x02\x38\x01\"\xf5\x01\n$RespondWorkflowTaskCompletedResponse\x12U\n\rworkflow_task\x18\x01 \x01(\x0b\x32>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\x12V\n\x0e\x61\x63tivity_tasks\x18\x02 \x03(\x0b\x32>.temporal.api.workflowservice.v1.PollActivityTaskQueueResponse\x12\x1e\n\x16reset_history_event_id\x18\x03 \x01(\x03\"\x9b\x02\n RespondWorkflowTaskFailedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12=\n\x05\x63\x61use\x18\x02 \x01(\x0e\x32..temporal.api.enums.v1.WorkflowTaskFailedCause\x12\x31\n\x07\x66\x61ilure\x18\x03 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x10\n\x08identity\x18\x04 \x01(\t\x12\x17\n\x0f\x62inary_checksum\x18\x05 \x01(\t\x12\x11\n\tnamespace\x18\x06 \x01(\t\x12\x33\n\x08messages\x18\x07 \x03(\x0b\x32!.temporal.api.protocol.v1.Message\"#\n!RespondWorkflowTaskFailedResponse\"\xa0\x02\n\x1cPollActivityTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x38\n\ntask_queue\x18\x02 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12\x10\n\x08identity\x18\x03 \x01(\t\x12I\n\x13task_queue_metadata\x18\x04 \x01(\x0b\x32,.temporal.api.taskqueue.v1.TaskQueueMetadata\x12V\n\x1bworker_version_capabilities\x18\x05 \x01(\x0b\x32\x31.temporal.api.common.v1.WorkerVersionCapabilities\"\x8c\x07\n\x1dPollActivityTaskQueueResponse\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x1a\n\x12workflow_namespace\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x45\n\x12workflow_execution\x18\x04 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12;\n\ractivity_type\x18\x05 \x01(\x0b\x32$.temporal.api.common.v1.ActivityType\x12\x13\n\x0b\x61\x63tivity_id\x18\x06 \x01(\t\x12.\n\x06header\x18\x07 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12/\n\x05input\x18\x08 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12;\n\x11heartbeat_details\x18\t \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x38\n\x0escheduled_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12H\n\x1e\x63urrent_attempt_scheduled_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x36\n\x0cstarted_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x0f\n\x07\x61ttempt\x18\r \x01(\x05\x12\x42\n\x19schedule_to_close_timeout\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12?\n\x16start_to_close_timeout\x18\x0f \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12:\n\x11heartbeat_timeout\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x39\n\x0cretry_policy\x18\x11 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\"\x90\x01\n\"RecordActivityTaskHeartbeatRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x31\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"?\n#RecordActivityTaskHeartbeatResponse\x12\x18\n\x10\x63\x61ncel_requested\x18\x01 \x01(\x08\"\xba\x01\n&RecordActivityTaskHeartbeatByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tivity_id\x18\x04 \x01(\t\x12\x31\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x06 \x01(\t\"C\n\'RecordActivityTaskHeartbeatByIdResponse\x12\x18\n\x10\x63\x61ncel_requested\x18\x01 \x01(\x08\"\x90\x01\n#RespondActivityTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x30\n\x06result\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"&\n$RespondActivityTaskCompletedResponse\"\xba\x01\n\'RespondActivityTaskCompletedByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tivity_id\x18\x04 \x01(\t\x12\x30\n\x06result\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x06 \x01(\t\"*\n(RespondActivityTaskCompletedByIdResponse\"\xd0\x01\n RespondActivityTaskFailedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x31\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\x12@\n\x16last_heartbeat_details\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\"W\n!RespondActivityTaskFailedResponse\x12\x32\n\x08\x66\x61ilures\x18\x01 \x03(\x0b\x32 .temporal.api.failure.v1.Failure\"\xfa\x01\n$RespondActivityTaskFailedByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tivity_id\x18\x04 \x01(\t\x12\x31\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12\x10\n\x08identity\x18\x06 \x01(\t\x12@\n\x16last_heartbeat_details\x18\x07 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\"[\n%RespondActivityTaskFailedByIdResponse\x12\x32\n\x08\x66\x61ilures\x18\x01 \x03(\x0b\x32 .temporal.api.failure.v1.Failure\"\x90\x01\n\"RespondActivityTaskCanceledRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12\x31\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"%\n#RespondActivityTaskCanceledResponse\"\xba\x01\n&RespondActivityTaskCanceledByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tivity_id\x18\x04 \x01(\t\x12\x31\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x06 \x01(\t\")\n\'RespondActivityTaskCanceledByIdResponse\"\xd7\x01\n%RequestCancelWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x12\n\nrequest_id\x18\x04 \x01(\t\x12\x1e\n\x16\x66irst_execution_run_id\x18\x05 \x01(\t\x12\x0e\n\x06reason\x18\x06 \x01(\t\"(\n&RequestCancelWorkflowExecutionResponse\"\xcc\x02\n\x1eSignalWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x13\n\x0bsignal_name\x18\x03 \x01(\t\x12/\n\x05input\x18\x04 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\x12\x0f\n\x07\x63ontrol\x18\x07 \x01(\t\x12.\n\x06header\x18\x08 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12#\n\x1bskip_generate_workflow_task\x18\t \x01(\x08\"!\n\x1fSignalWorkflowExecutionResponse\"\xe8\x07\n\'SignalWithStartWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\x0b\x32$.temporal.api.common.v1.WorkflowType\x12\x38\n\ntask_queue\x18\x04 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x43\n\x1aworkflow_execution_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12=\n\x14workflow_run_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12>\n\x15workflow_task_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12\x10\n\x08identity\x18\t \x01(\t\x12\x12\n\nrequest_id\x18\n \x01(\t\x12N\n\x18workflow_id_reuse_policy\x18\x0b \x01(\x0e\x32,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x13\n\x0bsignal_name\x18\x0c \x01(\t\x12\x36\n\x0csignal_input\x18\r \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x0f\n\x07\x63ontrol\x18\x0e \x01(\t\x12\x39\n\x0cretry_policy\x18\x0f \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x10 \x01(\t\x12*\n\x04memo\x18\x11 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x12 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12.\n\x06header\x18\x13 \x01(\x0b\x32\x1e.temporal.api.common.v1.Header\x12=\n\x14workflow_start_delay\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x04\x98\xdf\x1f\x01\x12#\n\x1bskip_generate_workflow_task\x18\x15 \x01(\x08\":\n(SignalWithStartWorkflowExecutionResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\x89\x02\n\x1dResetWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x0e\n\x06reason\x18\x03 \x01(\t\x12%\n\x1dworkflow_task_finish_event_id\x18\x04 \x01(\x03\x12\x12\n\nrequest_id\x18\x05 \x01(\t\x12\x43\n\x12reset_reapply_type\x18\x06 \x01(\x0e\x32\'.temporal.api.enums.v1.ResetReapplyType\"0\n\x1eResetWorkflowExecutionResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\xf2\x01\n!TerminateWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x0e\n\x06reason\x18\x03 \x01(\t\x12\x31\n\x07\x64\x65tails\x18\x04 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x10\n\x08identity\x18\x05 \x01(\t\x12\x1e\n\x16\x66irst_execution_run_id\x18\x06 \x01(\t\"$\n\"TerminateWorkflowExecutionResponse\"z\n\x1e\x44\x65leteWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\"!\n\x1f\x44\x65leteWorkflowExecutionResponse\"\xc9\x02\n!ListOpenWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\x42\n\x11start_time_filter\x18\x04 \x01(\x0b\x32\'.temporal.api.filter.v1.StartTimeFilter\x12K\n\x10\x65xecution_filter\x18\x05 \x01(\x0b\x32/.temporal.api.filter.v1.WorkflowExecutionFilterH\x00\x12\x41\n\x0btype_filter\x18\x06 \x01(\x0b\x32*.temporal.api.filter.v1.WorkflowTypeFilterH\x00\x42\t\n\x07\x66ilters\"\x82\x01\n\"ListOpenWorkflowExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"\x8a\x03\n#ListClosedWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\x42\n\x11start_time_filter\x18\x04 \x01(\x0b\x32\'.temporal.api.filter.v1.StartTimeFilter\x12K\n\x10\x65xecution_filter\x18\x05 \x01(\x0b\x32/.temporal.api.filter.v1.WorkflowExecutionFilterH\x00\x12\x41\n\x0btype_filter\x18\x06 \x01(\x0b\x32*.temporal.api.filter.v1.WorkflowTypeFilterH\x00\x12=\n\rstatus_filter\x18\x07 \x01(\x0b\x32$.temporal.api.filter.v1.StatusFilterH\x00\x42\t\n\x07\x66ilters\"\x84\x01\n$ListClosedWorkflowExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"m\n\x1dListWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\r\n\x05query\x18\x04 \x01(\t\"~\n\x1eListWorkflowExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"u\n%ListArchivedWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\r\n\x05query\x18\x04 \x01(\t\"\x86\x01\n&ListArchivedWorkflowExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"m\n\x1dScanWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\x12\r\n\x05query\x18\x04 \x01(\t\"~\n\x1eScanWorkflowExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"B\n\x1e\x43ountWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\r\n\x05query\x18\x02 \x01(\t\"0\n\x1f\x43ountWorkflowExecutionsResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\"\x1c\n\x1aGetSearchAttributesRequest\"\xc9\x01\n\x1bGetSearchAttributesResponse\x12T\n\x04keys\x18\x01 \x03(\x0b\x32\x46.temporal.api.workflowservice.v1.GetSearchAttributesResponse.KeysEntry\x1aT\n\tKeysEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0e\x32\'.temporal.api.enums.v1.IndexedValueType:\x02\x38\x01\"\xde\x01\n RespondQueryTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\x0c\x12>\n\x0e\x63ompleted_type\x18\x02 \x01(\x0e\x32&.temporal.api.enums.v1.QueryResultType\x12\x36\n\x0cquery_result\x18\x03 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x15\n\rerror_message\x18\x04 \x01(\t\x12\x11\n\tnamespace\x18\x06 \x01(\tJ\x04\x08\x05\x10\x06\"#\n!RespondQueryTaskCompletedResponse\"n\n\x1bResetStickyTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\"\x1e\n\x1cResetStickyTaskQueueResponse\"\xe9\x01\n\x14QueryWorkflowRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x33\n\x05query\x18\x03 \x01(\x0b\x32$.temporal.api.query.v1.WorkflowQuery\x12K\n\x16query_reject_condition\x18\x04 \x01(\x0e\x32+.temporal.api.enums.v1.QueryRejectCondition\"\x8d\x01\n\x15QueryWorkflowResponse\x12\x36\n\x0cquery_result\x18\x01 \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12<\n\x0equery_rejected\x18\x02 \x01(\x0b\x32$.temporal.api.query.v1.QueryRejected\"s\n DescribeWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\"\xae\x03\n!DescribeWorkflowExecutionResponse\x12K\n\x10\x65xecution_config\x18\x01 \x01(\x0b\x32\x31.temporal.api.workflow.v1.WorkflowExecutionConfig\x12P\n\x17workflow_execution_info\x18\x02 \x01(\x0b\x32/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12I\n\x12pending_activities\x18\x03 \x03(\x0b\x32-.temporal.api.workflow.v1.PendingActivityInfo\x12M\n\x10pending_children\x18\x04 \x03(\x0b\x32\x33.temporal.api.workflow.v1.PendingChildExecutionInfo\x12P\n\x15pending_workflow_task\x18\x05 \x01(\x0b\x32\x31.temporal.api.workflow.v1.PendingWorkflowTaskInfo\"\xc9\x01\n\x18\x44\x65scribeTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x38\n\ntask_queue\x18\x02 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12=\n\x0ftask_queue_type\x18\x03 \x01(\x0e\x32$.temporal.api.enums.v1.TaskQueueType\x12!\n\x19include_task_queue_status\x18\x04 \x01(\x08\"\x9a\x01\n\x19\x44\x65scribeTaskQueueResponse\x12\x36\n\x07pollers\x18\x01 \x03(\x0b\x32%.temporal.api.taskqueue.v1.PollerInfo\x12\x45\n\x11task_queue_status\x18\x02 \x01(\x0b\x32*.temporal.api.taskqueue.v1.TaskQueueStatus\"\x17\n\x15GetClusterInfoRequest\"\x8b\x03\n\x16GetClusterInfoResponse\x12h\n\x11supported_clients\x18\x01 \x03(\x0b\x32M.temporal.api.workflowservice.v1.GetClusterInfoResponse.SupportedClientsEntry\x12\x16\n\x0eserver_version\x18\x02 \x01(\t\x12\x12\n\ncluster_id\x18\x03 \x01(\t\x12:\n\x0cversion_info\x18\x04 \x01(\x0b\x32$.temporal.api.version.v1.VersionInfo\x12\x14\n\x0c\x63luster_name\x18\x05 \x01(\t\x12\x1b\n\x13history_shard_count\x18\x06 \x01(\x05\x12\x19\n\x11persistence_store\x18\x07 \x01(\t\x12\x18\n\x10visibility_store\x18\x08 \x01(\t\x1a\x37\n\x15SupportedClientsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x16\n\x14GetSystemInfoRequest\"\xbc\x03\n\x15GetSystemInfoResponse\x12\x16\n\x0eserver_version\x18\x01 \x01(\t\x12Y\n\x0c\x63\x61pabilities\x18\x02 \x01(\x0b\x32\x43.temporal.api.workflowservice.v1.GetSystemInfoResponse.Capabilities\x1a\xaf\x02\n\x0c\x43\x61pabilities\x12\x1f\n\x17signal_and_query_header\x18\x01 \x01(\x08\x12&\n\x1einternal_error_differentiation\x18\x02 \x01(\x08\x12*\n\"activity_failure_include_heartbeat\x18\x03 \x01(\x08\x12\x1a\n\x12supports_schedules\x18\x04 \x01(\x08\x12\"\n\x1a\x65ncoded_failure_attributes\x18\x05 \x01(\x08\x12!\n\x19\x62uild_id_based_versioning\x18\x06 \x01(\x08\x12\x13\n\x0bupsert_memo\x18\x07 \x01(\x08\x12\x1c\n\x14\x65\x61ger_workflow_start\x18\x08 \x01(\x08\x12\x14\n\x0csdk_metadata\x18\t \x01(\x08\"m\n\x1eListTaskQueuePartitionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x38\n\ntask_queue\x18\x02 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\"\xdf\x01\n\x1fListTaskQueuePartitionsResponse\x12]\n\x1e\x61\x63tivity_task_queue_partitions\x18\x01 \x03(\x0b\x32\x35.temporal.api.taskqueue.v1.TaskQueuePartitionMetadata\x12]\n\x1eworkflow_task_queue_partitions\x18\x02 \x03(\x0b\x32\x35.temporal.api.taskqueue.v1.TaskQueuePartitionMetadata\"\xcc\x02\n\x15\x43reateScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\x12\x34\n\x08schedule\x18\x03 \x01(\x0b\x32\".temporal.api.schedule.v1.Schedule\x12>\n\rinitial_patch\x18\x04 \x01(\x0b\x32\'.temporal.api.schedule.v1.SchedulePatch\x12\x10\n\x08identity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\x12*\n\x04memo\x18\x07 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x08 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\"0\n\x16\x43reateScheduleResponse\x12\x16\n\x0e\x63onflict_token\x18\x01 \x01(\x0c\"A\n\x17\x44\x65scribeScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\"\x8f\x02\n\x18\x44\x65scribeScheduleResponse\x12\x34\n\x08schedule\x18\x01 \x01(\x0b\x32\".temporal.api.schedule.v1.Schedule\x12\x34\n\x04info\x18\x02 \x01(\x0b\x32&.temporal.api.schedule.v1.ScheduleInfo\x12*\n\x04memo\x18\x03 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x04 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12\x16\n\x0e\x63onflict_token\x18\x05 \x01(\x0c\"\xb3\x01\n\x15UpdateScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\x12\x34\n\x08schedule\x18\x03 \x01(\x0b\x32\".temporal.api.schedule.v1.Schedule\x12\x16\n\x0e\x63onflict_token\x18\x04 \x01(\x0c\x12\x10\n\x08identity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\"\x18\n\x16UpdateScheduleResponse\"\x9c\x01\n\x14PatchScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\x12\x36\n\x05patch\x18\x03 \x01(\x0b\x32\'.temporal.api.schedule.v1.SchedulePatch\x12\x10\n\x08identity\x18\x04 \x01(\t\x12\x12\n\nrequest_id\x18\x05 \x01(\t\"\x17\n\x15PatchScheduleResponse\"\xb4\x01\n ListScheduleMatchingTimesRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\x12\x34\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x32\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\"Y\n!ListScheduleMatchingTimesResponse\x12\x34\n\nstart_time\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\"Q\n\x15\x44\x65leteScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bschedule_id\x18\x02 \x01(\t\x12\x10\n\x08identity\x18\x03 \x01(\t\"\x18\n\x16\x44\x65leteScheduleResponse\"]\n\x14ListSchedulesRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\"p\n\x15ListSchedulesResponse\x12>\n\tschedules\x18\x01 \x03(\x0b\x32+.temporal.api.schedule.v1.ScheduleListEntry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"\xd1\x03\n\'UpdateWorkerBuildIdCompatibilityRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12-\n#add_new_build_id_in_new_default_set\x18\x03 \x01(\tH\x00\x12\x87\x01\n\x1b\x61\x64\x64_new_compatible_build_id\x18\x04 \x01(\x0b\x32`.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.AddNewCompatibleVersionH\x00\x12!\n\x17promote_set_by_build_id\x18\x05 \x01(\tH\x00\x12%\n\x1bpromote_build_id_within_set\x18\x06 \x01(\tH\x00\x1ao\n\x17\x41\x64\x64NewCompatibleVersion\x12\x14\n\x0cnew_build_id\x18\x01 \x01(\t\x12$\n\x1c\x65xisting_compatible_build_id\x18\x02 \x01(\t\x12\x18\n\x10make_set_default\x18\x03 \x01(\x08\x42\x0b\n\toperation\"B\n(UpdateWorkerBuildIdCompatibilityResponse\x12\x16\n\x0eversion_set_id\x18\x01 \x01(\t\"\xac\x01\n$GetWorkerBuildIdCompatibilityRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12\x10\n\x08max_sets\x18\x03 \x01(\x05\x12%\n\x1dinclude_retirement_candidates\x18\x04 \x01(\x08\x12$\n\x1cinclude_poller_compatibility\x18\x05 \x01(\x08\"\xf8\x04\n%GetWorkerBuildIdCompatibilityResponse\x12K\n\x12major_version_sets\x18\x01 \x03(\x0b\x32/.temporal.api.taskqueue.v1.CompatibleVersionSet\x12y\n\x15retirement_candidates\x18\x02 \x03(\x0b\x32Z.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse.RetirementCandidate\x12\x89\x01\n\x1b\x61\x63tive_versions_and_pollers\x18\x03 \x03(\x0b\x32\x64.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse.VersionsWithCompatiblePollers\x1a\x83\x01\n\x13RetirementCandidate\x12\x10\n\x08\x62uild_id\x18\x01 \x01(\t\x12\"\n\x1a\x61ll_workflows_are_archived\x18\x02 \x01(\x08\x12\x36\n\x07pollers\x18\x03 \x03(\x0b\x32%.temporal.api.taskqueue.v1.PollerInfo\x1au\n\x1dVersionsWithCompatiblePollers\x12\x1c\n\x14most_recent_build_id\x18\x01 \x01(\t\x12\x36\n\x07pollers\x18\x02 \x03(\x0b\x32%.temporal.api.taskqueue.v1.PollerInfo\"\x85\x02\n\x1eUpdateWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x45\n\x12workflow_execution\x18\x02 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x1e\n\x16\x66irst_execution_run_id\x18\x03 \x01(\t\x12\x37\n\x0bwait_policy\x18\x04 \x01(\x0b\x32\".temporal.api.update.v1.WaitPolicy\x12\x30\n\x07request\x18\x05 \x01(\x0b\x32\x1f.temporal.api.update.v1.Request\"\x8a\x01\n\x1fUpdateWorkflowExecutionResponse\x12\x35\n\nupdate_ref\x18\x01 \x01(\x0b\x32!.temporal.api.update.v1.UpdateRef\x12\x30\n\x07outcome\x18\x02 \x01(\x0b\x32\x1f.temporal.api.update.v1.Outcome\"\xf3\x03\n\x1aStartBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x18\n\x10visibility_query\x18\x02 \x01(\t\x12\x0e\n\x06job_id\x18\x03 \x01(\t\x12\x0e\n\x06reason\x18\x04 \x01(\t\x12=\n\nexecutions\x18\x05 \x03(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12Q\n\x15termination_operation\x18\n \x01(\x0b\x32\x30.temporal.api.batch.v1.BatchOperationTerminationH\x00\x12G\n\x10signal_operation\x18\x0b \x01(\x0b\x32+.temporal.api.batch.v1.BatchOperationSignalH\x00\x12S\n\x16\x63\x61ncellation_operation\x18\x0c \x01(\x0b\x32\x31.temporal.api.batch.v1.BatchOperationCancellationH\x00\x12K\n\x12\x64\x65letion_operation\x18\r \x01(\x0b\x32-.temporal.api.batch.v1.BatchOperationDeletionH\x00\x42\x0b\n\toperation\"\x1d\n\x1bStartBatchOperationResponse\"`\n\x19StopBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x0e\n\x06reason\x18\x03 \x01(\t\x12\x10\n\x08identity\x18\x04 \x01(\t\"\x1c\n\x1aStopBatchOperationResponse\"B\n\x1d\x44\x65scribeBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\"\x9e\x03\n\x1e\x44\x65scribeBatchOperationResponse\x12\x41\n\x0eoperation_type\x18\x01 \x01(\x0e\x32).temporal.api.enums.v1.BatchOperationType\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x39\n\x05state\x18\x03 \x01(\x0e\x32*.temporal.api.enums.v1.BatchOperationState\x12\x34\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x34\n\nclose_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x04\x90\xdf\x1f\x01\x12\x1d\n\x15total_operation_count\x18\x06 \x01(\x03\x12 \n\x18\x63omplete_operation_count\x18\x07 \x01(\x03\x12\x1f\n\x17\x66\x61ilure_operation_count\x18\x08 \x01(\x03\x12\x10\n\x08identity\x18\t \x01(\t\x12\x0e\n\x06reason\x18\n \x01(\t\"[\n\x1aListBatchOperationsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\x0c\"y\n\x1bListBatchOperationsResponse\x12\x41\n\x0eoperation_info\x18\x01 \x03(\x0b\x32).temporal.api.batch.v1.BatchOperationInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\x0c\"\xb9\x01\n\"PollWorkflowExecutionUpdateRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x35\n\nupdate_ref\x18\x02 \x01(\x0b\x32!.temporal.api.update.v1.UpdateRef\x12\x10\n\x08identity\x18\x03 \x01(\t\x12\x37\n\x0bwait_policy\x18\x04 \x01(\x0b\x32\".temporal.api.update.v1.WaitPolicy\"W\n#PollWorkflowExecutionUpdateResponse\x12\x30\n\x07outcome\x18\x01 \x01(\x0b\x32\x1f.temporal.api.update.v1.OutcomeB\xbe\x01\n\"io.temporal.api.workflowservice.v1B\x14RequestResponseProtoP\x01Z5go.temporal.io/api/workflowservice/v1;workflowservice\xaa\x02!Temporalio.Api.WorkflowService.V1\xea\x02$Temporalio::Api::WorkflowService::V1b\x06proto3" +descriptor_data = "\n6temporal/api/workflowservice/v1/request_response.proto\x12\x1Ftemporal.api.workflowservice.v1\x1A+temporal/api/enums/v1/batch_operation.proto\x1A$temporal/api/enums/v1/workflow.proto\x1A%temporal/api/enums/v1/namespace.proto\x1A(temporal/api/enums/v1/failed_cause.proto\x1A\"temporal/api/enums/v1/common.proto\x1A!temporal/api/enums/v1/query.proto\x1A!temporal/api/enums/v1/reset.proto\x1A&temporal/api/enums/v1/task_queue.proto\x1A$temporal/api/common/v1/message.proto\x1A%temporal/api/history/v1/message.proto\x1A&temporal/api/workflow/v1/message.proto\x1A%temporal/api/command/v1/message.proto\x1A%temporal/api/failure/v1/message.proto\x1A$temporal/api/filter/v1/message.proto\x1A&temporal/api/protocol/v1/message.proto\x1A'temporal/api/namespace/v1/message.proto\x1A#temporal/api/query/v1/message.proto\x1A)temporal/api/replication/v1/message.proto\x1A&temporal/api/schedule/v1/message.proto\x1A'temporal/api/taskqueue/v1/message.proto\x1A$temporal/api/update/v1/message.proto\x1A%temporal/api/version/v1/message.proto\x1A#temporal/api/batch/v1/message.proto\x1A0temporal/api/sdk/v1/task_complete_metadata.proto\x1A\x1Egoogle/protobuf/duration.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A!dependencies/gogoproto/gogo.proto\x1A\"temporal/api/enums/v1/update.proto\"\x8E\x05\n\x18RegisterNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vdescription\x18\x02 \x01(\t\x12\x13\n\vowner_email\x18\x03 \x01(\t\x12L\n#workflow_execution_retention_period\x18\x04 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12G\n\bclusters\x18\x05 \x03(\v25.temporal.api.replication.v1.ClusterReplicationConfig\x12\e\n\x13active_cluster_name\x18\x06 \x01(\t\x12Q\n\x04data\x18\a \x03(\v2C.temporal.api.workflowservice.v1.RegisterNamespaceRequest.DataEntry\x12\x16\n\x0Esecurity_token\x18\b \x01(\t\x12\e\n\x13is_global_namespace\x18\t \x01(\b\x12D\n\x16history_archival_state\x18\n \x01(\x0E2$.temporal.api.enums.v1.ArchivalState\x12\x1C\n\x14history_archival_uri\x18\v \x01(\t\x12G\n\x19visibility_archival_state\x18\f \x01(\x0E2$.temporal.api.enums.v1.ArchivalState\x12\x1F\n\x17visibility_archival_uri\x18\r \x01(\t\x1A+\n\tDataEntry\x12\v\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x028\x01\"\e\n\x19RegisterNamespaceResponse\"\x89\x01\n\x15ListNamespacesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\x12D\n\x10namespace_filter\x18\x03 \x01(\v2*.temporal.api.namespace.v1.NamespaceFilter\"\x81\x01\n\x16ListNamespacesResponse\x12N\n\nnamespaces\x18\x01 \x03(\v2:.temporal.api.workflowservice.v1.DescribeNamespaceResponse\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"9\n\x18DescribeNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"\xEC\x02\n\x19DescribeNamespaceResponse\x12@\n\x0Enamespace_info\x18\x01 \x01(\v2(.temporal.api.namespace.v1.NamespaceInfo\x12:\n\x06config\x18\x02 \x01(\v2*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x03 \x01(\v27.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x18\n\x10failover_version\x18\x04 \x01(\x03\x12\e\n\x13is_global_namespace\x18\x05 \x01(\b\x12E\n\x10failover_history\x18\x06 \x03(\v2+.temporal.api.replication.v1.FailoverStatus\"\xCF\x02\n\x16UpdateNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12C\n\vupdate_info\x18\x02 \x01(\v2..temporal.api.namespace.v1.UpdateNamespaceInfo\x12:\n\x06config\x18\x03 \x01(\v2*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x04 \x01(\v27.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x16\n\x0Esecurity_token\x18\x05 \x01(\t\x12\x19\n\x11delete_bad_binary\x18\x06 \x01(\t\x12\x19\n\x11promote_namespace\x18\a \x01(\b\"\xA3\x02\n\x17UpdateNamespaceResponse\x12@\n\x0Enamespace_info\x18\x01 \x01(\v2(.temporal.api.namespace.v1.NamespaceInfo\x12:\n\x06config\x18\x02 \x01(\v2*.temporal.api.namespace.v1.NamespaceConfig\x12S\n\x12replication_config\x18\x03 \x01(\v27.temporal.api.replication.v1.NamespaceReplicationConfig\x12\x18\n\x10failover_version\x18\x04 \x01(\x03\x12\e\n\x13is_global_namespace\x18\x05 \x01(\b\"F\n\x19DeprecateNamespaceRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x16\n\x0Esecurity_token\x18\x02 \x01(\t\"\x1C\n\x1ADeprecateNamespaceResponse\"\xD1\b\n\x1DStartWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x128\n\ntask_queue\x18\x04 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12C\n\x1Aworkflow_execution_timeout\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12=\n\x14workflow_run_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12>\n\x15workflow_task_timeout\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12\x10\n\bidentity\x18\t \x01(\t\x12\x12\n\nrequest_id\x18\n \x01(\t\x12N\n\x18workflow_id_reuse_policy\x18\v \x01(\x0E2,.temporal.api.enums.v1.WorkflowIdReusePolicy\x129\n\fretry_policy\x18\f \x01(\v2#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\r \x01(\t\x12*\n\x04memo\x18\x0E \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x0F \x01(\v2(.temporal.api.common.v1.SearchAttributes\x12.\n\x06header\x18\x10 \x01(\v2\x1E.temporal.api.common.v1.Header\x12\x1F\n\x17request_eager_execution\x18\x11 \x01(\b\x12;\n\x11continued_failure\x18\x12 \x01(\v2 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\x13 \x01(\v2 .temporal.api.common.v1.Payloads\x12=\n\x14workflow_start_delay\x18\x14 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12T\n\eworkflow_id_conflict_policy\x18\x16 \x01(\x0E2/.temporal.api.enums.v1.WorkflowIdConflictPolicy\"\x9E\x01\n\x1EStartWorkflowExecutionResponse\x12\x0E\n\x06run_id\x18\x01 \x01(\t\x12[\n\x13eager_workflow_task\x18\x02 \x01(\v2>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\x12\x0F\n\astarted\x18\x03 \x01(\b\"\xAA\x02\n\"GetWorkflowExecutionHistoryRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x19\n\x11maximum_page_size\x18\x03 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x04 \x01(\f\x12\x16\n\x0Ewait_new_event\x18\x05 \x01(\b\x12P\n\x19history_event_filter_type\x18\x06 \x01(\x0E2-.temporal.api.enums.v1.HistoryEventFilterType\x12\x15\n\rskip_archival\x18\a \x01(\b\"\xBA\x01\n#GetWorkflowExecutionHistoryResponse\x121\n\ahistory\x18\x01 \x01(\v2 .temporal.api.history.v1.History\x125\n\vraw_history\x18\x02 \x03(\v2 .temporal.api.common.v1.DataBlob\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12\x10\n\barchived\x18\x04 \x01(\b\"\xB0\x01\n)GetWorkflowExecutionHistoryReverseRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x19\n\x11maximum_page_size\x18\x03 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x04 \x01(\f\"x\n*GetWorkflowExecutionHistoryReverseResponse\x121\n\ahistory\x18\x01 \x01(\v2 .temporal.api.history.v1.History\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\"\xEE\x01\n\x1CPollWorkflowTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x128\n\ntask_queue\x18\x02 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x17\n\x0Fbinary_checksum\x18\x04 \x01(\t\x12V\n\eworker_version_capabilities\x18\x05 \x01(\v21.temporal.api.common.v1.WorkerVersionCapabilities\"\xCA\x06\n\x1DPollWorkflowTaskQueueResponse\x12\x12\n\ntask_token\x18\x01 \x01(\f\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12!\n\x19previous_started_event_id\x18\x04 \x01(\x03\x12\x18\n\x10started_event_id\x18\x05 \x01(\x03\x12\x0F\n\aattempt\x18\x06 \x01(\x05\x12\x1A\n\x12backlog_count_hint\x18\a \x01(\x03\x121\n\ahistory\x18\b \x01(\v2 .temporal.api.history.v1.History\x12\x17\n\x0Fnext_page_token\x18\t \x01(\f\x123\n\x05query\x18\n \x01(\v2$.temporal.api.query.v1.WorkflowQuery\x12K\n\x1Dworkflow_execution_task_queue\x18\v \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x128\n\x0Escheduled_time\x18\f \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x126\n\fstarted_time\x18\r \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x12\\\n\aqueries\x18\x0E \x03(\v2K.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse.QueriesEntry\x123\n\bmessages\x18\x0F \x03(\v2!.temporal.api.protocol.v1.Message\x1AT\n\fQueriesEntry\x12\v\n\x03key\x18\x01 \x01(\t\x123\n\x05value\x18\x02 \x01(\v2$.temporal.api.query.v1.WorkflowQuery:\x028\x01\"\xA4\x06\n#RespondWorkflowTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x122\n\bcommands\x18\x02 \x03(\v2 .temporal.api.command.v1.Command\x12\x10\n\bidentity\x18\x03 \x01(\t\x12O\n\x11sticky_attributes\x18\x04 \x01(\v24.temporal.api.taskqueue.v1.StickyExecutionAttributes\x12 \n\x18return_new_workflow_task\x18\x05 \x01(\b\x12&\n\x1Eforce_create_new_workflow_task\x18\x06 \x01(\b\x12\x17\n\x0Fbinary_checksum\x18\a \x01(\t\x12m\n\rquery_results\x18\b \x03(\v2V.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest.QueryResultsEntry\x12\x11\n\tnamespace\x18\t \x01(\t\x12H\n\x14worker_version_stamp\x18\n \x01(\v2*.temporal.api.common.v1.WorkerVersionStamp\x123\n\bmessages\x18\v \x03(\v2!.temporal.api.protocol.v1.Message\x12H\n\fsdk_metadata\x18\f \x01(\v22.temporal.api.sdk.v1.WorkflowTaskCompletedMetadata\x12C\n\x11metering_metadata\x18\r \x01(\v2(.temporal.api.common.v1.MeteringMetadata\x1A_\n\x11QueryResultsEntry\x12\v\n\x03key\x18\x01 \x01(\t\x129\n\x05value\x18\x02 \x01(\v2*.temporal.api.query.v1.WorkflowQueryResult:\x028\x01\"\xF5\x01\n$RespondWorkflowTaskCompletedResponse\x12U\n\rworkflow_task\x18\x01 \x01(\v2>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\x12V\n\x0Eactivity_tasks\x18\x02 \x03(\v2>.temporal.api.workflowservice.v1.PollActivityTaskQueueResponse\x12\x1E\n\x16reset_history_event_id\x18\x03 \x01(\x03\"\x9B\x02\n RespondWorkflowTaskFailedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x12=\n\x05cause\x18\x02 \x01(\x0E2..temporal.api.enums.v1.WorkflowTaskFailedCause\x121\n\afailure\x18\x03 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x10\n\bidentity\x18\x04 \x01(\t\x12\x17\n\x0Fbinary_checksum\x18\x05 \x01(\t\x12\x11\n\tnamespace\x18\x06 \x01(\t\x123\n\bmessages\x18\a \x03(\v2!.temporal.api.protocol.v1.Message\"#\n!RespondWorkflowTaskFailedResponse\"\xA0\x02\n\x1CPollActivityTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x128\n\ntask_queue\x18\x02 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12\x10\n\bidentity\x18\x03 \x01(\t\x12I\n\x13task_queue_metadata\x18\x04 \x01(\v2,.temporal.api.taskqueue.v1.TaskQueueMetadata\x12V\n\eworker_version_capabilities\x18\x05 \x01(\v21.temporal.api.common.v1.WorkerVersionCapabilities\"\x8C\a\n\x1DPollActivityTaskQueueResponse\x12\x12\n\ntask_token\x18\x01 \x01(\f\x12\x1A\n\x12workflow_namespace\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x12E\n\x12workflow_execution\x18\x04 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12;\n\ractivity_type\x18\x05 \x01(\v2$.temporal.api.common.v1.ActivityType\x12\x13\n\vactivity_id\x18\x06 \x01(\t\x12.\n\x06header\x18\a \x01(\v2\x1E.temporal.api.common.v1.Header\x12/\n\x05input\x18\b \x01(\v2 .temporal.api.common.v1.Payloads\x12;\n\x11heartbeat_details\x18\t \x01(\v2 .temporal.api.common.v1.Payloads\x128\n\x0Escheduled_time\x18\n \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x12H\n\x1Ecurrent_attempt_scheduled_time\x18\v \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x126\n\fstarted_time\x18\f \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x12\x0F\n\aattempt\x18\r \x01(\x05\x12B\n\x19schedule_to_close_timeout\x18\x0E \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12?\n\x16start_to_close_timeout\x18\x0F \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12:\n\x11heartbeat_timeout\x18\x10 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x129\n\fretry_policy\x18\x11 \x01(\v2#.temporal.api.common.v1.RetryPolicy\"\x90\x01\n\"RecordActivityTaskHeartbeatRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x121\n\adetails\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"?\n#RecordActivityTaskHeartbeatResponse\x12\x18\n\x10cancel_requested\x18\x01 \x01(\b\"\xBA\x01\n&RecordActivityTaskHeartbeatByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12\x0E\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\vactivity_id\x18\x04 \x01(\t\x121\n\adetails\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x06 \x01(\t\"C\n'RecordActivityTaskHeartbeatByIdResponse\x12\x18\n\x10cancel_requested\x18\x01 \x01(\b\"\x90\x01\n#RespondActivityTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x120\n\x06result\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"&\n$RespondActivityTaskCompletedResponse\"\xBA\x01\n'RespondActivityTaskCompletedByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12\x0E\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\vactivity_id\x18\x04 \x01(\t\x120\n\x06result\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x06 \x01(\t\"*\n(RespondActivityTaskCompletedByIdResponse\"\xD0\x01\n RespondActivityTaskFailedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x121\n\afailure\x18\x02 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\x12@\n\x16last_heartbeat_details\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\"W\n!RespondActivityTaskFailedResponse\x122\n\bfailures\x18\x01 \x03(\v2 .temporal.api.failure.v1.Failure\"\xFA\x01\n$RespondActivityTaskFailedByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12\x0E\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\vactivity_id\x18\x04 \x01(\t\x121\n\afailure\x18\x05 \x01(\v2 .temporal.api.failure.v1.Failure\x12\x10\n\bidentity\x18\x06 \x01(\t\x12@\n\x16last_heartbeat_details\x18\a \x01(\v2 .temporal.api.common.v1.Payloads\"[\n%RespondActivityTaskFailedByIdResponse\x122\n\bfailures\x18\x01 \x03(\v2 .temporal.api.failure.v1.Failure\"\x90\x01\n\"RespondActivityTaskCanceledRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x121\n\adetails\x18\x02 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\t\"%\n#RespondActivityTaskCanceledResponse\"\xBA\x01\n&RespondActivityTaskCanceledByIdRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12\x0E\n\x06run_id\x18\x03 \x01(\t\x12\x13\n\vactivity_id\x18\x04 \x01(\t\x121\n\adetails\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x06 \x01(\t\")\n'RespondActivityTaskCanceledByIdResponse\"\xD7\x01\n%RequestCancelWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x10\n\bidentity\x18\x03 \x01(\t\x12\x12\n\nrequest_id\x18\x04 \x01(\t\x12\x1E\n\x16first_execution_run_id\x18\x05 \x01(\t\x12\x0E\n\x06reason\x18\x06 \x01(\t\"(\n&RequestCancelWorkflowExecutionResponse\"\xCC\x02\n\x1ESignalWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x13\n\vsignal_name\x18\x03 \x01(\t\x12/\n\x05input\x18\x04 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\x12\x0F\n\acontrol\x18\a \x01(\t\x12.\n\x06header\x18\b \x01(\v2\x1E.temporal.api.common.v1.Header\x12#\n\eskip_generate_workflow_task\x18\t \x01(\b\"!\n\x1FSignalWorkflowExecutionResponse\"\xE8\a\n'SignalWithStartWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vworkflow_id\x18\x02 \x01(\t\x12;\n\rworkflow_type\x18\x03 \x01(\v2$.temporal.api.common.v1.WorkflowType\x128\n\ntask_queue\x18\x04 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12/\n\x05input\x18\x05 \x01(\v2 .temporal.api.common.v1.Payloads\x12C\n\x1Aworkflow_execution_timeout\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12=\n\x14workflow_run_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12>\n\x15workflow_task_timeout\x18\b \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12\x10\n\bidentity\x18\t \x01(\t\x12\x12\n\nrequest_id\x18\n \x01(\t\x12N\n\x18workflow_id_reuse_policy\x18\v \x01(\x0E2,.temporal.api.enums.v1.WorkflowIdReusePolicy\x12\x13\n\vsignal_name\x18\f \x01(\t\x126\n\fsignal_input\x18\r \x01(\v2 .temporal.api.common.v1.Payloads\x12\x0F\n\acontrol\x18\x0E \x01(\t\x129\n\fretry_policy\x18\x0F \x01(\v2#.temporal.api.common.v1.RetryPolicy\x12\x15\n\rcron_schedule\x18\x10 \x01(\t\x12*\n\x04memo\x18\x11 \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x12 \x01(\v2(.temporal.api.common.v1.SearchAttributes\x12.\n\x06header\x18\x13 \x01(\v2\x1E.temporal.api.common.v1.Header\x12=\n\x14workflow_start_delay\x18\x14 \x01(\v2\x19.google.protobuf.DurationB\x04\x98\xDF\x1F\x01\x12#\n\eskip_generate_workflow_task\x18\x15 \x01(\b\":\n(SignalWithStartWorkflowExecutionResponse\x12\x0E\n\x06run_id\x18\x01 \x01(\t\"\x89\x02\n\x1DResetWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x0E\n\x06reason\x18\x03 \x01(\t\x12%\n\x1Dworkflow_task_finish_event_id\x18\x04 \x01(\x03\x12\x12\n\nrequest_id\x18\x05 \x01(\t\x12C\n\x12reset_reapply_type\x18\x06 \x01(\x0E2'.temporal.api.enums.v1.ResetReapplyType\"0\n\x1EResetWorkflowExecutionResponse\x12\x0E\n\x06run_id\x18\x01 \x01(\t\"\xF2\x01\n!TerminateWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x0E\n\x06reason\x18\x03 \x01(\t\x121\n\adetails\x18\x04 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x10\n\bidentity\x18\x05 \x01(\t\x12\x1E\n\x16first_execution_run_id\x18\x06 \x01(\t\"$\n\"TerminateWorkflowExecutionResponse\"z\n\x1EDeleteWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\"!\n\x1FDeleteWorkflowExecutionResponse\"\xC9\x02\n!ListOpenWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12B\n\x11start_time_filter\x18\x04 \x01(\v2'.temporal.api.filter.v1.StartTimeFilter\x12K\n\x10execution_filter\x18\x05 \x01(\v2/.temporal.api.filter.v1.WorkflowExecutionFilterH\x00\x12A\n\vtype_filter\x18\x06 \x01(\v2*.temporal.api.filter.v1.WorkflowTypeFilterH\x00B\t\n\afilters\"\x82\x01\n\"ListOpenWorkflowExecutionsResponse\x12C\n\nexecutions\x18\x01 \x03(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"\x8A\x03\n#ListClosedWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12B\n\x11start_time_filter\x18\x04 \x01(\v2'.temporal.api.filter.v1.StartTimeFilter\x12K\n\x10execution_filter\x18\x05 \x01(\v2/.temporal.api.filter.v1.WorkflowExecutionFilterH\x00\x12A\n\vtype_filter\x18\x06 \x01(\v2*.temporal.api.filter.v1.WorkflowTypeFilterH\x00\x12=\n\rstatus_filter\x18\a \x01(\v2$.temporal.api.filter.v1.StatusFilterH\x00B\t\n\afilters\"\x84\x01\n$ListClosedWorkflowExecutionsResponse\x12C\n\nexecutions\x18\x01 \x03(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"m\n\x1DListWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12\r\n\x05query\x18\x04 \x01(\t\"~\n\x1EListWorkflowExecutionsResponse\x12C\n\nexecutions\x18\x01 \x03(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"u\n%ListArchivedWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12\r\n\x05query\x18\x04 \x01(\t\"\x86\x01\n&ListArchivedWorkflowExecutionsResponse\x12C\n\nexecutions\x18\x01 \x03(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"m\n\x1DScanWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\x12\r\n\x05query\x18\x04 \x01(\t\"~\n\x1EScanWorkflowExecutionsResponse\x12C\n\nexecutions\x18\x01 \x03(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"B\n\x1ECountWorkflowExecutionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\r\n\x05query\x18\x02 \x01(\t\"0\n\x1FCountWorkflowExecutionsResponse\x12\r\n\x05count\x18\x01 \x01(\x03\"\x1C\n\x1AGetSearchAttributesRequest\"\xC9\x01\n\eGetSearchAttributesResponse\x12T\n\x04keys\x18\x01 \x03(\v2F.temporal.api.workflowservice.v1.GetSearchAttributesResponse.KeysEntry\x1AT\n\tKeysEntry\x12\v\n\x03key\x18\x01 \x01(\t\x126\n\x05value\x18\x02 \x01(\x0E2'.temporal.api.enums.v1.IndexedValueType:\x028\x01\"\xDE\x01\n RespondQueryTaskCompletedRequest\x12\x12\n\ntask_token\x18\x01 \x01(\f\x12>\n\x0Ecompleted_type\x18\x02 \x01(\x0E2&.temporal.api.enums.v1.QueryResultType\x126\n\fquery_result\x18\x03 \x01(\v2 .temporal.api.common.v1.Payloads\x12\x15\n\rerror_message\x18\x04 \x01(\t\x12\x11\n\tnamespace\x18\x06 \x01(\tJ\x04\b\x05\x10\x06\"#\n!RespondQueryTaskCompletedResponse\"n\n\eResetStickyTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\"\x1E\n\x1CResetStickyTaskQueueResponse\"\xE9\x01\n\x14QueryWorkflowRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x123\n\x05query\x18\x03 \x01(\v2$.temporal.api.query.v1.WorkflowQuery\x12K\n\x16query_reject_condition\x18\x04 \x01(\x0E2+.temporal.api.enums.v1.QueryRejectCondition\"\x8D\x01\n\x15QueryWorkflowResponse\x126\n\fquery_result\x18\x01 \x01(\v2 .temporal.api.common.v1.Payloads\x12<\n\x0Equery_rejected\x18\x02 \x01(\v2$.temporal.api.query.v1.QueryRejected\"s\n DescribeWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12<\n\texecution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\"\xAE\x03\n!DescribeWorkflowExecutionResponse\x12K\n\x10execution_config\x18\x01 \x01(\v21.temporal.api.workflow.v1.WorkflowExecutionConfig\x12P\n\x17workflow_execution_info\x18\x02 \x01(\v2/.temporal.api.workflow.v1.WorkflowExecutionInfo\x12I\n\x12pending_activities\x18\x03 \x03(\v2-.temporal.api.workflow.v1.PendingActivityInfo\x12M\n\x10pending_children\x18\x04 \x03(\v23.temporal.api.workflow.v1.PendingChildExecutionInfo\x12P\n\x15pending_workflow_task\x18\x05 \x01(\v21.temporal.api.workflow.v1.PendingWorkflowTaskInfo\"\xC9\x01\n\x18DescribeTaskQueueRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x128\n\ntask_queue\x18\x02 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\x12=\n\x0Ftask_queue_type\x18\x03 \x01(\x0E2$.temporal.api.enums.v1.TaskQueueType\x12!\n\x19include_task_queue_status\x18\x04 \x01(\b\"\x9A\x01\n\x19DescribeTaskQueueResponse\x126\n\apollers\x18\x01 \x03(\v2%.temporal.api.taskqueue.v1.PollerInfo\x12E\n\x11task_queue_status\x18\x02 \x01(\v2*.temporal.api.taskqueue.v1.TaskQueueStatus\"\x17\n\x15GetClusterInfoRequest\"\x8B\x03\n\x16GetClusterInfoResponse\x12h\n\x11supported_clients\x18\x01 \x03(\v2M.temporal.api.workflowservice.v1.GetClusterInfoResponse.SupportedClientsEntry\x12\x16\n\x0Eserver_version\x18\x02 \x01(\t\x12\x12\n\ncluster_id\x18\x03 \x01(\t\x12:\n\fversion_info\x18\x04 \x01(\v2$.temporal.api.version.v1.VersionInfo\x12\x14\n\fcluster_name\x18\x05 \x01(\t\x12\e\n\x13history_shard_count\x18\x06 \x01(\x05\x12\x19\n\x11persistence_store\x18\a \x01(\t\x12\x18\n\x10visibility_store\x18\b \x01(\t\x1A7\n\x15SupportedClientsEntry\x12\v\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x028\x01\"\x16\n\x14GetSystemInfoRequest\"\xBC\x03\n\x15GetSystemInfoResponse\x12\x16\n\x0Eserver_version\x18\x01 \x01(\t\x12Y\n\fcapabilities\x18\x02 \x01(\v2C.temporal.api.workflowservice.v1.GetSystemInfoResponse.Capabilities\x1A\xAF\x02\n\fCapabilities\x12\x1F\n\x17signal_and_query_header\x18\x01 \x01(\b\x12&\n\x1Einternal_error_differentiation\x18\x02 \x01(\b\x12*\n\"activity_failure_include_heartbeat\x18\x03 \x01(\b\x12\x1A\n\x12supports_schedules\x18\x04 \x01(\b\x12\"\n\x1Aencoded_failure_attributes\x18\x05 \x01(\b\x12!\n\x19build_id_based_versioning\x18\x06 \x01(\b\x12\x13\n\vupsert_memo\x18\a \x01(\b\x12\x1C\n\x14eager_workflow_start\x18\b \x01(\b\x12\x14\n\fsdk_metadata\x18\t \x01(\b\"m\n\x1EListTaskQueuePartitionsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x128\n\ntask_queue\x18\x02 \x01(\v2$.temporal.api.taskqueue.v1.TaskQueue\"\xDF\x01\n\x1FListTaskQueuePartitionsResponse\x12]\n\x1Eactivity_task_queue_partitions\x18\x01 \x03(\v25.temporal.api.taskqueue.v1.TaskQueuePartitionMetadata\x12]\n\x1Eworkflow_task_queue_partitions\x18\x02 \x03(\v25.temporal.api.taskqueue.v1.TaskQueuePartitionMetadata\"\xCC\x02\n\x15CreateScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\x124\n\bschedule\x18\x03 \x01(\v2\".temporal.api.schedule.v1.Schedule\x12>\n\rinitial_patch\x18\x04 \x01(\v2'.temporal.api.schedule.v1.SchedulePatch\x12\x10\n\bidentity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\x12*\n\x04memo\x18\a \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\b \x01(\v2(.temporal.api.common.v1.SearchAttributes\"0\n\x16CreateScheduleResponse\x12\x16\n\x0Econflict_token\x18\x01 \x01(\f\"A\n\x17DescribeScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\"\x8F\x02\n\x18DescribeScheduleResponse\x124\n\bschedule\x18\x01 \x01(\v2\".temporal.api.schedule.v1.Schedule\x124\n\x04info\x18\x02 \x01(\v2&.temporal.api.schedule.v1.ScheduleInfo\x12*\n\x04memo\x18\x03 \x01(\v2\x1C.temporal.api.common.v1.Memo\x12C\n\x11search_attributes\x18\x04 \x01(\v2(.temporal.api.common.v1.SearchAttributes\x12\x16\n\x0Econflict_token\x18\x05 \x01(\f\"\xB3\x01\n\x15UpdateScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\x124\n\bschedule\x18\x03 \x01(\v2\".temporal.api.schedule.v1.Schedule\x12\x16\n\x0Econflict_token\x18\x04 \x01(\f\x12\x10\n\bidentity\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x06 \x01(\t\"\x18\n\x16UpdateScheduleResponse\"\x9C\x01\n\x14PatchScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\x126\n\x05patch\x18\x03 \x01(\v2'.temporal.api.schedule.v1.SchedulePatch\x12\x10\n\bidentity\x18\x04 \x01(\t\x12\x12\n\nrequest_id\x18\x05 \x01(\t\"\x17\n\x15PatchScheduleResponse\"\xB4\x01\n ListScheduleMatchingTimesRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\x124\n\nstart_time\x18\x03 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x122\n\bend_time\x18\x04 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\"Y\n!ListScheduleMatchingTimesResponse\x124\n\nstart_time\x18\x01 \x03(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\"Q\n\x15DeleteScheduleRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\vschedule_id\x18\x02 \x01(\t\x12\x10\n\bidentity\x18\x03 \x01(\t\"\x18\n\x16DeleteScheduleResponse\"]\n\x14ListSchedulesRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x19\n\x11maximum_page_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\"p\n\x15ListSchedulesResponse\x12>\n\tschedules\x18\x01 \x03(\v2+.temporal.api.schedule.v1.ScheduleListEntry\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"\xD1\x03\n'UpdateWorkerBuildIdCompatibilityRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12-\n#add_new_build_id_in_new_default_set\x18\x03 \x01(\tH\x00\x12\x87\x01\n\eadd_new_compatible_build_id\x18\x04 \x01(\v2`.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.AddNewCompatibleVersionH\x00\x12!\n\x17promote_set_by_build_id\x18\x05 \x01(\tH\x00\x12%\n\epromote_build_id_within_set\x18\x06 \x01(\tH\x00\x1Ao\n\x17AddNewCompatibleVersion\x12\x14\n\fnew_build_id\x18\x01 \x01(\t\x12$\n\x1Cexisting_compatible_build_id\x18\x02 \x01(\t\x12\x18\n\x10make_set_default\x18\x03 \x01(\bB\v\n\toperation\"B\n(UpdateWorkerBuildIdCompatibilityResponse\x12\x16\n\x0Eversion_set_id\x18\x01 \x01(\t\"\xAC\x01\n$GetWorkerBuildIdCompatibilityRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x12\n\ntask_queue\x18\x02 \x01(\t\x12\x10\n\bmax_sets\x18\x03 \x01(\x05\x12%\n\x1Dinclude_retirement_candidates\x18\x04 \x01(\b\x12$\n\x1Cinclude_poller_compatibility\x18\x05 \x01(\b\"\xF8\x04\n%GetWorkerBuildIdCompatibilityResponse\x12K\n\x12major_version_sets\x18\x01 \x03(\v2/.temporal.api.taskqueue.v1.CompatibleVersionSet\x12y\n\x15retirement_candidates\x18\x02 \x03(\v2Z.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse.RetirementCandidate\x12\x89\x01\n\eactive_versions_and_pollers\x18\x03 \x03(\v2d.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse.VersionsWithCompatiblePollers\x1A\x83\x01\n\x13RetirementCandidate\x12\x10\n\bbuild_id\x18\x01 \x01(\t\x12\"\n\x1Aall_workflows_are_archived\x18\x02 \x01(\b\x126\n\apollers\x18\x03 \x03(\v2%.temporal.api.taskqueue.v1.PollerInfo\x1Au\n\x1DVersionsWithCompatiblePollers\x12\x1C\n\x14most_recent_build_id\x18\x01 \x01(\t\x126\n\apollers\x18\x02 \x03(\v2%.temporal.api.taskqueue.v1.PollerInfo\"\x85\x02\n\x1EUpdateWorkflowExecutionRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12E\n\x12workflow_execution\x18\x02 \x01(\v2).temporal.api.common.v1.WorkflowExecution\x12\x1E\n\x16first_execution_run_id\x18\x03 \x01(\t\x127\n\vwait_policy\x18\x04 \x01(\v2\".temporal.api.update.v1.WaitPolicy\x120\n\arequest\x18\x05 \x01(\v2\x1F.temporal.api.update.v1.Request\"\xD7\x01\n\x1FUpdateWorkflowExecutionResponse\x125\n\nupdate_ref\x18\x01 \x01(\v2!.temporal.api.update.v1.UpdateRef\x120\n\aoutcome\x18\x02 \x01(\v2\x1F.temporal.api.update.v1.Outcome\x12K\n\x05stage\x18\x03 \x01(\x0E2<.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage\"\xF3\x03\n\x1AStartBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x18\n\x10visibility_query\x18\x02 \x01(\t\x12\x0E\n\x06job_id\x18\x03 \x01(\t\x12\x0E\n\x06reason\x18\x04 \x01(\t\x12=\n\nexecutions\x18\x05 \x03(\v2).temporal.api.common.v1.WorkflowExecution\x12Q\n\x15termination_operation\x18\n \x01(\v20.temporal.api.batch.v1.BatchOperationTerminationH\x00\x12G\n\x10signal_operation\x18\v \x01(\v2+.temporal.api.batch.v1.BatchOperationSignalH\x00\x12S\n\x16cancellation_operation\x18\f \x01(\v21.temporal.api.batch.v1.BatchOperationCancellationH\x00\x12K\n\x12deletion_operation\x18\r \x01(\v2-.temporal.api.batch.v1.BatchOperationDeletionH\x00B\v\n\toperation\"\x1D\n\eStartBatchOperationResponse\"`\n\x19StopBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0E\n\x06job_id\x18\x02 \x01(\t\x12\x0E\n\x06reason\x18\x03 \x01(\t\x12\x10\n\bidentity\x18\x04 \x01(\t\"\x1C\n\x1AStopBatchOperationResponse\"B\n\x1DDescribeBatchOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0E\n\x06job_id\x18\x02 \x01(\t\"\x9E\x03\n\x1EDescribeBatchOperationResponse\x12A\n\x0Eoperation_type\x18\x01 \x01(\x0E2).temporal.api.enums.v1.BatchOperationType\x12\x0E\n\x06job_id\x18\x02 \x01(\t\x129\n\x05state\x18\x03 \x01(\x0E2*.temporal.api.enums.v1.BatchOperationState\x124\n\nstart_time\x18\x04 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x124\n\nclose_time\x18\x05 \x01(\v2\x1A.google.protobuf.TimestampB\x04\x90\xDF\x1F\x01\x12\x1D\n\x15total_operation_count\x18\x06 \x01(\x03\x12 \n\x18complete_operation_count\x18\a \x01(\x03\x12\x1F\n\x17failure_operation_count\x18\b \x01(\x03\x12\x10\n\bidentity\x18\t \x01(\t\x12\x0E\n\x06reason\x18\n \x01(\t\"[\n\x1AListBatchOperationsRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0Fnext_page_token\x18\x03 \x01(\f\"y\n\eListBatchOperationsResponse\x12A\n\x0Eoperation_info\x18\x01 \x03(\v2).temporal.api.batch.v1.BatchOperationInfo\x12\x17\n\x0Fnext_page_token\x18\x02 \x01(\f\"\xB9\x01\n\"PollWorkflowExecutionUpdateRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x125\n\nupdate_ref\x18\x02 \x01(\v2!.temporal.api.update.v1.UpdateRef\x12\x10\n\bidentity\x18\x03 \x01(\t\x127\n\vwait_policy\x18\x04 \x01(\v2\".temporal.api.update.v1.WaitPolicy\"\xDB\x01\n#PollWorkflowExecutionUpdateResponse\x120\n\aoutcome\x18\x01 \x01(\v2\x1F.temporal.api.update.v1.Outcome\x12K\n\x05stage\x18\x02 \x01(\x0E2<.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage\x125\n\nupdate_ref\x18\x03 \x01(\v2!.temporal.api.update.v1.UpdateRef\"\xDF\x02\n\x1CExecuteMultiOperationRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12[\n\noperations\x18\x02 \x03(\v2G.temporal.api.workflowservice.v1.ExecuteMultiOperationRequest.Operation\x1A\xCE\x01\n\tOperation\x12X\n\x0Estart_workflow\x18\x01 \x01(\v2>.temporal.api.workflowservice.v1.StartWorkflowExecutionRequestH\x00\x12Z\n\x0Fupdate_workflow\x18\x02 \x01(\v2?.temporal.api.workflowservice.v1.UpdateWorkflowExecutionRequestH\x00B\v\n\toperation\"\xCC\x02\n\x1DExecuteMultiOperationResponse\x12Z\n\tresponses\x18\x01 \x03(\v2G.temporal.api.workflowservice.v1.ExecuteMultiOperationResponse.Response\x1A\xCE\x01\n\bResponse\x12Y\n\x0Estart_workflow\x18\x01 \x01(\v2?.temporal.api.workflowservice.v1.StartWorkflowExecutionResponseH\x00\x12[\n\x0Fupdate_workflow\x18\x02 \x01(\v2@.temporal.api.workflowservice.v1.UpdateWorkflowExecutionResponseH\x00B\n\n\bresponseB\xBE\x01\n\"io.temporal.api.workflowservice.v1B\x14RequestResponseProtoP\x01Z5go.temporal.io/api/workflowservice/v1;workflowservice\xAA\x02!Temporalio.Api.WorkflowService.V1\xEA\x02$Temporalio::Api::WorkflowService::V1b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -42,6 +42,10 @@ module Temporalio module Api module WorkflowService module V1 + ExecuteMultiOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.ExecuteMultiOperationResponse").msgclass + ExecuteMultiOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.ExecuteMultiOperationRequest").msgclass + ExecuteMultiOperationResponse::Response = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.ExecuteMultiOperationResponse.Response").msgclass + ExecuteMultiOperationRequest::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.ExecuteMultiOperationRequest.Operation").msgclass RegisterNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.RegisterNamespaceRequest").msgclass RegisterNamespaceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.RegisterNamespaceResponse").msgclass ListNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("temporal.api.workflowservice.v1.ListNamespacesRequest").msgclass diff --git a/lib/gen/temporal/api/workflowservice/v1/service_pb.rb b/lib/gen/temporal/api/workflowservice/v1/service_pb.rb index b86a2a877..6626704cc 100644 --- a/lib/gen/temporal/api/workflowservice/v1/service_pb.rb +++ b/lib/gen/temporal/api/workflowservice/v1/service_pb.rb @@ -7,7 +7,7 @@ require 'temporal/api/workflowservice/v1/request_response_pb' -descriptor_data = "\n-temporal/api/workflowservice/v1/service.proto\x12\x1ftemporal.api.workflowservice.v1\x1a\x36temporal/api/workflowservice/v1/request_response.proto2\xfe\x45\n\x0fWorkflowService\x12\x8c\x01\n\x11RegisterNamespace\x12\x39.temporal.api.workflowservice.v1.RegisterNamespaceRequest\x1a:.temporal.api.workflowservice.v1.RegisterNamespaceResponse\"\x00\x12\x8c\x01\n\x11\x44\x65scribeNamespace\x12\x39.temporal.api.workflowservice.v1.DescribeNamespaceRequest\x1a:.temporal.api.workflowservice.v1.DescribeNamespaceResponse\"\x00\x12\x83\x01\n\x0eListNamespaces\x12\x36.temporal.api.workflowservice.v1.ListNamespacesRequest\x1a\x37.temporal.api.workflowservice.v1.ListNamespacesResponse\"\x00\x12\x86\x01\n\x0fUpdateNamespace\x12\x37.temporal.api.workflowservice.v1.UpdateNamespaceRequest\x1a\x38.temporal.api.workflowservice.v1.UpdateNamespaceResponse\"\x00\x12\x8f\x01\n\x12\x44\x65precateNamespace\x12:.temporal.api.workflowservice.v1.DeprecateNamespaceRequest\x1a;.temporal.api.workflowservice.v1.DeprecateNamespaceResponse\"\x00\x12\x9b\x01\n\x16StartWorkflowExecution\x12>.temporal.api.workflowservice.v1.StartWorkflowExecutionRequest\x1a?.temporal.api.workflowservice.v1.StartWorkflowExecutionResponse\"\x00\x12\xaa\x01\n\x1bGetWorkflowExecutionHistory\x12\x43.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryRequest\x1a\x44.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse\"\x00\x12\xbf\x01\n\"GetWorkflowExecutionHistoryReverse\x12J.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseRequest\x1aK.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseResponse\"\x00\x12\x98\x01\n\x15PollWorkflowTaskQueue\x12=.temporal.api.workflowservice.v1.PollWorkflowTaskQueueRequest\x1a>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\"\x00\x12\xad\x01\n\x1cRespondWorkflowTaskCompleted\x12\x44.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest\x1a\x45.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedResponse\"\x00\x12\xa4\x01\n\x19RespondWorkflowTaskFailed\x12\x41.temporal.api.workflowservice.v1.RespondWorkflowTaskFailedRequest\x1a\x42.temporal.api.workflowservice.v1.RespondWorkflowTaskFailedResponse\"\x00\x12\x98\x01\n\x15PollActivityTaskQueue\x12=.temporal.api.workflowservice.v1.PollActivityTaskQueueRequest\x1a>.temporal.api.workflowservice.v1.PollActivityTaskQueueResponse\"\x00\x12\xaa\x01\n\x1bRecordActivityTaskHeartbeat\x12\x43.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatRequest\x1a\x44.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatResponse\"\x00\x12\xb6\x01\n\x1fRecordActivityTaskHeartbeatById\x12G.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdRequest\x1aH.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdResponse\"\x00\x12\xad\x01\n\x1cRespondActivityTaskCompleted\x12\x44.temporal.api.workflowservice.v1.RespondActivityTaskCompletedRequest\x1a\x45.temporal.api.workflowservice.v1.RespondActivityTaskCompletedResponse\"\x00\x12\xb9\x01\n RespondActivityTaskCompletedById\x12H.temporal.api.workflowservice.v1.RespondActivityTaskCompletedByIdRequest\x1aI.temporal.api.workflowservice.v1.RespondActivityTaskCompletedByIdResponse\"\x00\x12\xa4\x01\n\x19RespondActivityTaskFailed\x12\x41.temporal.api.workflowservice.v1.RespondActivityTaskFailedRequest\x1a\x42.temporal.api.workflowservice.v1.RespondActivityTaskFailedResponse\"\x00\x12\xb0\x01\n\x1dRespondActivityTaskFailedById\x12\x45.temporal.api.workflowservice.v1.RespondActivityTaskFailedByIdRequest\x1a\x46.temporal.api.workflowservice.v1.RespondActivityTaskFailedByIdResponse\"\x00\x12\xaa\x01\n\x1bRespondActivityTaskCanceled\x12\x43.temporal.api.workflowservice.v1.RespondActivityTaskCanceledRequest\x1a\x44.temporal.api.workflowservice.v1.RespondActivityTaskCanceledResponse\"\x00\x12\xb6\x01\n\x1fRespondActivityTaskCanceledById\x12G.temporal.api.workflowservice.v1.RespondActivityTaskCanceledByIdRequest\x1aH.temporal.api.workflowservice.v1.RespondActivityTaskCanceledByIdResponse\"\x00\x12\xb3\x01\n\x1eRequestCancelWorkflowExecution\x12\x46.temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionRequest\x1aG.temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse\"\x00\x12\x9e\x01\n\x17SignalWorkflowExecution\x12?.temporal.api.workflowservice.v1.SignalWorkflowExecutionRequest\x1a@.temporal.api.workflowservice.v1.SignalWorkflowExecutionResponse\"\x00\x12\xb9\x01\n SignalWithStartWorkflowExecution\x12H.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest\x1aI.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse\"\x00\x12\x9b\x01\n\x16ResetWorkflowExecution\x12>.temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest\x1a?.temporal.api.workflowservice.v1.ResetWorkflowExecutionResponse\"\x00\x12\xa7\x01\n\x1aTerminateWorkflowExecution\x12\x42.temporal.api.workflowservice.v1.TerminateWorkflowExecutionRequest\x1a\x43.temporal.api.workflowservice.v1.TerminateWorkflowExecutionResponse\"\x00\x12\x9e\x01\n\x17\x44\x65leteWorkflowExecution\x12?.temporal.api.workflowservice.v1.DeleteWorkflowExecutionRequest\x1a@.temporal.api.workflowservice.v1.DeleteWorkflowExecutionResponse\"\x00\x12\xa7\x01\n\x1aListOpenWorkflowExecutions\x12\x42.temporal.api.workflowservice.v1.ListOpenWorkflowExecutionsRequest\x1a\x43.temporal.api.workflowservice.v1.ListOpenWorkflowExecutionsResponse\"\x00\x12\xad\x01\n\x1cListClosedWorkflowExecutions\x12\x44.temporal.api.workflowservice.v1.ListClosedWorkflowExecutionsRequest\x1a\x45.temporal.api.workflowservice.v1.ListClosedWorkflowExecutionsResponse\"\x00\x12\x9b\x01\n\x16ListWorkflowExecutions\x12>.temporal.api.workflowservice.v1.ListWorkflowExecutionsRequest\x1a?.temporal.api.workflowservice.v1.ListWorkflowExecutionsResponse\"\x00\x12\xb3\x01\n\x1eListArchivedWorkflowExecutions\x12\x46.temporal.api.workflowservice.v1.ListArchivedWorkflowExecutionsRequest\x1aG.temporal.api.workflowservice.v1.ListArchivedWorkflowExecutionsResponse\"\x00\x12\x9b\x01\n\x16ScanWorkflowExecutions\x12>.temporal.api.workflowservice.v1.ScanWorkflowExecutionsRequest\x1a?.temporal.api.workflowservice.v1.ScanWorkflowExecutionsResponse\"\x00\x12\x9e\x01\n\x17\x43ountWorkflowExecutions\x12?.temporal.api.workflowservice.v1.CountWorkflowExecutionsRequest\x1a@.temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse\"\x00\x12\x92\x01\n\x13GetSearchAttributes\x12;.temporal.api.workflowservice.v1.GetSearchAttributesRequest\x1a<.temporal.api.workflowservice.v1.GetSearchAttributesResponse\"\x00\x12\xa4\x01\n\x19RespondQueryTaskCompleted\x12\x41.temporal.api.workflowservice.v1.RespondQueryTaskCompletedRequest\x1a\x42.temporal.api.workflowservice.v1.RespondQueryTaskCompletedResponse\"\x00\x12\x95\x01\n\x14ResetStickyTaskQueue\x12<.temporal.api.workflowservice.v1.ResetStickyTaskQueueRequest\x1a=.temporal.api.workflowservice.v1.ResetStickyTaskQueueResponse\"\x00\x12\x80\x01\n\rQueryWorkflow\x12\x35.temporal.api.workflowservice.v1.QueryWorkflowRequest\x1a\x36.temporal.api.workflowservice.v1.QueryWorkflowResponse\"\x00\x12\xa4\x01\n\x19\x44\x65scribeWorkflowExecution\x12\x41.temporal.api.workflowservice.v1.DescribeWorkflowExecutionRequest\x1a\x42.temporal.api.workflowservice.v1.DescribeWorkflowExecutionResponse\"\x00\x12\x8c\x01\n\x11\x44\x65scribeTaskQueue\x12\x39.temporal.api.workflowservice.v1.DescribeTaskQueueRequest\x1a:.temporal.api.workflowservice.v1.DescribeTaskQueueResponse\"\x00\x12\x83\x01\n\x0eGetClusterInfo\x12\x36.temporal.api.workflowservice.v1.GetClusterInfoRequest\x1a\x37.temporal.api.workflowservice.v1.GetClusterInfoResponse\"\x00\x12\x80\x01\n\rGetSystemInfo\x12\x35.temporal.api.workflowservice.v1.GetSystemInfoRequest\x1a\x36.temporal.api.workflowservice.v1.GetSystemInfoResponse\"\x00\x12\x9e\x01\n\x17ListTaskQueuePartitions\x12?.temporal.api.workflowservice.v1.ListTaskQueuePartitionsRequest\x1a@.temporal.api.workflowservice.v1.ListTaskQueuePartitionsResponse\"\x00\x12\x83\x01\n\x0e\x43reateSchedule\x12\x36.temporal.api.workflowservice.v1.CreateScheduleRequest\x1a\x37.temporal.api.workflowservice.v1.CreateScheduleResponse\"\x00\x12\x89\x01\n\x10\x44\x65scribeSchedule\x12\x38.temporal.api.workflowservice.v1.DescribeScheduleRequest\x1a\x39.temporal.api.workflowservice.v1.DescribeScheduleResponse\"\x00\x12\x83\x01\n\x0eUpdateSchedule\x12\x36.temporal.api.workflowservice.v1.UpdateScheduleRequest\x1a\x37.temporal.api.workflowservice.v1.UpdateScheduleResponse\"\x00\x12\x80\x01\n\rPatchSchedule\x12\x35.temporal.api.workflowservice.v1.PatchScheduleRequest\x1a\x36.temporal.api.workflowservice.v1.PatchScheduleResponse\"\x00\x12\xa4\x01\n\x19ListScheduleMatchingTimes\x12\x41.temporal.api.workflowservice.v1.ListScheduleMatchingTimesRequest\x1a\x42.temporal.api.workflowservice.v1.ListScheduleMatchingTimesResponse\"\x00\x12\x83\x01\n\x0e\x44\x65leteSchedule\x12\x36.temporal.api.workflowservice.v1.DeleteScheduleRequest\x1a\x37.temporal.api.workflowservice.v1.DeleteScheduleResponse\"\x00\x12\x80\x01\n\rListSchedules\x12\x35.temporal.api.workflowservice.v1.ListSchedulesRequest\x1a\x36.temporal.api.workflowservice.v1.ListSchedulesResponse\"\x00\x12\xb9\x01\n UpdateWorkerBuildIdCompatibility\x12H.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest\x1aI.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityResponse\"\x00\x12\xb0\x01\n\x1dGetWorkerBuildIdCompatibility\x12\x45.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityRequest\x1a\x46.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse\"\x00\x12\x9e\x01\n\x17UpdateWorkflowExecution\x12?.temporal.api.workflowservice.v1.UpdateWorkflowExecutionRequest\x1a@.temporal.api.workflowservice.v1.UpdateWorkflowExecutionResponse\"\x00\x12\xaa\x01\n\x1bPollWorkflowExecutionUpdate\x12\x43.temporal.api.workflowservice.v1.PollWorkflowExecutionUpdateRequest\x1a\x44.temporal.api.workflowservice.v1.PollWorkflowExecutionUpdateResponse\"\x00\x12\x92\x01\n\x13StartBatchOperation\x12;.temporal.api.workflowservice.v1.StartBatchOperationRequest\x1a<.temporal.api.workflowservice.v1.StartBatchOperationResponse\"\x00\x12\x8f\x01\n\x12StopBatchOperation\x12:.temporal.api.workflowservice.v1.StopBatchOperationRequest\x1a;.temporal.api.workflowservice.v1.StopBatchOperationResponse\"\x00\x12\x9b\x01\n\x16\x44\x65scribeBatchOperation\x12>.temporal.api.workflowservice.v1.DescribeBatchOperationRequest\x1a?.temporal.api.workflowservice.v1.DescribeBatchOperationResponse\"\x00\x12\x92\x01\n\x13ListBatchOperations\x12;.temporal.api.workflowservice.v1.ListBatchOperationsRequest\x1a<.temporal.api.workflowservice.v1.ListBatchOperationsResponse\"\x00\x42\xb6\x01\n\"io.temporal.api.workflowservice.v1B\x0cServiceProtoP\x01Z5go.temporal.io/api/workflowservice/v1;workflowservice\xaa\x02!Temporalio.Api.WorkflowService.V1\xea\x02$Temporalio::Api::WorkflowService::V1b\x06proto3" +descriptor_data = "\n-temporal/api/workflowservice/v1/service.proto\x12\x1Ftemporal.api.workflowservice.v1\x1A6temporal/api/workflowservice/v1/request_response.proto2\x97G\n\x0FWorkflowService\x12\x8C\x01\n\x11RegisterNamespace\x129.temporal.api.workflowservice.v1.RegisterNamespaceRequest\x1A:.temporal.api.workflowservice.v1.RegisterNamespaceResponse\"\x00\x12\x8C\x01\n\x11DescribeNamespace\x129.temporal.api.workflowservice.v1.DescribeNamespaceRequest\x1A:.temporal.api.workflowservice.v1.DescribeNamespaceResponse\"\x00\x12\x83\x01\n\x0EListNamespaces\x126.temporal.api.workflowservice.v1.ListNamespacesRequest\x1A7.temporal.api.workflowservice.v1.ListNamespacesResponse\"\x00\x12\x86\x01\n\x0FUpdateNamespace\x127.temporal.api.workflowservice.v1.UpdateNamespaceRequest\x1A8.temporal.api.workflowservice.v1.UpdateNamespaceResponse\"\x00\x12\x8F\x01\n\x12DeprecateNamespace\x12:.temporal.api.workflowservice.v1.DeprecateNamespaceRequest\x1A;.temporal.api.workflowservice.v1.DeprecateNamespaceResponse\"\x00\x12\x9B\x01\n\x16StartWorkflowExecution\x12>.temporal.api.workflowservice.v1.StartWorkflowExecutionRequest\x1A?.temporal.api.workflowservice.v1.StartWorkflowExecutionResponse\"\x00\x12\xAA\x01\n\eGetWorkflowExecutionHistory\x12C.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryRequest\x1AD.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryResponse\"\x00\x12\xBF\x01\n\"GetWorkflowExecutionHistoryReverse\x12J.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseRequest\x1AK.temporal.api.workflowservice.v1.GetWorkflowExecutionHistoryReverseResponse\"\x00\x12\x98\x01\n\x15PollWorkflowTaskQueue\x12=.temporal.api.workflowservice.v1.PollWorkflowTaskQueueRequest\x1A>.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse\"\x00\x12\xAD\x01\n\x1CRespondWorkflowTaskCompleted\x12D.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedRequest\x1AE.temporal.api.workflowservice.v1.RespondWorkflowTaskCompletedResponse\"\x00\x12\xA4\x01\n\x19RespondWorkflowTaskFailed\x12A.temporal.api.workflowservice.v1.RespondWorkflowTaskFailedRequest\x1AB.temporal.api.workflowservice.v1.RespondWorkflowTaskFailedResponse\"\x00\x12\x98\x01\n\x15PollActivityTaskQueue\x12=.temporal.api.workflowservice.v1.PollActivityTaskQueueRequest\x1A>.temporal.api.workflowservice.v1.PollActivityTaskQueueResponse\"\x00\x12\xAA\x01\n\eRecordActivityTaskHeartbeat\x12C.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatRequest\x1AD.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatResponse\"\x00\x12\xB6\x01\n\x1FRecordActivityTaskHeartbeatById\x12G.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdRequest\x1AH.temporal.api.workflowservice.v1.RecordActivityTaskHeartbeatByIdResponse\"\x00\x12\xAD\x01\n\x1CRespondActivityTaskCompleted\x12D.temporal.api.workflowservice.v1.RespondActivityTaskCompletedRequest\x1AE.temporal.api.workflowservice.v1.RespondActivityTaskCompletedResponse\"\x00\x12\xB9\x01\n RespondActivityTaskCompletedById\x12H.temporal.api.workflowservice.v1.RespondActivityTaskCompletedByIdRequest\x1AI.temporal.api.workflowservice.v1.RespondActivityTaskCompletedByIdResponse\"\x00\x12\xA4\x01\n\x19RespondActivityTaskFailed\x12A.temporal.api.workflowservice.v1.RespondActivityTaskFailedRequest\x1AB.temporal.api.workflowservice.v1.RespondActivityTaskFailedResponse\"\x00\x12\xB0\x01\n\x1DRespondActivityTaskFailedById\x12E.temporal.api.workflowservice.v1.RespondActivityTaskFailedByIdRequest\x1AF.temporal.api.workflowservice.v1.RespondActivityTaskFailedByIdResponse\"\x00\x12\xAA\x01\n\eRespondActivityTaskCanceled\x12C.temporal.api.workflowservice.v1.RespondActivityTaskCanceledRequest\x1AD.temporal.api.workflowservice.v1.RespondActivityTaskCanceledResponse\"\x00\x12\xB6\x01\n\x1FRespondActivityTaskCanceledById\x12G.temporal.api.workflowservice.v1.RespondActivityTaskCanceledByIdRequest\x1AH.temporal.api.workflowservice.v1.RespondActivityTaskCanceledByIdResponse\"\x00\x12\xB3\x01\n\x1ERequestCancelWorkflowExecution\x12F.temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionRequest\x1AG.temporal.api.workflowservice.v1.RequestCancelWorkflowExecutionResponse\"\x00\x12\x9E\x01\n\x17SignalWorkflowExecution\x12?.temporal.api.workflowservice.v1.SignalWorkflowExecutionRequest\x1A@.temporal.api.workflowservice.v1.SignalWorkflowExecutionResponse\"\x00\x12\xB9\x01\n SignalWithStartWorkflowExecution\x12H.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest\x1AI.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse\"\x00\x12\x9B\x01\n\x16ResetWorkflowExecution\x12>.temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest\x1A?.temporal.api.workflowservice.v1.ResetWorkflowExecutionResponse\"\x00\x12\xA7\x01\n\x1ATerminateWorkflowExecution\x12B.temporal.api.workflowservice.v1.TerminateWorkflowExecutionRequest\x1AC.temporal.api.workflowservice.v1.TerminateWorkflowExecutionResponse\"\x00\x12\x9E\x01\n\x17DeleteWorkflowExecution\x12?.temporal.api.workflowservice.v1.DeleteWorkflowExecutionRequest\x1A@.temporal.api.workflowservice.v1.DeleteWorkflowExecutionResponse\"\x00\x12\xA7\x01\n\x1AListOpenWorkflowExecutions\x12B.temporal.api.workflowservice.v1.ListOpenWorkflowExecutionsRequest\x1AC.temporal.api.workflowservice.v1.ListOpenWorkflowExecutionsResponse\"\x00\x12\xAD\x01\n\x1CListClosedWorkflowExecutions\x12D.temporal.api.workflowservice.v1.ListClosedWorkflowExecutionsRequest\x1AE.temporal.api.workflowservice.v1.ListClosedWorkflowExecutionsResponse\"\x00\x12\x9B\x01\n\x16ListWorkflowExecutions\x12>.temporal.api.workflowservice.v1.ListWorkflowExecutionsRequest\x1A?.temporal.api.workflowservice.v1.ListWorkflowExecutionsResponse\"\x00\x12\xB3\x01\n\x1EListArchivedWorkflowExecutions\x12F.temporal.api.workflowservice.v1.ListArchivedWorkflowExecutionsRequest\x1AG.temporal.api.workflowservice.v1.ListArchivedWorkflowExecutionsResponse\"\x00\x12\x9B\x01\n\x16ScanWorkflowExecutions\x12>.temporal.api.workflowservice.v1.ScanWorkflowExecutionsRequest\x1A?.temporal.api.workflowservice.v1.ScanWorkflowExecutionsResponse\"\x00\x12\x9E\x01\n\x17CountWorkflowExecutions\x12?.temporal.api.workflowservice.v1.CountWorkflowExecutionsRequest\x1A@.temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse\"\x00\x12\x92\x01\n\x13GetSearchAttributes\x12;.temporal.api.workflowservice.v1.GetSearchAttributesRequest\x1A<.temporal.api.workflowservice.v1.GetSearchAttributesResponse\"\x00\x12\xA4\x01\n\x19RespondQueryTaskCompleted\x12A.temporal.api.workflowservice.v1.RespondQueryTaskCompletedRequest\x1AB.temporal.api.workflowservice.v1.RespondQueryTaskCompletedResponse\"\x00\x12\x95\x01\n\x14ResetStickyTaskQueue\x12<.temporal.api.workflowservice.v1.ResetStickyTaskQueueRequest\x1A=.temporal.api.workflowservice.v1.ResetStickyTaskQueueResponse\"\x00\x12\x80\x01\n\rQueryWorkflow\x125.temporal.api.workflowservice.v1.QueryWorkflowRequest\x1A6.temporal.api.workflowservice.v1.QueryWorkflowResponse\"\x00\x12\xA4\x01\n\x19DescribeWorkflowExecution\x12A.temporal.api.workflowservice.v1.DescribeWorkflowExecutionRequest\x1AB.temporal.api.workflowservice.v1.DescribeWorkflowExecutionResponse\"\x00\x12\x8C\x01\n\x11DescribeTaskQueue\x129.temporal.api.workflowservice.v1.DescribeTaskQueueRequest\x1A:.temporal.api.workflowservice.v1.DescribeTaskQueueResponse\"\x00\x12\x83\x01\n\x0EGetClusterInfo\x126.temporal.api.workflowservice.v1.GetClusterInfoRequest\x1A7.temporal.api.workflowservice.v1.GetClusterInfoResponse\"\x00\x12\x80\x01\n\rGetSystemInfo\x125.temporal.api.workflowservice.v1.GetSystemInfoRequest\x1A6.temporal.api.workflowservice.v1.GetSystemInfoResponse\"\x00\x12\x9E\x01\n\x17ListTaskQueuePartitions\x12?.temporal.api.workflowservice.v1.ListTaskQueuePartitionsRequest\x1A@.temporal.api.workflowservice.v1.ListTaskQueuePartitionsResponse\"\x00\x12\x83\x01\n\x0ECreateSchedule\x126.temporal.api.workflowservice.v1.CreateScheduleRequest\x1A7.temporal.api.workflowservice.v1.CreateScheduleResponse\"\x00\x12\x89\x01\n\x10DescribeSchedule\x128.temporal.api.workflowservice.v1.DescribeScheduleRequest\x1A9.temporal.api.workflowservice.v1.DescribeScheduleResponse\"\x00\x12\x83\x01\n\x0EUpdateSchedule\x126.temporal.api.workflowservice.v1.UpdateScheduleRequest\x1A7.temporal.api.workflowservice.v1.UpdateScheduleResponse\"\x00\x12\x80\x01\n\rPatchSchedule\x125.temporal.api.workflowservice.v1.PatchScheduleRequest\x1A6.temporal.api.workflowservice.v1.PatchScheduleResponse\"\x00\x12\xA4\x01\n\x19ListScheduleMatchingTimes\x12A.temporal.api.workflowservice.v1.ListScheduleMatchingTimesRequest\x1AB.temporal.api.workflowservice.v1.ListScheduleMatchingTimesResponse\"\x00\x12\x83\x01\n\x0EDeleteSchedule\x126.temporal.api.workflowservice.v1.DeleteScheduleRequest\x1A7.temporal.api.workflowservice.v1.DeleteScheduleResponse\"\x00\x12\x80\x01\n\rListSchedules\x125.temporal.api.workflowservice.v1.ListSchedulesRequest\x1A6.temporal.api.workflowservice.v1.ListSchedulesResponse\"\x00\x12\xB9\x01\n UpdateWorkerBuildIdCompatibility\x12H.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest\x1AI.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityResponse\"\x00\x12\xB0\x01\n\x1DGetWorkerBuildIdCompatibility\x12E.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityRequest\x1AF.temporal.api.workflowservice.v1.GetWorkerBuildIdCompatibilityResponse\"\x00\x12\x9E\x01\n\x17UpdateWorkflowExecution\x12?.temporal.api.workflowservice.v1.UpdateWorkflowExecutionRequest\x1A@.temporal.api.workflowservice.v1.UpdateWorkflowExecutionResponse\"\x00\x12\xAA\x01\n\ePollWorkflowExecutionUpdate\x12C.temporal.api.workflowservice.v1.PollWorkflowExecutionUpdateRequest\x1AD.temporal.api.workflowservice.v1.PollWorkflowExecutionUpdateResponse\"\x00\x12\x92\x01\n\x13StartBatchOperation\x12;.temporal.api.workflowservice.v1.StartBatchOperationRequest\x1A<.temporal.api.workflowservice.v1.StartBatchOperationResponse\"\x00\x12\x8F\x01\n\x12StopBatchOperation\x12:.temporal.api.workflowservice.v1.StopBatchOperationRequest\x1A;.temporal.api.workflowservice.v1.StopBatchOperationResponse\"\x00\x12\x9B\x01\n\x16DescribeBatchOperation\x12>.temporal.api.workflowservice.v1.DescribeBatchOperationRequest\x1A?.temporal.api.workflowservice.v1.DescribeBatchOperationResponse\"\x00\x12\x92\x01\n\x13ListBatchOperations\x12;.temporal.api.workflowservice.v1.ListBatchOperationsRequest\x1A<.temporal.api.workflowservice.v1.ListBatchOperationsResponse\"\x00\x12\x96\x01\n\x15ExecuteMultiOperation\x12=.temporal.api.workflowservice.v1.ExecuteMultiOperationRequest\x1A>.temporal.api.workflowservice.v1.ExecuteMultiOperationResponseB\xB6\x01\n\"io.temporal.api.workflowservice.v1B\fServiceProtoP\x01Z5go.temporal.io/api/workflowservice/v1;workflowservice\xAA\x02!Temporalio.Api.WorkflowService.V1\xEA\x02$Temporalio::Api::WorkflowService::V1b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/lib/gen/temporal/api/workflowservice/v1/service_services_pb.rb b/lib/gen/temporal/api/workflowservice/v1/service_services_pb.rb index 3acb9d264..2076c1389 100644 --- a/lib/gen/temporal/api/workflowservice/v1/service_services_pb.rb +++ b/lib/gen/temporal/api/workflowservice/v1/service_services_pb.rb @@ -303,6 +303,7 @@ class Service # Invokes the specified update function on user workflow code. # (-- api-linter: core::0134=disabled # aip.dev/not-precedent: UpdateWorkflowExecution doesn't follow Google API format --) + rpc :ExecuteMultiOperation, ::Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationRequest, ::Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationResponse rpc :UpdateWorkflowExecution, ::Temporalio::Api::WorkflowService::V1::UpdateWorkflowExecutionRequest, ::Temporalio::Api::WorkflowService::V1::UpdateWorkflowExecutionResponse # Polls a workflow execution for the outcome of a workflow execution update # previously issued through the UpdateWorkflowExecution RPC. The effective diff --git a/lib/temporal.rb b/lib/temporal.rb index b9f49d559..84c83e6c4 100644 --- a/lib/temporal.rb +++ b/lib/temporal.rb @@ -16,6 +16,11 @@ module Temporal def_delegators :default_client, #target :start_workflow, + :start_workflow_update, + :execute_workflow_update, + :start_update_with_start_workflow, + :execute_update_with_start_workflow, + :get_workflow_update_handle, :schedule_workflow, :register_namespace, :describe_namespace, diff --git a/lib/temporal/client.rb b/lib/temporal/client.rb index 185202cf7..de18979b6 100644 --- a/lib/temporal/client.rb +++ b/lib/temporal/client.rb @@ -11,9 +11,11 @@ require 'temporal/workflow/executions' require 'temporal/workflow/status' require 'temporal/reset_strategy' +require 'temporal/client_updates' module Temporal class Client + include ClientUpdates def initialize(config) @config = config @converter = config.converter diff --git a/lib/temporal/client_updates.rb b/lib/temporal/client_updates.rb new file mode 100644 index 000000000..b7b891557 --- /dev/null +++ b/lib/temporal/client_updates.rb @@ -0,0 +1,78 @@ +require 'temporal/update_handle' + +module Temporal + module ClientUpdates + # Start an Update on a specific execution. update_id deduplicates requests + # within a run; use a stable ID when retrying after an ambiguous RPC failure. + def start_workflow_update(workflow, update, workflow_id, run_id = nil, *input, + update_id: SecureRandom.uuid, wait_for_stage: :accepted, + namespace: nil, headers: {}, first_execution_run_id: nil, timeout: 60) + execution = ExecutionOptions.new(workflow, {}, config.default_execution_options) + namespace ||= execution.namespace + response = connection.update_workflow_execution( + namespace: namespace, workflow_id: workflow_id, run_id: run_id, + update: update, input: input, update_id: update_id, wait_for_stage: wait_for_stage, + headers: config.header_propagator_chain.inject(headers), + first_execution_run_id: first_execution_run_id, timeout: timeout + ) + update_handle_from(response, namespace) + end + + def execute_workflow_update(workflow, update, workflow_id, run_id = nil, *input, **options) + start_workflow_update(workflow, update, workflow_id, run_id, *input, + **options.merge(wait_for_stage: :completed)).result + end + + # Atomically start (or select) a Workflow and submit its Update. A conflict + # policy is mandatory: :use_existing or :fail. options[:workflow_id] is required. + # start_args belong to Workflow#execute; input belongs to the Update handler. + def start_update_with_start_workflow(workflow, update, *input, start_args: [], options: {}, + workflow_id_conflict_policy:, update_id: SecureRandom.uuid, + request_id: SecureRandom.uuid, wait_for_stage: :accepted, + headers: {}, timeout: 60) + workflow_id = options[:workflow_id] + raise ArgumentError, 'options[:workflow_id] is required' unless workflow_id.is_a?(String) && !workflow_id.empty? + unless [:use_existing, :fail].include?(workflow_id_conflict_policy) + raise ArgumentError, 'workflow_id_conflict_policy must be :use_existing or :fail' + end + if options.values_at(:signal_name, :signal_input, :cron_schedule, :start_delay).any? + raise ArgumentError, 'Update-With-Start does not support signals, cron schedules or start delays' + end + execution = ExecutionOptions.new(workflow, options, config.default_execution_options) + response = connection.update_with_start_workflow_execution( + namespace: execution.namespace, workflow_id: workflow_id, + workflow_name: execution.name, task_queue: execution.task_queue, input: start_args, + execution_timeout: execution.timeouts[:execution], run_timeout: compute_run_timeout(execution), + task_timeout: execution.timeouts[:task], workflow_id_reuse_policy: options[:workflow_id_reuse_policy], + workflow_id_conflict_policy: workflow_id_conflict_policy, request_id: request_id, + headers: config.header_propagator_chain.inject(execution.headers), memo: execution.memo, + search_attributes: Workflow::Context::Helpers.process_search_attributes(execution.search_attributes), + retry_policy: execution.retry_policy, + update: update, update_input: input, update_id: update_id, + update_headers: config.header_propagator_chain.inject(headers), wait_for_stage: wait_for_stage, timeout: timeout + ) + update_handle_from(response.responses[1].update_workflow, execution.namespace, + workflow_started: response.responses[0].start_workflow.started) + end + + def execute_update_with_start_workflow(workflow, update, *input, **options) + start_update_with_start_workflow(workflow, update, *input, + **options.merge(wait_for_stage: :completed)).result + end + + # Reattach after a client restart. Always save and use the returned run_id. + def get_workflow_update_handle(workflow_id, run_id, update_id, namespace: config.namespace) + WorkflowUpdateHandle.new(connection: connection, converter: converter, namespace: namespace, + workflow_id: workflow_id, run_id: run_id, update_id: update_id) + end + + private + + def update_handle_from(response, namespace, workflow_started: nil) + ref = response.update_ref + WorkflowUpdateHandle.new(connection: connection, converter: converter, namespace: namespace, + workflow_id: ref.workflow_execution.workflow_id, run_id: ref.workflow_execution.run_id, + update_id: ref.update_id, outcome: response.outcome, workflow_started: workflow_started) + end + end +end diff --git a/lib/temporal/connection/grpc.rb b/lib/temporal/connection/grpc.rb index 969a99254..bd156ab71 100644 --- a/lib/temporal/connection/grpc.rb +++ b/lib/temporal/connection/grpc.rb @@ -17,10 +17,12 @@ require 'temporal/connection/serializer/workflow_id_reuse_policy' require 'temporal/connection/serializer/workflow_id_conflict_policy' require 'temporal/connection/serializer/retry_policy' +require 'temporal/connection/workflow_updates' module Temporal module Connection class GRPC + include WorkflowUpdates HISTORY_EVENT_FILTER = { all: Temporalio::Api::Enums::V1::HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_ALL_EVENT, close: Temporalio::Api::Enums::V1::HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT @@ -109,7 +111,7 @@ def deprecate_namespace(name:) client.deprecate_namespace(request) end - def start_workflow_execution( + def build_start_workflow_execution_request( namespace:, workflow_id:, workflow_name:, @@ -125,7 +127,8 @@ def start_workflow_execution( memo: nil, search_attributes: nil, start_delay: nil, - retry_policy: nil + retry_policy: nil, + request_id: SecureRandom.uuid ) if !workflow_id_conflict_policy.nil? && workflow_id_reuse_policy == :terminate_if_running raise Temporal::Connection::ArgumentError, @@ -150,7 +153,7 @@ def start_workflow_execution( workflow_task_timeout: task_timeout, workflow_start_delay: start_delay, retry_policy: Temporal::Connection::Serializer::RetryPolicy.new(retry_policy, converter).to_proto, - request_id: SecureRandom.uuid, + request_id: request_id, header: Temporalio::Api::Common::V1::Header.new( fields: converter.to_payload_map(headers || {}) ), @@ -163,7 +166,12 @@ def start_workflow_execution( ) ) - client.start_workflow_execution(request) + request + end + private :build_start_workflow_execution_request + + def start_workflow_execution(**options) + client.start_workflow_execution(build_start_workflow_execution_request(**options)) rescue ::GRPC::AlreadyExists => e # Feel like there should be cleaner way to do this... run_id = e.details[/RunId: ([a-f0-9]+-[a-f0-9]+-[a-f0-9]+-[a-f0-9]+-[a-f0-9]+)/, 1] @@ -236,12 +244,13 @@ def respond_query_task_completed(namespace:, task_token:, query_result:) client.respond_query_task_completed(request) end - def respond_workflow_task_completed(namespace:, task_token:, commands:, binary_checksum:, new_sdk_flags_used:, query_results: {}) + def respond_workflow_task_completed(namespace:, task_token:, commands:, binary_checksum:, new_sdk_flags_used:, query_results: {}, messages: []) request = Temporalio::Api::WorkflowService::V1::RespondWorkflowTaskCompletedRequest.new( namespace: namespace, identity: identity, task_token: task_token, commands: Array(commands).map { |(_, command)| Serializer.serialize(command, converter) }, + messages: messages, query_results: query_results.transform_values { |value| Serializer.serialize(value, converter) }, binary_checksum: binary_checksum, sdk_metadata: if new_sdk_flags_used.any? diff --git a/lib/temporal/connection/serializer.rb b/lib/temporal/connection/serializer.rb index b31c10055..353cb8a84 100644 --- a/lib/temporal/connection/serializer.rb +++ b/lib/temporal/connection/serializer.rb @@ -1,3 +1,4 @@ +require 'temporal/connection/serializer/protocol_message' require 'temporal/workflow/command' require 'temporal/workflow/query_result' require 'temporal/connection/serializer/schedule_activity' @@ -18,6 +19,7 @@ module Temporal module Connection module Serializer SERIALIZERS_MAP = { + Workflow::Command::ProtocolMessage => Serializer::ProtocolMessage, Workflow::Command::ScheduleActivity => Serializer::ScheduleActivity, Workflow::Command::StartChildWorkflow => Serializer::StartChildWorkflow, Workflow::Command::RequestActivityCancellation => Serializer::RequestActivityCancellation, diff --git a/lib/temporal/connection/serializer/protocol_message.rb b/lib/temporal/connection/serializer/protocol_message.rb new file mode 100644 index 000000000..0aa7ff6a7 --- /dev/null +++ b/lib/temporal/connection/serializer/protocol_message.rb @@ -0,0 +1,18 @@ +require 'temporal/connection/serializer/base' + +module Temporal + module Connection + module Serializer + class ProtocolMessage < Base + def to_proto + Temporalio::Api::Command::V1::Command.new( + command_type: :COMMAND_TYPE_PROTOCOL_MESSAGE, + protocol_message_command_attributes: Temporalio::Api::Command::V1::ProtocolMessageCommandAttributes.new( + message_id: object.message.id + ) + ) + end + end + end + end +end diff --git a/lib/temporal/connection/workflow_updates.rb b/lib/temporal/connection/workflow_updates.rb new file mode 100644 index 000000000..89bd7ac2b --- /dev/null +++ b/lib/temporal/connection/workflow_updates.rb @@ -0,0 +1,99 @@ +module Temporal + module Connection + module WorkflowUpdates + UPDATE_STAGES = { accepted: 2, completed: 3 }.freeze + + def update_workflow_execution(namespace:, workflow_id:, run_id:, update:, input:, update_id:, + wait_for_stage:, headers:, first_execution_run_id:, timeout:) + request = build_update_request(namespace: namespace, workflow_id: workflow_id, run_id: run_id, + update: update, input: input, update_id: update_id, + wait_for_stage: wait_for_stage, headers: headers, + first_execution_run_id: first_execution_run_id) + wait_for_update(timeout) do |deadline| + response = client.update_workflow_execution(request, deadline: deadline) + response if update_stage_reached?(response, wait_for_stage) + end + end + + def update_with_start_workflow_execution(update:, update_input:, update_id:, update_headers:, + wait_for_stage:, timeout:, **start_options) + start = build_start_workflow_execution_request(**start_options) + update = build_update_request(namespace: start.namespace, workflow_id: start.workflow_id, + run_id: nil, update: update, input: update_input, update_id: update_id, + wait_for_stage: wait_for_stage, headers: update_headers, + first_execution_run_id: nil) + request = Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationRequest.new( + namespace: start.namespace, operations: [ + Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationRequest::Operation.new(start_workflow: start), + Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationRequest::Operation.new(update_workflow: update) + ] + ) + start_response = nil + wait_for_update(timeout) do |deadline| + response = client.execute_multi_operation(request, deadline: deadline) + # Subsequent long polls reuse the same start request and may report + # started=false. Retain the initial successful start response. + start_response ||= response.responses.fetch(0).start_workflow + response.responses[0].start_workflow = start_response + response if update_stage_reached?(response.responses.fetch(1).update_workflow, wait_for_stage) + end + end + + def poll_workflow_update(namespace:, workflow_id:, run_id:, update_id:, timeout:) + request = Temporalio::Api::WorkflowService::V1::PollWorkflowExecutionUpdateRequest.new( + namespace: namespace, identity: identity, + update_ref: Temporalio::Api::Update::V1::UpdateRef.new( + workflow_execution: Temporalio::Api::Common::V1::WorkflowExecution.new(workflow_id: workflow_id, run_id: run_id), + update_id: update_id + ), wait_policy: Temporalio::Api::Update::V1::WaitPolicy.new(lifecycle_stage: UPDATE_STAGES[:completed]) + ) + wait_for_update(timeout) do |deadline| + response = client.poll_workflow_execution_update(request, deadline: deadline) + response if response.outcome + end + end + + private + + def build_update_request(namespace:, workflow_id:, run_id:, update:, input:, update_id:, + wait_for_stage:, headers:, first_execution_run_id:) + raise ::ArgumentError, 'update_id must be a nonempty String' unless update_id.is_a?(String) && !update_id.empty? + raise ::ArgumentError, 'update must be a nonempty name' if update.to_s.empty? + stage = UPDATE_STAGES.fetch(wait_for_stage) { raise ::ArgumentError, 'wait_for_stage must be :accepted or :completed' } + Temporalio::Api::WorkflowService::V1::UpdateWorkflowExecutionRequest.new( + namespace: namespace, + workflow_execution: Temporalio::Api::Common::V1::WorkflowExecution.new(workflow_id: workflow_id, run_id: run_id), + first_execution_run_id: first_execution_run_id, + wait_policy: Temporalio::Api::Update::V1::WaitPolicy.new(lifecycle_stage: stage), + request: Temporalio::Api::Update::V1::Request.new( + meta: Temporalio::Api::Update::V1::Meta.new(update_id: update_id, identity: identity), + input: Temporalio::Api::Update::V1::Input.new(name: update.to_s, args: converter.to_payloads(input), + header: Temporalio::Api::Common::V1::Header.new(fields: converter.to_payload_map(headers))) + ) + ) + end + + def update_stage_reached?(response, stage) + response.outcome || Temporalio::Api::Enums::V1::UpdateWorkflowExecutionLifecycleStage.resolve(response.stage) >= UPDATE_STAGES.fetch(stage) + end + + # A server long poll may return before the requested stage. Retry the exact + # same immutable request, including both IDs, within a single timeout budget. + def wait_for_update(timeout) + raise ::ArgumentError, 'timeout must be positive' unless timeout.is_a?(Numeric) && timeout.positive? && timeout.finite? + expires = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout + loop do + remaining = expires - Process.clock_gettime(Process::CLOCK_MONOTONIC) + raise Temporal::TimeoutError, 'Timed out waiting for Update; the Update may still be running' if remaining <= 0 + begin + response = yield(Time.now + remaining) + return response if response + rescue ::GRPC::Unavailable, ::GRPC::ResourceExhausted, ::GRPC::DeadlineExceeded + remaining = expires - Process.clock_gettime(Process::CLOCK_MONOTONIC) + sleep([0.1, remaining].min) if remaining.positive? + end + end + end + end + end +end diff --git a/lib/temporal/testing/temporal_override.rb b/lib/temporal/testing/temporal_override.rb index 4f96be62d..e5ef3931c 100644 --- a/lib/temporal/testing/temporal_override.rb +++ b/lib/temporal/testing/temporal_override.rb @@ -10,6 +10,21 @@ module Temporal module Testing module TemporalOverride + def start_workflow_update(*args, **options) + raise NotImplementedError, 'Workflow Updates require a Temporal test server; local! does not simulate the Update protocol' unless Temporal::Testing.disabled? + super + end + + def start_update_with_start_workflow(*args, **options) + raise NotImplementedError, 'Workflow Updates require a Temporal test server; local! does not simulate the Update protocol' unless Temporal::Testing.disabled? + super + end + + def get_workflow_update_handle(*args, **options) + raise NotImplementedError, 'Workflow Updates require a Temporal test server; local! does not simulate the Update protocol' unless Temporal::Testing.disabled? + super + end + def start_workflow(workflow, *input, **args) return super if Temporal::Testing.disabled? diff --git a/lib/temporal/update_handle.rb b/lib/temporal/update_handle.rb new file mode 100644 index 000000000..83fc35dd3 --- /dev/null +++ b/lib/temporal/update_handle.rb @@ -0,0 +1,40 @@ +require 'temporal/errors' +require 'temporal/workflow/errors' + +module Temporal + # A validator rejection or handler failure affects the Update, not the Workflow. + class WorkflowUpdateFailed < StandardError + attr_reader :failure, :update_id + + def initialize(failure, update_id) + @failure = failure + @update_id = update_id + super(failure.message) + end + end + + class WorkflowUpdateHandle + attr_reader :namespace, :workflow_id, :run_id, :update_id, :workflow_started + + def initialize(connection:, converter:, namespace:, workflow_id:, run_id:, update_id:, outcome: nil, workflow_started: nil) + @connection, @converter = connection, converter + @namespace, @workflow_id, @run_id, @update_id = namespace, workflow_id, run_id, update_id + @outcome = outcome + @workflow_started = workflow_started + end + + # Waiting does not cancel an Update when the timeout expires. The handle can + # be saved (namespace/workflow_id/run_id/update_id) and retrieved later. + def result(timeout: 60) + @outcome ||= @connection.poll_workflow_update( + namespace: namespace, workflow_id: workflow_id, run_id: run_id, + update_id: update_id, timeout: timeout + ).outcome + if @outcome.failure + cause = Workflow::Errors.generate_error(@outcome.failure, @converter) + raise WorkflowUpdateFailed.new(@outcome.failure, update_id), cause: cause + end + @converter.from_result_payloads(@outcome.success) + end + end +end diff --git a/lib/temporal/workflow/command.rb b/lib/temporal/workflow/command.rb index 9d33aaea5..5b07e0028 100644 --- a/lib/temporal/workflow/command.rb +++ b/lib/temporal/workflow/command.rb @@ -2,6 +2,7 @@ module Temporal class Workflow module Command # TODO: Move these classes into their own directories under workflow/command/* + ProtocolMessage = Struct.new(:message, keyword_init: true) ScheduleActivity = Struct.new(:activity_type, :activity_id, :input, :task_queue, :retry_policy, :timeouts, :headers, keyword_init: true) StartChildWorkflow = Struct.new(:workflow_type, :workflow_id, :input, :namespace, :task_queue, :retry_policy, :parent_close_policy, :timeouts, :headers, :cron_schedule, :memo, :workflow_id_reuse_policy, :search_attributes, keyword_init: true) ContinueAsNew = Struct.new(:workflow_type, :task_queue, :input, :timeouts, :retry_policy, :headers, :memo, :search_attributes, keyword_init: true) diff --git a/lib/temporal/workflow/context.rb b/lib/temporal/workflow/context.rb index 07b917a2d..639614fc0 100644 --- a/lib/temporal/workflow/context.rb +++ b/lib/temporal/workflow/context.rb @@ -30,6 +30,9 @@ def initialize(state_manager, dispatcher, workflow_class, metadata, config, quer @metadata = metadata @completed = false @config = config + dispatcher.register_handler(History::EventTarget.start_workflow, 'completing') do + flush_update_completion + end if track_stack_trace @stack_trace_tracker = StackTraceTracker.new @@ -66,6 +69,7 @@ def search_attributes end def has_release?(release_name) + check_update_validator! state_manager.release?(release_name.to_s) end @@ -196,6 +200,7 @@ def schedule_workflow(workflow_class, cron_schedule, *input, **args) end def side_effect(&block) + check_update_validator! marker = state_manager.next_side_effect return marker.last if marker @@ -239,6 +244,13 @@ def cancel_timer(timer_id) # TODO: check if workflow can be completed def complete(result = nil) + check_update_validator! + if state_manager.update_registry.registered? + raise ArgumentError, 'Update handlers cannot complete the Workflow' if current_update + @pending_update_completion = Command::CompleteWorkflow.new(result: result) + completed! + return + end command = Command::CompleteWorkflow.new(result: result) schedule_command(command) completed! @@ -246,12 +258,24 @@ def complete(result = nil) # TODO: check if workflow can be failed def fail(exception) + check_update_validator! + if state_manager.update_registry.registered? + raise ArgumentError, 'Update handlers cannot fail the Workflow' if current_update + @pending_update_completion = Command::FailWorkflow.new(exception: exception) + completed! + return + end command = Command::FailWorkflow.new(exception: exception) schedule_command(command) completed! end def continue_as_new(*input, **args) + check_update_validator! + raise ArgumentError, 'Update handlers cannot continue as new' if current_update + if state_manager.update_registry.active_count.positive? + raise ArgumentError, 'Wait for all Update handlers before continuing as new' + end options = args.delete(:options) || {} input << args unless args.empty? @@ -274,7 +298,11 @@ def continue_as_new(*input, **args) memo: execution_options.memo, search_attributes: Helpers.process_search_attributes(execution_options.search_attributes) ) - schedule_command(command) + if state_manager.update_registry.registered? + @pending_update_completion = command + else + schedule_command(command) + end completed! end @@ -288,13 +316,18 @@ def wait_for_all(*futures) # Block workflow progress until one of the futures completes. Passing # in an empty array will immediately unblock. def wait_for_any(*futures) + check_update_validator! return if futures.empty? || futures.any?(&:finished?) fiber = Fiber.current + waiting = true handlers = futures.map do |future| dispatcher.register_handler(future.target, Dispatcher::WILDCARD) do - fiber.resume if future.finished? + if waiting && future.finished? + waiting = false + fiber.resume + end end end @@ -303,6 +336,7 @@ def wait_for_any(*futures) Fiber.yield ensure stack_trace_tracker&.clear + waiting = false handlers.each(&:unregister) end @@ -311,6 +345,7 @@ def wait_for_any(*futures) # Block workflow progress until the specified block evaluates to true. def wait_until(&unblock_condition) + check_update_validator! raise 'You must pass a block to wait_until' if unblock_condition.nil? return if unblock_condition.call @@ -321,11 +356,18 @@ def wait_until(&unblock_condition) # signal handlers or callbacks for timer or activity completion. Running the wait_until # handlers after the other handlers ensures that state is correctly updated before being # read. + # A nested dispatch (for example, an Update completing) can leave a + # snapshot of this callback in the outer dispatch. Resume at most once, + # even if the fiber has already progressed to another blocking operation. + waiting = true handler = dispatcher.register_handler( Dispatcher::WILDCARD, # any target Dispatcher::WILDCARD, # any event type Dispatcher::Order::AT_END) do - fiber.resume if unblock_condition.call + if waiting && unblock_condition.call + waiting = false + fiber.resume + end end stack_trace_tracker&.record @@ -333,6 +375,7 @@ def wait_until(&unblock_condition) Fiber.yield ensure stack_trace_tracker&.clear + waiting = false handler.unregister end @@ -351,6 +394,7 @@ def now # # @param signal_name [String, Symbol, nil] an optional signal name; converted to a String def on_signal(signal_name = nil, &block) + check_update_validator! first_task_signals = if state_manager.sdk_flags.include?(SDKFlags::SAVE_FIRST_TASK_SIGNALS) state_manager.first_task_signals else @@ -382,7 +426,31 @@ def on_signal(signal_name = nil, &block) return end + # Register before the first blocking operation in #execute. Validators + # must be synchronous, deterministic, read-only checks that raise to reject. + def on_update(name, validator: nil, &block) + check_update_validator! + state_manager.update_registry.register(name, self, validator: validator, &block) + end + + def all_update_handlers_finished? + state_manager.update_registry.active_count.zero? + end + + def current_update + Thread.current[:temporal_current_update] + end + + # Internal: completion waits until Updates accepted by this task have + # finished. This also permits an initial Update on an otherwise short Workflow. + def flush_update_completion + return unless @pending_update_completion && all_update_handlers_finished? + command, @pending_update_completion = @pending_update_completion, nil + schedule_command(command) + end + def on_query(query, &block) + check_update_validator! query_registry.register(query, &block) end @@ -485,6 +553,10 @@ def upsert_search_attributes(search_attributes) attr_reader :state_manager, :dispatcher, :workflow_class, :query_registry, :stack_trace_tracker + def check_update_validator!(operation = 'block') + raise ArgumentError, "Update validators must not #{operation}" if state_manager.update_registry.validating? + end + def completed! @completed = true end diff --git a/lib/temporal/workflow/executor.rb b/lib/temporal/workflow/executor.rb index f40fef3ba..ba9749af5 100644 --- a/lib/temporal/workflow/executor.rb +++ b/lib/temporal/workflow/executor.rb @@ -11,7 +11,7 @@ module Temporal class Workflow class Executor - RunResult = Struct.new(:commands, :new_sdk_flags_used, keyword_init: true) + RunResult = Struct.new(:commands, :new_sdk_flags_used, :messages, keyword_init: true) # @param workflow_class [Class] # @param history [Workflow::History] @@ -40,9 +40,10 @@ def run while window = history.next_window state_manager.apply(window) + @context&.flush_update_completion end - RunResult.new(commands: state_manager.final_commands, new_sdk_flags_used: state_manager.new_sdk_flags_used) + RunResult.new(commands: state_manager.final_commands, new_sdk_flags_used: state_manager.new_sdk_flags_used, messages: state_manager.final_messages) end # Process queries using the pre-registered query handlers @@ -72,7 +73,7 @@ def process_query(query) def execute_workflow(input, workflow_started_event) metadata = Metadata.generate_workflow_metadata(workflow_started_event, task_metadata, config.converter) - context = Workflow::Context.new(state_manager, dispatcher, workflow_class, metadata, config, query_registry, + context = @context = Workflow::Context.new(state_manager, dispatcher, workflow_class, metadata, config, query_registry, track_stack_trace) Fiber.new do diff --git a/lib/temporal/workflow/future.rb b/lib/temporal/workflow/future.rb index 26929e867..5eeb4beb9 100644 --- a/lib/temporal/workflow/future.rb +++ b/lib/temporal/workflow/future.rb @@ -1,4 +1,5 @@ require 'fiber' +require 'temporal/workflow/update_execution' module Temporal class Workflow @@ -44,6 +45,7 @@ def set(result) @result = result @ready = true + failure_callbacks.grep(UpdateExecution::Callback).each(&:discard) end def fail(exception) @@ -51,27 +53,32 @@ def fail(exception) @exception = exception @failed = true + success_callbacks.grep(UpdateExecution::Callback).each(&:discard) end # When the activity completes successfully, the block will be called with any result def done(&block) + block = own_update_callback(block) if ready? block.call(result) else # If the future is still outstanding, schedule a callback for invocation by the # workflow context when the workflow or activity is finished success_callbacks << block + block.discard if failed? && block.is_a?(UpdateExecution::Callback) end end # When the activity fails, the block will be called with the exception def failed(&block) + block = own_update_callback(block) if failed? block.call(exception) else # If the future is still outstanding, schedule a callback for invocation by the # workflow context when the workflow or activity is finished failure_callbacks << block + block.discard if ready? && block.is_a?(UpdateExecution::Callback) end end @@ -84,6 +91,15 @@ def cancel private attr_reader :context, :cancelation_id, :result, :exception + + def own_update_callback(block) + # Registration belongs to the active caller, not to the context that + # created the Future. Validators must not leave callbacks that cannot + # be reconstructed when the accepted Update replays without validation. + ThreadLocalContext.get&.send(:check_update_validator!, 'register Future callbacks') + execution = Thread.current[UpdateExecution::CURRENT_KEY] + execution ? execution.register_callback(block) : block + end end end end diff --git a/lib/temporal/workflow/history.rb b/lib/temporal/workflow/history.rb index 07bbe96d4..585a06697 100644 --- a/lib/temporal/workflow/history.rb +++ b/lib/temporal/workflow/history.rb @@ -1,14 +1,53 @@ require 'temporal/workflow/history/event' require 'temporal/workflow/history/window' +require 'temporal/workflow/history/update_request' +require 'google/protobuf/well_known_types' module Temporal class Workflow class History attr_reader :events - def initialize(events) + def initialize(events, messages: []) @events = events.map { |event| History::Event.new(event) } - @iterator = @events.each + pending = {} + admitted = @events.each_with_object({}) do |event, requests| + requests[event.id] = event.attributes.request if event.type == 'WORKFLOW_EXECUTION_UPDATE_ADMITTED' + end + @events.each do |event| + next unless event.type == 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED' + attrs = event.attributes + request = attrs.accepted_request || admitted[attrs.accepted_request_sequencing_event_id] + raise Temporal::InternalError, 'Accepted Update request is missing from history' unless request + message = Temporalio::Api::Protocol::V1::Message.new( + id: attrs.accepted_request_message_id, protocol_instance_id: attrs.protocol_instance_id, + event_id: attrs.accepted_request_sequencing_event_id, + body: Google::Protobuf::Any.pack(request) + ) + pending[message.protocol_instance_id] = [message, true] + end + @events.each do |event| + next unless event.type == 'WORKFLOW_EXECUTION_UPDATE_ADMITTED' + request = event.attributes.request + id = request.meta.update_id + message = Temporalio::Api::Protocol::V1::Message.new( + id: "#{id}/request", protocol_instance_id: id, event_id: event.id, + body: Google::Protobuf::Any.pack(request) + ) + # If this request was subsequently accepted, use its recorded message + # identity/sequence above and skip validation. Otherwise admission is + # a new delivery, including on a reset branch, and must be validated. + pending[id] ||= [message, false] + end + messages.each { |message| pending[message.protocol_instance_id] ||= [message, false] } + sequenced = pending.values.group_by { |message, _| message.event_id } + stream = @events.flat_map do |event| + [event] + (sequenced.delete(event.id) || []).map do |message, replay| + History::UpdateRequest.new(message, event.timestamp, replay: replay) + end + end + raise Temporal::InternalError, 'Update sequencing event is missing from history' unless sequenced.empty? + @iterator = stream.each end def find_event_by_id(id) @@ -45,6 +84,8 @@ def next_window private COMMAND_EVENT_TYPES = %w[ + WORKFLOW_EXECUTION_UPDATE_ACCEPTED + WORKFLOW_EXECUTION_UPDATE_COMPLETED ACTIVITY_TASK_SCHEDULED ACTIVITY_TASK_CANCEL_REQUESTED TIMER_STARTED diff --git a/lib/temporal/workflow/history/event_target.rb b/lib/temporal/workflow/history/event_target.rb index 881a7823d..6ccbfe7a7 100644 --- a/lib/temporal/workflow/history/event_target.rb +++ b/lib/temporal/workflow/history/event_target.rb @@ -6,6 +6,10 @@ class History class EventTarget class UnexpectedEventType < InternalError; end + UPDATE_REQUEST_TYPE = :update_request + UPDATE_ACCEPT_TYPE = :update_accept + UPDATE_COMPLETE_TYPE = :update_complete + ACTIVITY_TYPE = :activity CANCEL_ACTIVITY_REQUEST_TYPE = :cancel_activity_request TIMER_TYPE = :timer @@ -25,6 +29,8 @@ class UnexpectedEventType < InternalError; end # NOTE: The order is important, first prefix match wins (will be a longer match) TARGET_TYPES = { + 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED' => UPDATE_ACCEPT_TYPE, + 'WORKFLOW_EXECUTION_UPDATE_COMPLETED' => UPDATE_COMPLETE_TYPE, 'ACTIVITY_TASK_CANCEL_REQUESTED' => CANCEL_ACTIVITY_REQUEST_TYPE, 'ACTIVITY_TASK' => ACTIVITY_TYPE, 'REQUEST_CANCEL_ACTIVITY_TASK' => CANCEL_ACTIVITY_REQUEST_TYPE, @@ -47,12 +53,16 @@ class UnexpectedEventType < InternalError; end 'WORKFLOW_EXECUTION_STARTED' => START_WORKFLOW_TYPE, # This is a fall-through type for various event types that workflow code cannot # react to, either because they're externally triggered (workflow termination, - # timeout) or use an unsupported feature (workflow cancellation, updates). + # timeout) or use an unsupported feature (workflow cancellation). 'WORKFLOW_EXECUTION' => WORKFLOW_TYPE, }.freeze attr_reader :id, :type + def self.update_request + @update_request ||= new(0, UPDATE_REQUEST_TYPE) + end + def self.start_workflow @workflow ||= new(1, START_WORKFLOW_TYPE) end diff --git a/lib/temporal/workflow/history/update_request.rb b/lib/temporal/workflow/history/update_request.rb new file mode 100644 index 000000000..aee9104db --- /dev/null +++ b/lib/temporal/workflow/history/update_request.rb @@ -0,0 +1,23 @@ +module Temporal + class Workflow + class History + # Accepted requests are carried in history and re-delivered at their + # original sequencing event, before commands from the accepting task. + class UpdateRequest + attr_reader :message, :timestamp, :replay + + def initialize(message, timestamp, replay:) + @message, @timestamp, @replay = message, timestamp, replay + end + + def id + message.event_id + end + + def type + 'WORKFLOW_UPDATE_REQUEST' + end + end + end + end +end diff --git a/lib/temporal/workflow/state_manager.rb b/lib/temporal/workflow/state_manager.rb index c90ed3deb..f11a835e5 100644 --- a/lib/temporal/workflow/state_manager.rb +++ b/lib/temporal/workflow/state_manager.rb @@ -7,6 +7,7 @@ require 'temporal/workflow/errors' require 'temporal/workflow/sdk_flags' require 'temporal/workflow/signal' +require 'temporal/workflow/update_registry' module Temporal class Workflow @@ -17,7 +18,7 @@ class StateManager class UnsupportedEvent < Temporal::InternalError; end class UnsupportedMarkerType < Temporal::InternalError; end - attr_reader :local_time, :search_attributes, :new_sdk_flags_used, :sdk_flags, :first_task_signals + attr_reader :update_registry, :local_time, :search_attributes, :new_sdk_flags_used, :sdk_flags, :first_task_signals def initialize(dispatcher, config) @dispatcher = dispatcher @@ -32,6 +33,8 @@ def initialize(dispatcher, config) @search_attributes = {} @config = config @converter = config.converter + @update_registry = UpdateRegistry.new(self, dispatcher, @converter) + @rejection_messages = [] # Current flags in use, built up from workflow task completed history entries @sdk_flags = Set.new @@ -56,6 +59,7 @@ def replay? end def schedule(command) + raise ArgumentError, 'Update validators must not issue workflow commands' if update_registry.validating? # Fast-forward event IDs to skip all the markers (version markers can # be removed, so we can't rely on them being scheduled during a replay) command_id = next_event_id @@ -85,6 +89,18 @@ def schedule(command) [event_target_from(command_id, command), cancelation_id] end + def emit_update_message(message, durable:) + if durable + schedule(Command::ProtocolMessage.new(message: message)) + else + @rejection_messages << message + end + end + + def final_messages + commands.filter_map { |_, command| command.message if command.is_a?(Command::ProtocolMessage) } + @rejection_messages + end + def final_commands # Filter out any activity or timer cancellation commands if the underlying activity or # timer has completed. This can occur when an activity or timer completes while a @@ -242,10 +258,30 @@ def validate_append_command(command) end def apply_event(event) + if event.is_a?(History::UpdateRequest) + dispatch(History::EventTarget.update_request, 'update_requested', event.message, event.replay) + return + end state_machine = command_tracker[event.originating_event_id] history_target = History::EventTarget.from_event(event) case event.type + when 'WORKFLOW_EXECUTION_UPDATE_ADMITTED' + # History inserts a corresponding UpdateRequest after this event. + # Admission itself does not consume a workflow command. + + when 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED', 'WORKFLOW_EXECUTION_UPDATE_COMPLETED' + update_id = if event.type == 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED' + event.attributes.protocol_instance_id + else + event.attributes.meta.update_id + end + command = commands.first&.last + unless command.is_a?(Command::ProtocolMessage) && command.message.protocol_instance_id == update_id + raise NonDeterministicWorkflowError, "Update command does not match history for #{update_id}" + end + discard_command(history_target) + when 'WORKFLOW_EXECUTION_STARTED' unless event.attributes.search_attributes.nil? search_attributes.merge!(converter.from_payload_map(event.attributes.search_attributes&.indexed_fields || {})) @@ -260,10 +296,12 @@ def apply_event(event) ) when 'WORKFLOW_EXECUTION_COMPLETED' + dispatch(History::EventTarget.start_workflow, 'completing') # should only be triggered in query execution and replay testing discard_command(history_target) when 'WORKFLOW_EXECUTION_FAILED' + dispatch(History::EventTarget.start_workflow, 'completing') # should only be triggered in query execution and replay testing discard_command(history_target) @@ -366,6 +404,7 @@ def apply_event(event) # todo when 'WORKFLOW_EXECUTION_CONTINUED_AS_NEW' + dispatch(History::EventTarget.start_workflow, 'completing') # should only be triggered in query execution and replay testing discard_command(history_target) @@ -437,6 +476,12 @@ def apply_event(event) def event_target_from(command_id, command) target_type = case command + when Command::ProtocolMessage + if command.message.body.type_url.end_with?('/temporal.api.update.v1.Acceptance') + History::EventTarget::UPDATE_ACCEPT_TYPE + else + History::EventTarget::UPDATE_COMPLETE_TYPE + end when Command::ScheduleActivity History::EventTarget::ACTIVITY_TYPE when Command::RequestActivityCancellation diff --git a/lib/temporal/workflow/task_processor.rb b/lib/temporal/workflow/task_processor.rb index b3620ad8a..e2bb78c5c 100644 --- a/lib/temporal/workflow/task_processor.rb +++ b/lib/temporal/workflow/task_processor.rb @@ -113,7 +113,7 @@ def fetch_full_history next_page_token = response.next_page_token end - Workflow::History.new(events) + Workflow::History.new(events, **(task.messages.empty? ? {} : { messages: task.messages })) end def legacy_query_task? @@ -140,7 +140,8 @@ def complete_task(run_result, query_results) commands: run_result.commands, binary_checksum: binary_checksum, query_results: query_results, - new_sdk_flags_used: run_result.new_sdk_flags_used + new_sdk_flags_used: run_result.new_sdk_flags_used, + **(run_result.messages&.empty? != false ? {} : { messages: run_result.messages }) ) end diff --git a/lib/temporal/workflow/update_execution.rb b/lib/temporal/workflow/update_execution.rb new file mode 100644 index 000000000..341f956c8 --- /dev/null +++ b/lib/temporal/workflow/update_execution.rb @@ -0,0 +1,108 @@ +require 'fiber' +require 'temporal/thread_local_context' + +module Temporal + class Workflow + # One accepted Update and the Future callbacks registered by its fibers. + # Callback ownership is captured at registration, even for a Future created + # by the main workflow or another Update. Completion drains that owned work. + class UpdateExecution + CURRENT_KEY = :temporal_update_execution + + class Callback + def initialize(execution, block) + @execution, @block = execution, block + @finished = false + end + + def call(*args) + return if @finished + begin + @execution.with_current { @block.call(*args) } + rescue StandardError, ScriptError => error + @execution.callback_failed(error) + ensure + discard + end + end + + # A success callback is discarded on failure, and vice versa. It must + # stop holding the Update open even though its block will never run. + def discard + return if @finished + @finished = true + @execution.callback_finished(self) + end + end + + def initialize(context, info, &complete) + @context, @info, @complete = context, info, complete + @callbacks = {} + @handler_finished = @completed = false + end + + def start(&handler) + @fiber = Fiber.new do + with_current do + begin + @result = handler.call + rescue StandardError, ScriptError => error + @error = error + end + @handler_finished = true + complete_if_finished + end + end + @fiber.resume + end + + def register_callback(block) + callback = Callback.new(self, block) + @callbacks[callback] = true + callback + end + + def with_current + previous_context = ThreadLocalContext.get + previous_update = Thread.current[:temporal_current_update] + previous_execution = Thread.current[CURRENT_KEY] + ThreadLocalContext.set(@context) + Thread.current[:temporal_current_update] = @info + Thread.current[CURRENT_KEY] = self + yield + ensure + Thread.current[CURRENT_KEY] = previous_execution + Thread.current[:temporal_current_update] = previous_update + ThreadLocalContext.set(previous_context) + end + + def callback_failed(error) + if Fiber.current == @fiber + # Already-completed Futures invoke their callbacks inline. + raise error + elsif !@handler_finished && @fiber.alive? + # Deliver to the suspended handler's rescue/ensure blocks. Merely + # raising in the separate callback fiber would fail the workflow task + # forever, leaving the accepted Update without an outcome. + @fiber.raise(error) + else + # The handler returned while an owned callback was still pending. + @error ||= error + end + end + + def callback_finished(callback) + @callbacks.delete(callback) + complete_if_finished + end + + private + + def complete_if_finished + return unless @handler_finished && @callbacks.empty? && !@completed + @completed = true + @complete.call(@result, @error) + end + end + end +end diff --git a/lib/temporal/workflow/update_registry.rb b/lib/temporal/workflow/update_registry.rb new file mode 100644 index 000000000..38ad08125 --- /dev/null +++ b/lib/temporal/workflow/update_registry.rb @@ -0,0 +1,122 @@ +require 'google/protobuf/well_known_types' +require 'temporal/connection/serializer/failure' +require 'temporal/workflow/update_execution' + +module Temporal + class Workflow + # The StateManager owns the durable commands; this registry owns the Ruby + # handler fibers. Both are rebuilt from full history for every workflow task. + class UpdateRegistry + Handler = Struct.new(:block, :validator) + attr_reader :active_count + + def initialize(state_manager, dispatcher, converter) + @state_manager, @dispatcher, @converter = state_manager, dispatcher, converter + @handlers, @processed = {}, {} + @active_count = 0 + dispatcher.register_handler(History::EventTarget.update_request, 'update_requested') do |message, replay| + process(message, replay) + end + end + + def register(name, context, validator: nil, &block) + raise ArgumentError, 'An Update handler block is required' unless block + raise ArgumentError, 'Update name must not be empty' if name.to_s.empty? + raise ArgumentError, "Update handler already registered: #{name}" if @handlers.key?(name.to_s) + @context = context + @handlers[name.to_s] = Handler.new(block, validator) + end + + def registered? + !@handlers.empty? + end + + def validating? + @validating == true + end + + private + + def process(message, replay) + unless message.body&.type_url&.end_with?('/temporal.api.update.v1.Request') + raise Temporal::InternalError, "Unsupported workflow protocol message: #{message.body&.type_url}" + end + return if @processed[message.protocol_instance_id] + @processed[message.protocol_instance_id] = true + request = Temporalio::Api::Update::V1::Request.decode(message.body.value) + unless request.meta && request.input && request.meta.update_id == message.protocol_instance_id + raise Temporal::InternalError, 'Malformed Update request or mismatched Update ID' + end + handler = @handlers[request.input.name] + begin + raise ArgumentError, "Unknown Update handler: #{request.input.name}" unless handler + input = @converter.from_payloads(request.input.args) || [] + headers = @converter.from_payload_map(request.input.header&.fields || {}) + validate(handler, input) unless replay + rescue StandardError, ScriptError => e + # Accepted requests must replay their handlers; a new validator must + # never reject an Update that was already durably accepted. + raise Temporal::NonDeterministicWorkflowError, "Cannot replay accepted Update: #{e.message}" if replay + emit(message, 'reject', Temporalio::Api::Update::V1::Rejection.new( + rejected_request_message_id: message.id, rejected_request_sequencing_event_id: message.event_id, + rejected_request: request, failure: failure(e) + ), durable: false) + return + end + + emit(message, 'accept', Temporalio::Api::Update::V1::Acceptance.new( + accepted_request_message_id: message.id, accepted_request_sequencing_event_id: message.event_id, + accepted_request: request + )) + @active_count += 1 + info = { + id: request.meta.update_id, name: request.input.name, + headers: headers + }.freeze + execution = UpdateExecution.new(@context, info) do |result, error| + begin + outcome = if error + Temporalio::Api::Update::V1::Outcome.new(failure: failure(error)) + else + Temporalio::Api::Update::V1::Outcome.new(success: @converter.to_result_payloads(result)) + end + rescue StandardError, ScriptError => e + outcome = Temporalio::Api::Update::V1::Outcome.new(failure: failure(e)) + end + emit(message, 'complete', Temporalio::Api::Update::V1::Response.new(meta: request.meta, outcome: outcome)) + @active_count -= 1 + @dispatcher.dispatch(History::EventTarget.update_request, 'update_completed') + end + execution.start { handler.block.call(*input) } + end + + def validate(handler, input) + return unless handler.validator + @validating = true + fiber = Fiber.new do + ThreadLocalContext.set(@context) + handler.validator.call(*input) + ensure + ThreadLocalContext.set(nil) + end + fiber.resume + raise ArgumentError, 'Update validators must not yield' if fiber.alive? + ensure + @validating = false + end + + def failure(error) + Temporal::Connection::Serializer::Failure.new(error, @converter).to_proto + end + + def emit(request_message, suffix, body, durable: true) + message = Temporalio::Api::Protocol::V1::Message.new( + id: "#{request_message.protocol_instance_id}/#{suffix}", + protocol_instance_id: request_message.protocol_instance_id, + body: Google::Protobuf::Any.pack(body) + ) + @state_manager.emit_update_message(message, durable: durable) + end + end + end +end diff --git a/rbi/temporal-ruby.rbi b/rbi/temporal-ruby.rbi index cdcda0780..aca38e879 100644 --- a/rbi/temporal-ruby.rbi +++ b/rbi/temporal-ruby.rbi @@ -40,4 +40,6 @@ module Temporal class NamespaceAlreadyExistsFailure; end class CancellationAlreadyRequestedFailure; end class QueryFailed; end + class WorkflowUpdateFailed; end + class WorkflowUpdateHandle; end end diff --git a/scripts/backport_workflow_updates.rb b/scripts/backport_workflow_updates.rb new file mode 100644 index 000000000..6f05ddbc0 --- /dev/null +++ b/scripts/backport_workflow_updates.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +# Additive backport from temporalio/api v1.44.0 onto the pinned proto submodule. +# Source: https://github.com/temporalio/api/tree/v1.44.0/temporal/api +# Run by `make proto` after backport_workflow_id_conflict_policy.rb. +# Patching descriptors retains the existing API surface and avoids upgrading all +# generated dependencies. Field numbers, types and service names match upstream. +require 'google/protobuf/descriptor_pb' + +ROOT = File.expand_path('../lib/gen/temporal/api', __dir__) +P = Google::Protobuf +SERVICE = '.temporal.api.workflowservice.v1.' + +def field(name, number, type, type_name = nil, **options) + P::FieldDescriptorProto.new(name: name, number: number, type: type, + label: :LABEL_OPTIONAL, **(type_name ? { type_name: type_name } : {}), **options) +end + +def add_field(message, value) + existing = message.field.find { |f| f.number == value.number || f.name == value.name } + raise "Conflicting protobuf field #{value.name}" if existing && existing != value + message.field << value unless existing +end + +def patch(path, constants = {}) + filename = File.join(ROOT, path) + source = File.read(filename) + line = source.lines.find { |l| l.start_with?('descriptor_data = ') } + # Evaluate only protoc's string literal, never the generated file. + descriptor = P::FileDescriptorProto.decode(eval(line.delete_prefix('descriptor_data = '))) + yield descriptor + source = source.sub(line) { "descriptor_data = #{P::FileDescriptorProto.encode(descriptor).dump}\n" } + constants.each do |name, (full_name, kind)| + next if source.include?("#{name} = ") + insertion = " #{name} = ::Google::Protobuf::DescriptorPool.generated_pool.lookup(#{full_name.inspect}).#{kind}\n" + source = source.sub(/( module V1\n)/, "\\1#{insertion}") + end + File.write(filename, source) +end + +constants = {} +%w[Request Response].each do |suffix| + name = "ExecuteMultiOperation#{suffix}" + constants[name] = [SERVICE.delete_prefix('.') + name, 'msgclass'] + child = suffix == 'Request' ? 'Operation' : 'Response' + constants["#{name}::#{child}"] = [SERVICE.delete_prefix('.') + "#{name}.#{child}", 'msgclass'] +end +# Parent constants must precede nested constants. +constants = constants.sort_by { |name, _| name.include?('::') ? 0 : 1 }.to_h +patch('workflowservice/v1/request_response_pb.rb', constants) do |d| + get = ->(name) { d.message_type.find { |m| m.name == name } } + add_field(get.call('StartWorkflowExecutionResponse'), field('started', 3, :TYPE_BOOL)) + add_field(get.call('UpdateWorkflowExecutionResponse'), field('stage', 3, :TYPE_ENUM, '.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage')) + add_field(get.call('PollWorkflowExecutionUpdateResponse'), field('stage', 2, :TYPE_ENUM, '.temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage')) + add_field(get.call('PollWorkflowExecutionUpdateResponse'), field('update_ref', 3, :TYPE_MESSAGE, '.temporal.api.update.v1.UpdateRef')) + dependency = 'temporal/api/enums/v1/update.proto' + d.dependency << dependency unless d.dependency.include?(dependency) + %w[Request Response].each do |suffix| + name = "ExecuteMultiOperation#{suffix}" + next if get.call(name) + child = suffix == 'Request' ? 'Operation' : 'Response' + nested = P::DescriptorProto.new(name: child, oneof_decl: [P::OneofDescriptorProto.new(name: child.downcase)], field: [ + field('start_workflow', 1, :TYPE_MESSAGE, SERVICE + "StartWorkflowExecution#{suffix}", oneof_index: 0), + field('update_workflow', 2, :TYPE_MESSAGE, SERVICE + "UpdateWorkflowExecution#{suffix}", oneof_index: 0) + ]) + fields = suffix == 'Request' ? [field('namespace', 1, :TYPE_STRING), field('operations', 2, :TYPE_MESSAGE, SERVICE + name + '.' + child, label: :LABEL_REPEATED)] : + [field('responses', 1, :TYPE_MESSAGE, SERVICE + name + '.' + child, label: :LABEL_REPEATED)] + d.message_type << P::DescriptorProto.new(name: name, field: fields, nested_type: [nested]) + end +end +patch('workflowservice/v1/service_pb.rb') do |d| + service = d.service.find { |s| s.name == 'WorkflowService' } + unless service['method'].any? { |m| m.name == 'ExecuteMultiOperation' } + service['method'] << P::MethodDescriptorProto.new(name: 'ExecuteMultiOperation', input_type: SERVICE + 'ExecuteMultiOperationRequest', output_type: SERVICE + 'ExecuteMultiOperationResponse') + end +end +path = File.join(ROOT, 'workflowservice/v1/service_services_pb.rb') +source = File.read(path) +unless source.include?('rpc :ExecuteMultiOperation,') + source = source.sub(' rpc :UpdateWorkflowExecution,', " rpc :ExecuteMultiOperation, ::Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationRequest, ::Temporalio::Api::WorkflowService::V1::ExecuteMultiOperationResponse\n rpc :UpdateWorkflowExecution,") +end +File.write(path, source) + +# Resets can reapply an accepted Update as a durable admitted request. +patch('enums/v1/update_pb.rb', 'UpdateAdmittedEventOrigin' => ['temporal.api.enums.v1.UpdateAdmittedEventOrigin', 'enummodule']) do |d| + unless d.enum_type.any? { |e| e.name == 'UpdateAdmittedEventOrigin' } + d.enum_type << P::EnumDescriptorProto.new(name: 'UpdateAdmittedEventOrigin', value: [ + P::EnumValueDescriptorProto.new(name: 'UPDATE_ADMITTED_EVENT_ORIGIN_UNSPECIFIED', number: 0), + P::EnumValueDescriptorProto.new(name: 'UPDATE_ADMITTED_EVENT_ORIGIN_REAPPLY', number: 1) + ]) + end +end +patch('enums/v1/event_type_pb.rb') do |d| + values = d.enum_type.find { |e| e.name == 'EventType' }.value + unless values.any? { |v| v.name == 'EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED' } + values << P::EnumValueDescriptorProto.new(name: 'EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED', number: 47) + end +end +patch('history/v1/message_pb.rb', 'WorkflowExecutionUpdateAdmittedEventAttributes' => ['temporal.api.history.v1.WorkflowExecutionUpdateAdmittedEventAttributes', 'msgclass']) do |d| + name = 'WorkflowExecutionUpdateAdmittedEventAttributes' + unless d.message_type.any? { |m| m.name == name } + d.message_type << P::DescriptorProto.new(name: name, field: [ + field('request', 1, :TYPE_MESSAGE, '.temporal.api.update.v1.Request'), + field('origin', 2, :TYPE_ENUM, '.temporal.api.enums.v1.UpdateAdmittedEventOrigin') + ]) + end + dependency = 'temporal/api/enums/v1/update.proto' + d.dependency << dependency unless d.dependency.include?(dependency) + add_field(d.message_type.find { |m| m.name == 'HistoryEvent' }, + field('workflow_execution_update_admitted_event_attributes', 52, :TYPE_MESSAGE, + '.temporal.api.history.v1.' + name, oneof_index: 0)) + add_field(d.message_type.find { |m| m.name == 'WorkflowExecutionUpdateCompletedEventAttributes' }, + field('accepted_event_id', 3, :TYPE_INT64)) +end diff --git a/spec/integration/update_with_start_spec.rb b/spec/integration/update_with_start_spec.rb new file mode 100644 index 000000000..91d509441 --- /dev/null +++ b/spec/integration/update_with_start_spec.rb @@ -0,0 +1,301 @@ +# Run against an isolated local Temporal 1.32 server: +# TEMPORAL_UPDATE_INTEGRATION=1 TEMPORAL_UPDATE_PORT=17233 bundle exec rspec spec/integration/update_with_start_spec.rb +require 'temporal/worker' +require 'temporal/testing/replay_tester' + +RSpec.describe 'Update-With-Start against Temporal', if: ENV['TEMPORAL_UPDATE_INTEGRATION'] == '1' do + class UpdateIntegrationActivity < Temporal::Activity + def execute(value) + raise ArgumentError, 'activity failure' if value == 'activity-failure' + "activity:#{value}" + end + end + + class UpdateIntegrationWorkflow < Temporal::Workflow + def execute(account) + @values = [] + @busy = false + workflow.on_signal('stop') { @stop = true } + workflow.on_signal('append') { |value| @values << value } + workflow.on_query('values') { @values } + workflow.on_query('callback_status') { { 'info' => @callback_info, 'unwound' => @callback_unwound } } + workflow.on_update('callback_guard') do + future = UpdateIntegrationActivity.execute('activity-failure', options: { retry_policy: { max_attempts: 1 } }) + future.failed do + @callback_info = workflow.current_update + workflow.continue_as_new + end + begin + workflow.wait_until { false } + ensure + @callback_unwound = true + end + end + workflow.on_update('append', validator: ->(value) { raise ArgumentError, 'invalid value' if value == 'invalid' }) do |value| + raise ArgumentError, 'handler failure' if value == 'fail' + workflow.wait_until { !@busy } + @busy = true + begin + if value == 'block' + workflow.wait_until { @released } + end + @values << UpdateIntegrationActivity.execute!(value) + { 'account' => account, 'values' => @values.dup, 'update_id' => workflow.current_update[:id] } + ensure + @busy = false + end + end + workflow.on_update('release') { @released = true } + workflow.wait_until { @stop } + workflow.wait_until { workflow.all_update_handlers_finished? } + @values + end + end + + class UpdateAutoCompletionIntegrationWorkflow < Temporal::Workflow + def execute + workflow.on_query('main_returned') { @main_returned } + workflow.on_signal('release') { @released = true } + workflow.on_update('block') do + @received = true + workflow.wait_until { @released } + 'update-result' + end + workflow.wait_until { @received } + @main_returned = true + # Deliberately no all_update_handlers_finished? wait: the SDK must defer + # this result across workflow tasks while the accepted Update is blocked. + 'workflow-result' + end + end + + class UpdateValidatorFutureIntegrationWorkflow < Temporal::Workflow + def execute(activity_value) + future = UpdateIntegrationActivity.execute(activity_value, options: { retry_policy: { max_attempts: 1 } }) + workflow.on_signal('stop') { @stop = true } + workflow.on_query('callback_ran') { @callback_ran == true } + workflow.on_update('register_callback', validator: lambda { |callback_type, expected_state| + if future.finished? != (expected_state == 'finished') + raise ArgumentError, 'unexpected Future state in test validator' + end + future.public_send(callback_type) do + @callback_ran = true + workflow.complete('must not close the workflow') + end + }) { 'must not accept the update' } + workflow.on_update('wait_future') do + future.wait + future.failed? ? 'failed' : 'ready' + end + workflow.wait_until { @stop } + 'workflow-result' + end + end + + class UpdateIntegrationWorker < Temporal::Worker + # Test thread must not install process-wide signal handlers. + def trap_signals; end + end + + before(:all) do + @config = Temporal::Configuration.new + @config.host = '127.0.0.1' + @config.port = Integer(ENV.fetch('TEMPORAL_UPDATE_PORT', '17233')) + @config.namespace = 'default' + @config.task_queue = "ruby-update-integration-#{SecureRandom.uuid}" + @config.timeouts = { execution: 120, run: 120, task: 10, start_to_close: 15 } + @client = Temporal::Client.new(@config) + version = @client.connection.get_system_info.server_version + raise "Expected Temporal1.32, got #{version}" unless version.start_with?('1.32.') + puts "Integration server=#{version} ruby=#{RUBY_VERSION} task_queue=#{@config.task_queue}" + start_worker + end + + after(:all) { stop_worker } + + before { @workflow_id = "ruby-update-#{SecureRandom.uuid}" } + + after do + @client.terminate_workflow(@workflow_id, reason: 'integration cleanup') rescue nil + end + + def start_worker + raise 'Previous worker was not stopped' if @worker || @worker_thread + @worker = UpdateIntegrationWorker.new(@config) + @worker.register_workflow(UpdateIntegrationWorkflow) + @worker.register_workflow(UpdateAutoCompletionIntegrationWorkflow) + @worker.register_workflow(UpdateValidatorFutureIntegrationWorkflow) + @worker.register_activity(UpdateIntegrationActivity) + @worker_thread = Thread.new { @worker.start } + end + + def stop_worker + @worker&.stop + if @worker_thread + raise 'Worker thread did not terminate before restart' unless @worker_thread.join(10) + raise 'Worker thread is still alive after stop' if @worker_thread.alive? + end + @worker = @worker_thread = nil + end + + def with_start(value, id: SecureRandom.uuid, policy: :use_existing, wait: :completed, reuse: :allow) + @client.start_update_with_start_workflow(UpdateIntegrationWorkflow, 'append', value, + start_args: ['account-1'], update_id: id, options: { workflow_id: @workflow_id, workflow_id_reuse_policy: reuse }, + workflow_id_conflict_policy: policy, wait_for_stage: wait, timeout: 20) + end + + it 'starts when absent, updates the existing run, returns Activity results and replays its completed history' do + first = with_start('one') + expect(first.workflow_started).to eq(true) + expect(first.result['values']).to eq(['activity:one']) + second = with_start('two') + expect(second.run_id).to eq(first.run_id) + expect(second.workflow_started).to eq(false) + expect(second.result['values']).to eq(['activity:one', 'activity:two']) + @client.signal_workflow(nil, 'stop', @workflow_id, first.run_id) + expect(@client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: first.run_id, timeout: 20)).to eq(['activity:one', 'activity:two']) + history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: first.run_id) + Temporal::Testing::ReplayTester.new(config: @config).replay_history(UpdateIntegrationWorkflow, history) + end + + it 'rejects invalid updates, reports handler failures, and keeps the workflow usable' do + expect { with_start('invalid').result }.to raise_error(Temporal::WorkflowUpdateFailed, /invalid value/) + expect { with_start('fail').result }.to raise_error(Temporal::WorkflowUpdateFailed, /handler failure/) + expect(with_start('good').result['values']).to eq(['activity:good']) + end + + it 'rejects malformed Update headers before acceptance on repeated requests and leaves no active-handler leak' do + first = with_start('one') + # Deliberately bypass client serialization to send an unsupported payload + # encoding, as another client or a mismatched codec could do. + request = Temporalio::Api::WorkflowService::V1::UpdateWorkflowExecutionRequest.new( + namespace: @config.namespace, + workflow_execution: Temporalio::Api::Common::V1::WorkflowExecution.new(workflow_id: @workflow_id, run_id: first.run_id), + wait_policy: Temporalio::Api::Update::V1::WaitPolicy.new(lifecycle_stage: 3), + request: Temporalio::Api::Update::V1::Request.new( + meta: Temporalio::Api::Update::V1::Meta.new(update_id: 'malformed-header'), + input: Temporalio::Api::Update::V1::Input.new(name: 'append', args: @config.converter.to_payloads(['must-not-append']), + header: Temporalio::Api::Common::V1::Header.new(fields: { + 'bad' => Temporalio::Api::Common::V1::Payload.new(metadata: { 'encoding' => 'unsupported-header-test' }, data: 'invalid') + })) + ) + ) + 2.times do + response = @client.connection.send(:client).update_workflow_execution(request, deadline: Time.now + 20) + expect(response.outcome.failure.application_failure_info.type).to include('ConverterNotFound') + end + expect(with_start('after-header').result['values']).to eq(['activity:one', 'activity:after-header']) + @client.signal_workflow(nil, 'stop', @workflow_id, first.run_id) + expect(@client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: first.run_id, timeout: 20)).to eq( + ['activity:one', 'activity:after-header']) + history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: first.run_id) + accepted = history.events.select { |event| event.type == 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED' } + expect(accepted.map { |event| event.attributes.protocol_instance_id }).not_to include('malformed-header') + expect(history.events.map(&:type)).not_to include('WORKFLOW_TASK_FAILED') + Temporal::Testing::ReplayTester.new(config: @config).replay_history(UpdateIntegrationWorkflow, history) + end + + it 'rejects validator callbacks on pending and failed Activities, then replays cleanly' do + handle = @client.start_update_with_start_workflow(UpdateValidatorFutureIntegrationWorkflow, 'register_callback', + 'failed', 'pending', start_args: ['activity-failure'], options: { workflow_id: @workflow_id }, + workflow_id_conflict_policy: :use_existing, update_id: 'pending-validator', timeout: 20) + expect { handle.result(timeout: 20) }.to raise_error(Temporal::WorkflowUpdateFailed, /must not register Future callbacks/) + expect(@client.execute_workflow_update(nil, 'wait_future', @workflow_id, handle.run_id, timeout: 20)).to eq('failed') + expect do + @client.execute_workflow_update(nil, 'register_callback', @workflow_id, handle.run_id, 'failed', 'finished', + update_id: 'finished-validator', timeout: 20) + end.to raise_error(Temporal::WorkflowUpdateFailed, /must not register Future callbacks/) + expect(@client.query_workflow(nil, 'callback_ran', @workflow_id, handle.run_id)).to eq(false) + @client.signal_workflow(nil, 'stop', @workflow_id, handle.run_id) + expect(@client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: handle.run_id, timeout: 20)).to eq('workflow-result') + history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: handle.run_id) + accepted = history.events.select { |event| event.type == 'WORKFLOW_EXECUTION_UPDATE_ACCEPTED' } + expect(accepted.map { |event| event.attributes.protocol_instance_id }).not_to include('pending-validator', 'finished-validator') + Temporal::Testing::ReplayTester.new(config: @config).replay_history(UpdateValidatorFutureIntegrationWorkflow, history) + end + + it 'retains ownership in a failed Activity callback, rejects continuing as new, and replays the failure' do + first = with_start('one') + update_id = 'failed-continue-as-new' + expect do + @client.execute_workflow_update(nil, 'callback_guard', @workflow_id, first.run_id, + update_id: update_id, timeout: 20) + end.to raise_error(Temporal::WorkflowUpdateFailed, /Update handlers cannot/) + status = @client.query_workflow(nil, 'callback_status', @workflow_id, first.run_id) + expect(status['info'][:id]).to eq(update_id) + expect(status['info'][:name]).to eq('callback_guard') + expect(status['unwound']).to eq(true) + expect(with_start('after-callback').result['values']).to eq(['activity:one', 'activity:after-callback']) + @client.signal_workflow(nil, 'stop', @workflow_id, first.run_id) + @client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: first.run_id, timeout: 20) + history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: first.run_id) + Temporal::Testing::ReplayTester.new(config: @config).replay_history(UpdateIntegrationWorkflow, history) + end + + it 'automatically defers workflow completion across tasks until a blocked accepted Update finishes, then replays both outcomes' do + handle = @client.start_update_with_start_workflow(UpdateAutoCompletionIntegrationWorkflow, 'block', + options: { workflow_id: @workflow_id }, workflow_id_conflict_policy: :use_existing, + wait_for_stage: :accepted, timeout: 20) + expect(@client.query_workflow(nil, 'main_returned', @workflow_id, handle.run_id)).to eq(true) + blocked_history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: handle.run_id) + expect(blocked_history.events.map(&:type)).to include('WORKFLOW_EXECUTION_UPDATE_ACCEPTED') + expect(blocked_history.events.map(&:type)).not_to include('WORKFLOW_EXECUTION_UPDATE_COMPLETED', 'WORKFLOW_EXECUTION_COMPLETED') + @client.signal_workflow(nil, 'release', @workflow_id, handle.run_id) + expect(handle.result(timeout: 20)).to eq('update-result') + expect(@client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: handle.run_id, timeout: 20)).to eq('workflow-result') + history = @client.get_workflow_history(workflow_id: @workflow_id, run_id: handle.run_id) + types = history.events.map(&:type) + expect(types.index('WORKFLOW_EXECUTION_UPDATE_COMPLETED')).to be < types.index('WORKFLOW_EXECUTION_COMPLETED') + Temporal::Testing::ReplayTester.new(config: @config).replay_history(UpdateAutoCompletionIntegrationWorkflow, history) + end + + it 'deduplicates concurrent requests for the same Update ID and returns the original result' do + handles = 3.times.map { Thread.new { with_start('duplicate', id: 'same-update') } }.map(&:value) + expect(handles.map(&:run_id).uniq.size).to eq(1) + expect(handles.map { |handle| handle.result['values'] }.uniq).to eq([['activity:duplicate']]) + expect(with_start('different-input', id: 'same-update').result['values']).to eq(['activity:duplicate']) + end + + it 'serializes concurrent handlers safely across Activity waits' do + handles = 3.times.map { |i| Thread.new { with_start("concurrent-#{i}") } }.map(&:value) + expect(handles.map { |h| h.result['values'].size }.sort).to eq([1, 2, 3]) + end + + it 'waits for acceptance, survives worker restart, and reattaches to the exact Update run' do + handle = with_start('block', id: 'restart-update', wait: :accepted) + stop_worker + start_worker + @client.execute_workflow_update(nil, 'release', @workflow_id, handle.run_id, timeout: 20) + attached = @client.get_workflow_update_handle(@workflow_id, handle.run_id, handle.update_id) + expect(attached.result(timeout: 20)['values']).to eq(['activity:block']) + end + + it 'honors running conflict and completed reuse policies' do + first = with_start('one') + expect { with_start('conflict', policy: :fail) }.to raise_error(GRPC::AlreadyExists) + @client.signal_workflow(nil, 'stop', @workflow_id, first.run_id) + @client.await_workflow_result(nil, workflow_id: @workflow_id, run_id: first.run_id, timeout: 20) + expect { with_start('closed-conflict', reuse: :reject) }.to raise_error(GRPC::AlreadyExists) + next_run = with_start('new-run', reuse: :allow) + expect(next_run.run_id).not_to eq(first.run_id) + expect(next_run.result['values']).to eq(['activity:new-run']) + end + + it 'replays Updates reapplied by a reset onto a new history branch' do + first = with_start('before-reset') + reset_run = @client.reset_workflow('default', @workflow_id, first.run_id, workflow_task_id: 4, + reset_reapply_type: nil, reason: 'isolated Update replay integration') + replayed = @client.get_workflow_update_handle(@workflow_id, reset_run, first.update_id) + expect(replayed.result(timeout: 20)['values']).to eq(['activity:before-reset']) + expect(@client.execute_workflow_update(nil, 'append', @workflow_id, reset_run, 'after-reset', timeout: 20)['values']).to eq( + ['activity:before-reset', 'activity:after-reset']) + end + + it 'preserves existing start and Signal-With-Start behavior' do + run_id = @client.start_workflow(UpdateIntegrationWorkflow, 'account-1', options: { + workflow_id: @workflow_id, signal_name: 'append', signal_input: 'signal-value' + }) + result = @client.execute_workflow_update(nil, 'append', @workflow_id, run_id, 'updated', timeout: 20) + expect(result['values']).to eq(['signal-value', 'activity:updated']) + end +end diff --git a/spec/unit/lib/temporal/client_updates_spec.rb b/spec/unit/lib/temporal/client_updates_spec.rb new file mode 100644 index 000000000..2c4bf2f84 --- /dev/null +++ b/spec/unit/lib/temporal/client_updates_spec.rb @@ -0,0 +1,123 @@ +describe 'Workflow Update client' do + let(:config) { Temporal::Configuration.new } + let(:converter) { config.converter } + let(:connection) { Temporal::Connection.generate(config.for_connection) } + let(:stub) { double('workflow service') } + let(:client) { Temporal::Client.new(config) } + let(:service) { Temporalio::Api::WorkflowService::V1 } + let(:ref) do + Temporalio::Api::Update::V1::UpdateRef.new(update_id: 'update-id', + workflow_execution: Temporalio::Api::Common::V1::WorkflowExecution.new(workflow_id: 'workflow-id', run_id: 'run-id')) + end + let(:accepted) { service::UpdateWorkflowExecutionResponse.new(update_ref: ref, stage: 2) } + let(:completed) do + service::UpdateWorkflowExecutionResponse.new(update_ref: ref, stage: 3, + outcome: Temporalio::Api::Update::V1::Outcome.new(success: converter.to_result_payloads('result'))) + end + + before do + allow(client).to receive(:connection).and_return(connection) + allow(connection).to receive(:client).and_return(stub) + end + + def multi_response(update, started: true) + service::ExecuteMultiOperationResponse.new(responses: [ + service::ExecuteMultiOperationResponse::Response.new(start_workflow: service::StartWorkflowExecutionResponse.new(run_id: 'run-id', started: started)), + service::ExecuteMultiOperationResponse::Response.new(update_workflow: update) + ]) + end + + it 'uses a single ordered atomic multi-operation and keeps arguments and IDs distinct' do + options = { workflow_id: 'workflow-id', workflow_id_reuse_policy: :reject, task_queue: 'billing' }.freeze + expect(stub).to receive(:execute_multi_operation) do |request, rpc_options| + expect(rpc_options[:deadline]).to be > Time.now + expect(request.operations.size).to eq(2) + start = request.operations[0].start_workflow + update = request.operations[1].update_workflow + expect(start.workflow_id).to eq('workflow-id') + expect(start.workflow_id_conflict_policy).to eq(:WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING) + expect(start.workflow_id_reuse_policy).to eq(:WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE) + expect(start.request_id).to eq('start-request-id') + expect(converter.from_payloads(start.input)).to eq(['account']) + expect(update.workflow_execution.workflow_id).to eq(start.workflow_id) + expect(update.workflow_execution.run_id).to eq('') + expect(update.request.meta.update_id).to eq('update-id') + expect(converter.from_payloads(update.request.input.args)).to eq(['invoice']) + expect(update.wait_policy.lifecycle_stage).to eq(:UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED) + multi_response(completed) + end + result = client.execute_update_with_start_workflow('Billing', 'cancel', 'invoice', start_args: ['account'], + options: options, update_id: 'update-id', request_id: 'start-request-id', workflow_id_conflict_policy: :use_existing) + expect(result).to eq('result') + end + + it 'returns an accepted handle pinned to the selected run and waits for a completion outcome' do + allow(stub).to receive(:execute_multi_operation).and_return(multi_response(accepted, started: false)) + handle = client.start_update_with_start_workflow('Billing', 'cancel', options: { workflow_id: 'workflow-id' }, + workflow_id_conflict_policy: :use_existing) + expect([handle.workflow_id, handle.run_id, handle.update_id, handle.workflow_started]).to eq(['workflow-id', 'run-id', 'update-id', false]) + calls = 0 + expect(stub).to receive(:poll_workflow_execution_update).twice do |request, rpc_options| + expect(request.update_ref).to eq(ref) + calls += 1 + service::PollWorkflowExecutionUpdateResponse.new(stage: calls == 1 ? 2 : 3, outcome: calls == 1 ? nil : completed.outcome) + end + expect(handle.result).to eq('result') + expect(handle.result).to eq('result') + end + + it 'retries a transient RPC failure and an early server response with the exact same IDs' do + requests = [] + allow(connection).to receive(:sleep) + expect(stub).to receive(:execute_multi_operation).exactly(3).times do |request, **| + requests << request + raise GRPC::Unavailable, 'connection lost' if requests.size == 1 + multi_response(requests.size == 2 ? service::UpdateWorkflowExecutionResponse.new(stage: 0) : accepted, started: requests.size == 2) + end + handle = client.start_update_with_start_workflow('Billing', 'cancel', options: { workflow_id: 'workflow-id' }, + update_id: 'update-id', request_id: 'request-id', workflow_id_conflict_policy: :use_existing) + expect(handle.workflow_started).to eq(true) + expect(requests.map(&:object_id).uniq.size).to eq(1) + expect(requests.first.operations.first.start_workflow.request_id).to eq('request-id') + end + + it 'supports plain Update requests with a first-run guard and headers' do + expect(stub).to receive(:update_workflow_execution) do |request, **| + expect(request.first_execution_run_id).to eq('first-run') + expect(request.workflow_execution.run_id).to eq('run-id') + expect(converter.from_payload_map(request.request.input.header.fields)).to eq('trace' => 'context') + completed + end + expect(client.execute_workflow_update(nil, 'cancel', 'workflow-id', 'run-id', 'arg', + update_id: 'update-id', first_execution_run_id: 'first-run', headers: { 'trace' => 'context' })).to eq('result') + end + + it 'returns validator and handler failures through the handle with their cause' do + failure = Temporal::Connection::Serializer::Failure.new(ArgumentError.new('bad invoice'), converter).to_proto + rejected = service::UpdateWorkflowExecutionResponse.new(update_ref: ref, stage: 3, + outcome: Temporalio::Api::Update::V1::Outcome.new(failure: failure)) + allow(stub).to receive(:update_workflow_execution).and_return(rejected) + expect { client.execute_workflow_update(nil, 'cancel', 'workflow-id') }.to raise_error(Temporal::WorkflowUpdateFailed) do |e| + expect(e.cause).to be_a(ArgumentError) + expect(e.update_id).to eq('update-id') + end + end + + it 'rejects invalid stages, missing workflow IDs and unsupported start options before any RPC' do + expect { client.start_workflow_update(nil, 'u', 'w', wait_for_stage: :admitted) }.to raise_error(ArgumentError) + expect { client.start_update_with_start_workflow('W', 'u', workflow_id_conflict_policy: :use_existing) }.to raise_error(ArgumentError) + expect { client.start_update_with_start_workflow('W', 'u', workflow_id_conflict_policy: :use_existing, + options: { workflow_id: 'w', start_delay: 1 }) }.to raise_error(ArgumentError) + end + + it 'does not retry permanent multi-operation errors' do + expect(stub).to receive(:execute_multi_operation).once.and_raise(GRPC::InvalidArgument, 'invalid') + expect { client.start_update_with_start_workflow('W', 'u', options: { workflow_id: 'w' }, + workflow_id_conflict_policy: :fail) }.to raise_error(GRPC::InvalidArgument) + end + + it 'bounds waiting without claiming the update was canceled' do + allow(stub).to receive(:update_workflow_execution).and_raise(GRPC::DeadlineExceeded, 'deadline') + expect { client.start_workflow_update(nil, 'u', 'w', timeout: 0.005) }.to raise_error(Temporal::TimeoutError, /may still be running/) + end +end diff --git a/spec/unit/lib/temporal/workflow/context_spec.rb b/spec/unit/lib/temporal/workflow/context_spec.rb index 05a612824..860dacb79 100644 --- a/spec/unit/lib/temporal/workflow/context_spec.rb +++ b/spec/unit/lib/temporal/workflow/context_spec.rb @@ -18,7 +18,8 @@ def execute end describe Temporal::Workflow::Context do - let(:state_manager) { instance_double('Temporal::Workflow::StateManager') } + let(:state_manager) { instance_double('Temporal::Workflow::StateManager', update_registry: update_registry) } + let(:update_registry) { instance_double(Temporal::Workflow::UpdateRegistry, validating?: false, registered?: false, active_count: 0) } let(:dispatcher) { Temporal::Workflow::Dispatcher.new } let(:query_registry) do double = instance_double('Temporal::Workflow::QueryRegistry') diff --git a/spec/unit/lib/temporal/workflow/update_execution_spec.rb b/spec/unit/lib/temporal/workflow/update_execution_spec.rb new file mode 100644 index 000000000..bdf9e9a36 --- /dev/null +++ b/spec/unit/lib/temporal/workflow/update_execution_spec.rb @@ -0,0 +1,139 @@ +require 'temporal/workflow/context' +require 'temporal/workflow/query_registry' + +describe Temporal::Workflow::UpdateExecution do + let(:config) { Temporal::Configuration.new } + let(:dispatcher) { Temporal::Workflow::Dispatcher.new } + let(:state) { Temporal::Workflow::StateManager.new(dispatcher, config) } + let(:context) do + Temporal::Workflow::Context.new(state, dispatcher, Temporal::Workflow, Fabricate(:workflow_metadata), + config, Temporal::Workflow::QueryRegistry.new, false) + end + let(:info) { { id: 'owning-update', name: 'callback-test', headers: { 'trace' => 'trace-id' } }.freeze } + let(:completions) { [] } + let(:execution) { described_class.new(context, info) { |result, error| completions << [result, error] } } + # Deliberately create outside the Update; registration determines ownership. + let!(:future) { Temporal::Workflow::Future.new(:shared_future, context) } + + before { context.on_update('registered') {} } + + def resolve(callback_type) + callback_type == :done ? future.set('activity-result') : future.fail(StandardError.new('activity-failure')) + callbacks = callback_type == :done ? future.success_callbacks : future.failure_callbacks + callbacks.each { |callback| context.send(:call_in_fiber, callback, 'callback-argument') } + end + + # Each closure guard is distinct; callback ownership is shared by both paths. + [[:done, :complete], [:failed, :fail], [:done, :continue_as_new]].each do |callback_type, close_method| + it "preserves Update ownership in #{callback_type}, guards #{close_method}, and unwinds its suspended handler" do + seen = nil + unwound = false + execution.start do + future.public_send(callback_type) do + seen = context.current_update + argument = close_method == :fail ? StandardError.new('must not fail workflow') : nil + context.public_send(close_method, argument) + end + begin + context.wait_until { false } + ensure + unwound = true + end + end + expect(completions).to be_empty + resolve(callback_type) + expect(seen).to eq(info) + expect(unwound).to eq(true) + expect(completions.size).to eq(1) + expect(completions.first.last).to be_a(ArgumentError) + expect(state.final_commands).to be_empty + expect(context.current_update).to be_nil + expect(Thread.current[described_class::CURRENT_KEY]).to be_nil + end + end + + it 'delivers callback errors to the handler rescue block instead of stranding a wait condition' do + execution.start do + future.done { context.complete } + begin + context.wait_until { false } + rescue ArgumentError + 'handled callback failure' + end + end + resolve(:done) + expect(completions).to eq([['handled callback failure', nil]]) + end + + it 'waits for an owned callback after the main handler has returned, including across another yield' do + released = false + seen = nil + execution.start do + future.done do + context.wait_until { released } + seen = context.current_update + end + 'handler-result' + end + expect(completions).to be_empty + resolve(:done) + expect(completions).to be_empty + released = true + dispatcher.dispatch(:release, 'released') + expect(completions).to eq([['handler-result', nil]]) + expect(seen).to eq(info) + end + + it 'fails the still-pending Update if its callback raises ScriptError after the handler returns' do + execution.start do + future.done { raise NotImplementedError, 'callback not implemented' } + 'must not report success early' + end + expect(completions).to be_empty + resolve(:done) + expect(completions.size).to eq(1) + expect(completions.first.last).to be_a(NotImplementedError) + end + + it 'discards the unselected success/failure callback so it cannot hold the Update open forever' do + invoked = [] + execution.start do + future.done { invoked << :done } + future.failed { invoked << :failed } + 'result' + end + resolve(:done) + expect(invoked).to eq([:done]) + expect(completions).to eq([['result', nil]]) + end + + it 'preserves closure guards and failure delivery for an already-fulfilled Future callback' do + future.set('already-ready') + execution.start { future.done { context.complete } } + expect(completions.first.last).to be_a(ArgumentError) + expect(state.final_commands).to be_empty + end + + it 'keeps callbacks from concurrent Updates and the main workflow separate on a shared Future' do + seen = [] + other_completions = [] + other_info = { id: 'other-update', name: 'callback-test', headers: {} }.freeze + other = described_class.new(context, other_info) { |result, error| other_completions << [result, error] } + future.done { seen << context.current_update } + execution.start do + future.done do + seen << context.current_update + raise ArgumentError, 'first update failed' + end + 'first result' + end + other.start do + future.done { seen << context.current_update } + 'other result' + end + resolve(:done) + expect(seen).to eq([nil, info, other_info]) + expect(completions.first.last).to be_a(ArgumentError) + expect(other_completions).to eq([['other result', nil]]) + end +end diff --git a/spec/unit/lib/temporal/workflow/update_spec.rb b/spec/unit/lib/temporal/workflow/update_spec.rb new file mode 100644 index 000000000..ec56d0f1e --- /dev/null +++ b/spec/unit/lib/temporal/workflow/update_spec.rb @@ -0,0 +1,281 @@ +require 'temporal/workflow/executor' +require 'temporal/workflow/history' +require 'temporal/middleware/chain' + +describe 'Workflow Updates' do + let(:config) { Temporal::Configuration.new } + let(:converter) { config.converter } + let(:metadata) { Fabricate(:workflow_task_metadata) } + let(:events) do + [Fabricate(:api_workflow_execution_started_event, event_id: 1), + Fabricate(:api_workflow_task_scheduled_event, event_id: 2), + Fabricate(:api_workflow_task_started_event, event_id: 3)] + end + + class UpdateTestWorkflow < Temporal::Workflow + class << self + attr_accessor :validations, :executions, :reject, :blocking_validator + end + + def execute + @values = [] + workflow.on_update('append', validator: lambda { |value| + self.class.validations += 1 + workflow.sleep(1) if self.class.blocking_validator + raise ArgumentError, 'rejected' if self.class.reject + }) do |value| + self.class.executions += 1 + @values << value + @values.dup + end + workflow.on_update('release') { @released = true } + workflow.on_update('blocked') do + workflow.wait_until { @released } + workflow.sleep(1) + 'after-timer' + end + workflow.on_update('finish') { @finished = true } + workflow.wait_until { @finished } + @values + end + end + + class UpdateExceptionTestWorkflow < Temporal::Workflow + def execute + workflow.on_update('script_validator', validator: ->(*) { raise NotImplementedError, 'validator not implemented' }) {} + workflow.on_update('script_handler') { raise NotImplementedError, 'handler not implemented' } + workflow.wait_until { false } + end + end + + class UpdateAutoCompletionWorkflow < Temporal::Workflow + def execute + workflow.on_update('delayed') do + @received = true + workflow.sleep(1) + 'update-result' + end + workflow.wait_until { @received } + 'workflow-result' + end + end + + class UpdateValidatorCallbackWorkflow < Temporal::Workflow + class << self + attr_accessor :futures, :callback_runs + end + + def execute + # No creator context: registration must check the active validator. + self.class.futures = [:pending, :ready, :failed].to_h do |state| + [state, Temporal::Workflow::Future.new(state, nil)] + end + self.class.futures[:ready].set('success') + self.class.futures[:failed].fail(StandardError.new('failure')) + self.class.callback_runs = 0 + workflow.on_update('register_callback', validator: lambda { |options| + self.class.futures[options[:state]].public_send(options[:callback]) do + self.class.callback_runs += 1 + workflow.complete('must not close the workflow') + end + }) { 'must not accept the update' } + workflow.on_update('finish') { @finished = true } + workflow.wait_until { @finished } + 'workflow-result' + end + end + + before do + UpdateTestWorkflow.validations = UpdateTestWorkflow.executions = 0 + UpdateTestWorkflow.reject = UpdateTestWorkflow.blocking_validator = false + end + + def message(name = 'append', id: 'u1', sequence: 2, input: 'one', headers: {}) + request = Temporalio::Api::Update::V1::Request.new( + meta: Temporalio::Api::Update::V1::Meta.new(update_id: id), + input: Temporalio::Api::Update::V1::Input.new(name: name, args: converter.to_payloads([input]), + header: Temporalio::Api::Common::V1::Header.new(fields: converter.to_payload_map(headers))) + ) + Temporalio::Api::Protocol::V1::Message.new(id: "#{id}/request", protocol_instance_id: id, + event_id: sequence, body: Google::Protobuf::Any.pack(request)) + end + + def run(events, messages = [], workflow = UpdateTestWorkflow) + history = Temporal::Workflow::History.new(events, messages: messages) + Temporal::Workflow::Executor.new(workflow, history, metadata, config, false, Temporal::Middleware::Chain.new).run + end + + def command_events(result, start_id: 5) + result.commands.map.with_index do |(_, command), index| + raise 'only protocol commands supported by helper' unless command.is_a?(Temporal::Workflow::Command::ProtocolMessage) + proto = command.message + if proto.body.type_url.end_with?('Acceptance') + acceptance = Temporalio::Api::Update::V1::Acceptance.decode(proto.body.value) + attrs = Temporalio::Api::History::V1::WorkflowExecutionUpdateAcceptedEventAttributes.new( + protocol_instance_id: proto.protocol_instance_id, + accepted_request_message_id: acceptance.accepted_request_message_id, + accepted_request_sequencing_event_id: acceptance.accepted_request_sequencing_event_id, + accepted_request: acceptance.accepted_request + ) + type = 'accepted' + else + response = Temporalio::Api::Update::V1::Response.decode(proto.body.value) + attrs = Temporalio::Api::History::V1::WorkflowExecutionUpdateCompletedEventAttributes.new( + meta: response.meta, outcome: response.outcome) + type = 'completed' + end + Temporalio::Api::History::V1::HistoryEvent.new(event_id: start_id + index, event_time: Time.now, + event_type: "EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_#{type.upcase}".to_sym, + "workflow_execution_update_#{type}_event_attributes" => attrs) + end + end + + def outcome(result) + Temporalio::Api::Update::V1::Response.decode(result.messages.last.body.value).outcome + end + + it 'records ordered acceptance and completion, then replays without validation or duplicate commands' do + result = run(events, [message]) + expect(result.commands.map(&:first)).to eq([5, 6]) + expect(result.messages.map(&:id)).to eq(['u1/accept', 'u1/complete']) + expect(converter.from_result_payloads(outcome(result).success)).to eq(['one']) + expect(UpdateTestWorkflow.executions).to eq(1) + replay = events + [Fabricate(:api_workflow_task_completed_event, event_id: 4)] + command_events(result) + UpdateTestWorkflow.reject = true + result = run(replay) + expect(result.commands).to be_empty + expect(result.messages).to be_empty + expect(UpdateTestWorkflow.validations).to eq(1) + expect(UpdateTestWorkflow.executions).to eq(2) + end + + it 'delivers a reset-admitted request from history even without a live protocol message' do + request = Temporalio::Api::Update::V1::Request.decode(message.body.value) + admitted = Temporalio::Api::History::V1::HistoryEvent.new(event_id: 2, event_time: Time.now, + event_type: :EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED, + workflow_execution_update_admitted_event_attributes: Temporalio::Api::History::V1::WorkflowExecutionUpdateAdmittedEventAttributes.new(request: request, origin: 1)) + reset_events = [events.first, admitted, Fabricate(:api_workflow_task_scheduled_event, event_id: 3), + Fabricate(:api_workflow_task_started_event, event_id: 4)] + result = run(reset_events) + expect(result.messages.map(&:id)).to eq(['u1/accept', 'u1/complete']) + expect(UpdateTestWorkflow.validations).to eq(1) + recorded = command_events(result, start_id: 6) + # Server omits the duplicate request when it already exists in admission history. + recorded.first.workflow_execution_update_accepted_event_attributes.accepted_request = nil + replay = reset_events + [Fabricate(:api_workflow_task_completed_event, event_id: 5)] + recorded + expect(run(replay).commands).to be_empty + expect(UpdateTestWorkflow.validations).to eq(1) + end + + it 'rejects a header decoding error before acceptance, including redelivery, without leaking an active handler' do + invalid = message(headers: { 'invalid' => 'header' }) + allow(converter).to receive(:from_payload_map).and_wrap_original do |original, fields| + raise ArgumentError, 'cannot decode header' if fields['invalid'] + original.call(fields) + end + 2.times do + result = run(events, [invalid, message('finish', id: 'u2')]) + expect(result.messages.map(&:id)).to match_array(['u1/reject', 'u2/accept', 'u2/complete']) + rejection = Temporalio::Api::Update::V1::Rejection.decode(result.messages.find { |item| item.id == 'u1/reject' }.body.value) + expect(rejection.failure.message).to eq('cannot decode header') + # Main completion is only emitted when active_count is zero. + expect(result.commands.last.last).to be_a(Temporal::Workflow::Command::CompleteWorkflow) + expect(UpdateTestWorkflow.validations).to eq(0) + expect(UpdateTestWorkflow.executions).to eq(0) + end + end + + it 'fails accepted replay as nondeterministic if its recorded headers can no longer be decoded' do + first = run(events, [message(headers: { 'changed' => 'header' })]) + replay = events + [Fabricate(:api_workflow_task_completed_event, event_id: 4)] + command_events(first) + allow(converter).to receive(:from_payload_map).and_wrap_original do |original, fields| + raise ArgumentError, 'cannot decode header' if fields['changed'] + original.call(fields) + end + expect { run(replay) }.to raise_error(Temporal::NonDeterministicWorkflowError, /Cannot replay accepted Update: cannot decode header/) + end + + # Exercise deferred registration and both immediate-callback paths without + # repeating the Cartesian product: each method calls the same pre-branch guard. + [[:done, :pending], [:done, :ready], [:failed, :failed]].each do |callback, state| + it "rejects validator #{callback} registration on a #{state} Future without executing or saving the callback, and replays" do + invalid = message('register_callback', input: { callback: callback, state: state }) + result = run(events, [invalid, message('finish', id: 'u2')], UpdateValidatorCallbackWorkflow) + expect(result.messages.map(&:id)).to match_array(['u1/reject', 'u2/accept', 'u2/complete']) + rejection = Temporalio::Api::Update::V1::Rejection.decode(result.messages.find { |item| item.id == 'u1/reject' }.body.value) + expect(rejection.failure.message).to eq('Update validators must not register Future callbacks') + future = UpdateValidatorCallbackWorkflow.futures[state] + expect(future.success_callbacks + future.failure_callbacks).to be_empty + expect(UpdateValidatorCallbackWorkflow.callback_runs).to eq(0) + expect(result.commands.last.last).to be_a(Temporal::Workflow::Command::CompleteWorkflow) + updates = Temporal::Workflow::Executor::RunResult.new(commands: result.commands[0..1]) + replay = events + [Fabricate(:api_workflow_task_completed_event, event_id: 4)] + command_events(updates) + + [Fabricate(:api_workflow_execution_completed_event, event_id: 7)] + expect(run(replay, [], UpdateValidatorCallbackWorkflow).commands).to be_empty + end + end + + it 'rejects unknown handlers' do + result = run(events, [message('unknown')]) + rejection = Temporalio::Api::Update::V1::Rejection.decode(result.messages.first.body.value) + expect(rejection.failure.message).to include('Unknown Update handler') + end + + it 'prevents validators from scheduling timers' do + UpdateTestWorkflow.blocking_validator = true + result = run(events, [message]) + expect(result.commands).to be_empty + expect(result.messages.first.id).to eq('u1/reject') + end + + it 'rejects a ScriptError from a validator without failing the workflow task' do + result = run(events, [message('script_validator')], UpdateExceptionTestWorkflow) + expect(result.commands).to be_empty + expect(result.messages.map(&:id)).to eq(['u1/reject']) + rejection = Temporalio::Api::Update::V1::Rejection.decode(result.messages.first.body.value) + expect(rejection.failure.application_failure_info.type).to eq('NotImplementedError') + end + + it 'completes an accepted Update with failure when its handler raises ScriptError, and replays it' do + result = run(events, [message('script_handler')], UpdateExceptionTestWorkflow) + expect(result.messages.map(&:id)).to eq(['u1/accept', 'u1/complete']) + expect(outcome(result).failure.application_failure_info.type).to eq('NotImplementedError') + replay = events + [Fabricate(:api_workflow_task_completed_event, event_id: 4)] + command_events(result) + expect(run(replay, [], UpdateExceptionTestWorkflow).commands).to be_empty + end + + it 'deduplicates repeated messages and preserves order between distinct updates' do + result = run(events, [message, message, message(id: 'u2', input: 'two')]) + expect(result.commands.map(&:first)).to eq([5, 6, 7, 8]) + expect(converter.from_result_payloads(outcome(result).success)).to eq(['one', 'two']) + expect(UpdateTestWorkflow.executions).to eq(2) + end + + it 'automatically defers main-workflow completion across tasks until a blocked Update finishes, then replays both completions' do + first = run(events, [message('delayed')], UpdateAutoCompletionWorkflow) + expect(first.commands.map { |_, command| command.class }).to eq([ + Temporal::Workflow::Command::ProtocolMessage, Temporal::Workflow::Command::StartTimer]) + accepted = command_events(Temporal::Workflow::Executor::RunResult.new(commands: [first.commands.first])).first + timer_start = Fabricate(:api_timer_started_event, event_id: 6) + timer_fired = Fabricate(:api_timer_fired_event, event_id: 7, + timer_fired_event_attributes: Temporalio::Api::History::V1::TimerFiredEventAttributes.new(timer_id: '6', started_event_id: 6)) + next_task = events + [Fabricate(:api_workflow_task_completed_event, event_id: 4), accepted, timer_start, + timer_fired, Fabricate(:api_workflow_task_scheduled_event, event_id: 8), Fabricate(:api_workflow_task_started_event, event_id: 9)] + second = run(next_task, [], UpdateAutoCompletionWorkflow) + expect(second.commands.map(&:first)).to eq([11, 12]) + expect(second.messages.map(&:id)).to eq(['u1/complete']) + expect(converter.from_result_payloads(outcome(second).success)).to eq('update-result') + expect(second.commands.last.last.result).to eq('workflow-result') + update_completed = command_events(Temporal::Workflow::Executor::RunResult.new(commands: [second.commands.first]), start_id: 11).first + finished = next_task + [Fabricate(:api_workflow_task_completed_event, event_id: 10), update_completed, + Fabricate(:api_workflow_execution_completed_event, event_id: 12)] + expect(run(finished, [], UpdateAutoCompletionWorkflow).commands).to be_empty + end + + it 'does not resume an Update twice when nested completion dispatch wakes a wait condition' do + result = run(events, [message('blocked'), message('release', id: 'u2')]) + expect(result.messages.map(&:id)).to eq(['u1/accept', 'u2/accept', 'u2/complete']) + expect(result.commands.last.last).to be_a(Temporal::Workflow::Command::StartTimer) + end + +end From c5e09e01c434519d7068a5c69f6e8db20d152208 Mon Sep 17 00:00:00 2001 From: Kevin Stewart Date: Tue, 17 Nov 2026 16:17:38 -0800 Subject: [PATCH 2/3] Run Update integration CI with the published Temporal 1.32 CLI --- .github/workflows/tests.yml | 14 +++++++++++--- examples/docker-compose-updates.yml | 22 ---------------------- 2 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 examples/docker-compose-updates.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6957eb44a..15679900c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,12 @@ jobs: ruby-version: '3.4' bundler-cache: true - name: Start Temporal 1.32 - run: docker compose -f examples/docker-compose-updates.yml up -d + run: | + curl -fsSL https://github.com/temporalio/cli/releases/download/v1.9.1/temporal_cli_1.9.1_linux_amd64.tar.gz -o "$RUNNER_TEMP/temporal.tar.gz" + echo "09a0326a51db84d02735e53542b9ebd8c4758daf47482a9ab0abce15844e60d5 $RUNNER_TEMP/temporal.tar.gz" | sha256sum --check + tar -xzf "$RUNNER_TEMP/temporal.tar.gz" -C "$RUNNER_TEMP" temporal + "$RUNNER_TEMP/temporal" server start-dev --port "$TEMPORAL_UPDATE_PORT" --headless > "$RUNNER_TEMP/temporal.log" 2>&1 & + echo "$!" > "$RUNNER_TEMP/temporal.pid" - name: Wait for the default namespace run: | bundle exec ruby -rtemporal -rtimeout <<'RUBY' @@ -63,10 +68,13 @@ jobs: run: bundle exec rspec spec/integration/update_with_start_spec.rb - name: Show server logs on failure if: failure() - run: docker compose -f examples/docker-compose-updates.yml logs --tail=100 + run: tail -100 "$RUNNER_TEMP/temporal.log" - name: Stop dependencies if: always() - run: docker compose -f examples/docker-compose-updates.yml down -v + run: | + if [ -f "$RUNNER_TEMP/temporal.pid" ]; then + kill "$(cat "$RUNNER_TEMP/temporal.pid")" + fi test_gem: runs-on: ubuntu-latest diff --git a/examples/docker-compose-updates.yml b/examples/docker-compose-updates.yml deleted file mode 100644 index f23fca394..000000000 --- a/examples/docker-compose-updates.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - temporal: - image: temporalio/auto-setup:1.32.0 - ports: - - "7233:7233" - environment: - - "DB=postgres12" - - "DB_PORT=5432" - - "POSTGRES_USER=temporal" - - "POSTGRES_PWD=temporal" - - "POSTGRES_SEEDS=postgresql" - - "DYNAMIC_CONFIG_FILE_PATH=/etc/temporal/config/dynamicconfig/temporal-ruby.yaml" - volumes: - - ./dynamic-config.yml:/etc/temporal/config/dynamicconfig/temporal-ruby.yaml - depends_on: - - postgresql - - postgresql: - image: postgres:16 - environment: - POSTGRES_USER: temporal - POSTGRES_PASSWORD: temporal From 77b8d77a57e210345efe2f92d22080c071eda98a Mon Sep 17 00:00:00 2001 From: Kevin Stewart Date: Tue, 17 Nov 2026 16:28:45 -0800 Subject: [PATCH 3/3] Preserve ordinary Future callbacks in local workflow tests --- lib/temporal/testing/local_workflow_context.rb | 4 ++++ .../testing/local_workflow_context_spec.rb | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/temporal/testing/local_workflow_context.rb b/lib/temporal/testing/local_workflow_context.rb index 7d3321ae6..320c45856 100644 --- a/lib/temporal/testing/local_workflow_context.rb +++ b/lib/temporal/testing/local_workflow_context.rb @@ -240,6 +240,10 @@ def upsert_search_attributes(search_attributes) private + # Local mode does not run Update validators, but ordinary Future callbacks + # share this guard with the server-backed workflow context. + def check_update_validator!(_operation); end + attr_reader :execution, :run_id, :workflow_id, :disabled_releases def completed! diff --git a/spec/unit/lib/temporal/testing/local_workflow_context_spec.rb b/spec/unit/lib/temporal/testing/local_workflow_context_spec.rb index 75600fb3c..8b82151c2 100644 --- a/spec/unit/lib/temporal/testing/local_workflow_context_spec.rb +++ b/spec/unit/lib/temporal/testing/local_workflow_context_spec.rb @@ -76,6 +76,14 @@ def execute describe '#execute_activity' do describe 'outcome is captured in the future' do + around do |example| + previous_context = Temporal::ThreadLocalContext.get + Temporal::ThreadLocalContext.set(workflow_context) + example.run + ensure + Temporal::ThreadLocalContext.set(previous_context) + end + it 'delay failure' do f = workflow_context.execute_activity(TestFailedActivity) f.wait @@ -86,6 +94,9 @@ def execute expect(f.get).to be_a(RuntimeError) expect(f.get.message).to eq('oops') + callback_error = nil + f.failed { |error| callback_error = error } + expect(callback_error).to equal(f.get) end it 'successful synchronous result' do @@ -97,6 +108,9 @@ def execute expect(f.ready?).to be true expect(f.get).to eq('ok') + callback_result = nil + f.done { |result| callback_result = result } + expect(callback_result).to eq('ok') end it 'successful asynchronous result' do