diff --git a/.gitignore b/.gitignore index 9503573d5..1540ce98b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ # sdk-core is a library we allow consumers pin specific versions. Cargo.lock + +/.idea/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..1f49b5a57 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "protos/api_upstream"] + path = protos/api_upstream + url = git@github.com:temporalio/api.git diff --git a/Cargo.toml b/Cargo.toml index b8786e882..bd148b7d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +tonic = "0.3" +prost = "0.6" + +[build-dependencies] +tonic-build = "0.3" \ No newline at end of file diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..d68d98664 --- /dev/null +++ b/build.rs @@ -0,0 +1,12 @@ +fn main() -> Result<(), Box> { + tonic_build::configure() + // We don't actually want to build the grpc definitions - we don't need them (for now). + // Just build the message structs. + .build_server(false) + .build_client(false) + .compile( + &["protos/core_interface.proto"], + &["protos/api_upstream", "protos"], + )?; + Ok(()) +} \ No newline at end of file diff --git a/protos/api_upstream/.buildkite/Dockerfile b/protos/api_upstream/.buildkite/Dockerfile new file mode 100644 index 000000000..5cfd8b840 --- /dev/null +++ b/protos/api_upstream/.buildkite/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.15.6 + +RUN apt update && apt install -y --no-install-recommends \ + protobuf-compiler \ + && rm -rf /var/lib/apt/lists/* \ +# https://github.com/docker-library/golang/blob/c1baf037d71331eb0b8d4c70cff4c29cf124c5e0/1.4/Dockerfile + && mkdir -p /temporal + +WORKDIR /temporal diff --git a/protos/api_upstream/.buildkite/docker-compose.yml b/protos/api_upstream/.buildkite/docker-compose.yml new file mode 100644 index 000000000..96acbfbc3 --- /dev/null +++ b/protos/api_upstream/.buildkite/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.5" + +services: + build: + build: + context: .. + dockerfile: ./.buildkite/Dockerfile + environment: + - BUILDKITE_AGENT_ACCESS_TOKEN + - BUILDKITE_JOB_ID + - BUILDKITE_BUILD_ID + - BUILDKITE_BUILD_NUMBER + volumes: + - ../:/temporal + - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent diff --git a/protos/api_upstream/.buildkite/pipeline.yml b/protos/api_upstream/.buildkite/pipeline.yml new file mode 100644 index 000000000..1bb6abd13 --- /dev/null +++ b/protos/api_upstream/.buildkite/pipeline.yml @@ -0,0 +1,10 @@ +steps: + - label: "build" + agents: + queue: "default" + docker: "*" + command: "make" + plugins: + - docker-compose#v3.1.0: + run: build + config: ./.buildkite/docker-compose.yml diff --git a/protos/api_upstream/.gitignore b/protos/api_upstream/.gitignore new file mode 100644 index 000000000..692986f12 --- /dev/null +++ b/protos/api_upstream/.gitignore @@ -0,0 +1,2 @@ +/.idea +/.gen \ No newline at end of file diff --git a/protos/api_upstream/LICENSE b/protos/api_upstream/LICENSE new file mode 100644 index 000000000..c53d53983 --- /dev/null +++ b/protos/api_upstream/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/protos/api_upstream/Makefile b/protos/api_upstream/Makefile new file mode 100644 index 000000000..d41ba8c5b --- /dev/null +++ b/protos/api_upstream/Makefile @@ -0,0 +1,78 @@ +$(VERBOSE).SILENT: +############################# Main targets ############################# +# Install everything, run all linters, and compile proto files. +install: grpc-install api-linter-install buf-install proto + +# Run all linters and compile proto files. +proto: grpc +######################################################################## + +##### Variables ###### +ifndef GOPATH +GOPATH := $(shell go env GOPATH) +endif + +GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH)/bin) +SHELL := PATH=$(GOBIN):$(PATH) /bin/sh + +COLOR := "\e[1;36m%s\e[0m\n" + +PROTO_ROOT := . +PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto") +PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) +PROTO_OUT := .gen +PROTO_IMPORTS := -I=$(PROTO_ROOT) -I=$(GOPATH)/src/github.com/temporalio/gogo-protobuf/protobuf + +$(PROTO_OUT): + mkdir $(PROTO_OUT) + +##### Compile proto files for go ##### +grpc: buf-lint api-linter buf-breaking gogo-grpc fix-path + +go-grpc: clean $(PROTO_OUT) + printf $(COLOR) "Compile for go-gRPC..." + $(foreach PROTO_DIR,$(PROTO_DIRS),protoc $(PROTO_IMPORTS) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;) + +gogo-grpc: clean $(PROTO_OUT) + printf $(COLOR) "Compile for gogo-gRPC..." + $(foreach PROTO_DIR,$(PROTO_DIRS),protoc $(PROTO_IMPORTS) --gogoslick_out=Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;) + +fix-path: + mv -f $(PROTO_OUT)/temporal/api/* $(PROTO_OUT) && rm -rf $(PROTO_OUT)/temporal + +##### Plugins & tools ##### +grpc-install: gogo-protobuf-install + printf $(COLOR) "Install/update gRPC plugins..." + GO111MODULE=on go get google.golang.org/grpc@v1.34.0 + +gogo-protobuf-install: go-protobuf-install + go get github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick + +go-protobuf-install: + GO111MODULE=on go get github.com/golang/protobuf/protoc-gen-go@v1.4.3 + +api-linter-install: + printf $(COLOR) "Install/update api-linter..." + GO111MODULE=on go get github.com/googleapis/api-linter/cmd/api-linter@v1.10.0 + +buf-install: + printf $(COLOR) "Install/update buf..." + GO111MODULE=on go get github.com/bufbuild/buf/cmd/buf@v0.33.0 + +##### Linters ##### +api-linter: + printf $(COLOR) "Run api-linter..." + api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES) + +buf-lint: + printf $(COLOR) "Run buf linter..." + (cd $(PROTO_ROOT) && buf check lint) + +buf-breaking: + @printf $(COLOR) "Run buf breaking changes check against master branch..." + @(cd $(PROTO_ROOT) && buf check breaking --against '.git#branch=master') + +##### Clean ##### +clean: + printf $(COLOR) "Delete generated go files..." + rm -rf $(PROTO_OUT) diff --git a/protos/api_upstream/README.md b/protos/api_upstream/README.md new file mode 100644 index 000000000..3ec1927a8 --- /dev/null +++ b/protos/api_upstream/README.md @@ -0,0 +1,7 @@ +# Temporal proto files + +Install as git submodule to the project. + +## License + +MIT License, please see [LICENSE](LICENSE) for details. diff --git a/protos/api_upstream/api-linter.yaml b/protos/api_upstream/api-linter.yaml new file mode 100644 index 000000000..98a8b6e0d --- /dev/null +++ b/protos/api_upstream/api-linter.yaml @@ -0,0 +1,38 @@ +- included_paths: + - '**/*.proto' + disabled_rules: + - 'core::0192::has-comments' + +- included_paths: + - '**/message.proto' + disabled_rules: + - 'core::0122::name-suffix' + - 'core::0123::resource-annotation' + +- included_paths: + - '**/workflowservice/v1/request_response.proto' + disabled_rules: + - 'core::0122::name-suffix' + - 'core::0131::request-name-required' + - 'core::0131::request-unknown-fields' + - 'core::0132::request-parent-required' + - 'core::0132::request-unknown-fields' + - 'core::0132::response-unknown-fields' + - 'core::0134::request-unknown-fields' + - 'core::0158::request-page-size-field' + - 'core::0158::request-page-token-field' + - 'core::0158::response-next-page-token-field' + - 'core::0158::response-plural-first-field' + - 'core::0158::response-repeated-first-field' + +- included_paths: + - '**/workflowservice/v1/service.proto' + disabled_rules: + - 'core::0127::http-annotation' + - 'core::0131::method-signature' + - 'core::0131::response-message-name' + +- included_paths: + - 'dependencies/gogoproto/gogo.proto' + disabled_rules: + - 'all' diff --git a/protos/api_upstream/buf.yaml b/protos/api_upstream/buf.yaml new file mode 100644 index 000000000..3d72473a4 --- /dev/null +++ b/protos/api_upstream/buf.yaml @@ -0,0 +1,12 @@ +version: v1beta1 +build: + roots: + - . +lint: + ignore: + - dependencies + use: + - DEFAULT +breaking: + use: + - PACKAGE \ No newline at end of file diff --git a/protos/api_upstream/dependencies/gogoproto/gogo.proto b/protos/api_upstream/dependencies/gogoproto/gogo.proto new file mode 100644 index 000000000..49837cc64 --- /dev/null +++ b/protos/api_upstream/dependencies/gogoproto/gogo.proto @@ -0,0 +1,141 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/temporalio/gogo-protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; +} diff --git a/protos/api_upstream/temporal/api/command/v1/message.proto b/protos/api_upstream/temporal/api/command/v1/message.proto new file mode 100644 index 000000000..c9a043e3c --- /dev/null +++ b/protos/api_upstream/temporal/api/command/v1/message.proto @@ -0,0 +1,191 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.command.v1; + +option go_package = "go.temporal.io/api/command/v1;command"; +option java_package = "io.temporal.api.command.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Command::V1"; + +import "google/protobuf/duration.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/enums/v1/command_type.proto"; +import "temporal/api/common/v1/message.proto"; +import "temporal/api/failure/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; + +message ScheduleActivityTaskCommandAttributes { + string activity_id = 1; + temporal.api.common.v1.ActivityType activity_type = 2; + string namespace = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Header header = 5; + temporal.api.common.v1.Payloads input = 6; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Indicates how long the caller is willing to wait for an activity completion. + // Limits for how long retries are happening. Either this or start_to_close_timeout_seconds must be specified. + // When not specified defaults to the workflow execution timeout. + google.protobuf.Duration schedule_to_close_timeout = 7 [(gogoproto.stdduration) = true]; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Limits time an activity task can stay in a task queue before a worker picks it up. + // This timeout is always non retryable as all a retry would achieve is to put it back into the same queue. + // Defaults to schedule_to_close_timeout_seconds or workflow execution timeout if not specified. + google.protobuf.Duration schedule_to_start_timeout = 8 [(gogoproto.stdduration) = true]; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Maximum time an activity is allowed to execute after a pick up by a worker. + // This timeout is always retryable. Either this or schedule_to_close_timeout_seconds must be specified. + google.protobuf.Duration start_to_close_timeout = 9 [(gogoproto.stdduration) = true]; + // Maximum time between successful worker heartbeats. + google.protobuf.Duration heartbeat_timeout = 10 [(gogoproto.stdduration) = true]; + // Activities are provided by a default retry policy controlled through the service dynamic configuration. + // Retries are happening up to schedule_to_close_timeout. + // To disable retries set retry_policy.maximum_attempts to 1. + temporal.api.common.v1.RetryPolicy retry_policy = 11; +} + +message RequestCancelActivityTaskCommandAttributes { + int64 scheduled_event_id = 1; +} + +message StartTimerCommandAttributes { + string timer_id = 1; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_fire_timeout = 2 [(gogoproto.stdduration) = true]; +} + +message CompleteWorkflowExecutionCommandAttributes { + temporal.api.common.v1.Payloads result = 1; +} + +message FailWorkflowExecutionCommandAttributes { + temporal.api.failure.v1.Failure failure = 1; +} + +message CancelTimerCommandAttributes { + string timer_id = 1; +} + +message CancelWorkflowExecutionCommandAttributes { + temporal.api.common.v1.Payloads details = 1; +} + +message RequestCancelExternalWorkflowExecutionCommandAttributes { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string control = 4; + bool child_workflow_only = 5; +} + +message SignalExternalWorkflowExecutionCommandAttributes { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution execution = 2; + string signal_name = 3; + temporal.api.common.v1.Payloads input = 4; + string control = 5; + bool child_workflow_only = 6; +} + +message UpsertWorkflowSearchAttributesCommandAttributes { + temporal.api.common.v1.SearchAttributes search_attributes = 1; +} + +message RecordMarkerCommandAttributes { + string marker_name = 1; + map details = 2; + temporal.api.common.v1.Header header = 3; + temporal.api.failure.v1.Failure failure = 4; +} + +message ContinueAsNewWorkflowExecutionCommandAttributes { + temporal.api.common.v1.WorkflowType workflow_type = 1; + temporal.api.taskqueue.v1.TaskQueue task_queue = 2; + temporal.api.common.v1.Payloads input = 3; + // workflow_execution_timeout is omitted as it shouldn'be overridden from within a workflow. + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 4 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 5 [(gogoproto.stdduration) = true]; + google.protobuf.Duration backoff_start_interval = 6 [(gogoproto.stdduration) = true]; + temporal.api.common.v1.RetryPolicy retry_policy = 7; + temporal.api.enums.v1.ContinueAsNewInitiator initiator = 8; + temporal.api.failure.v1.Failure failure = 9; + temporal.api.common.v1.Payloads last_completion_result = 10; + string cron_schedule = 11; + temporal.api.common.v1.Header header = 12; + temporal.api.common.v1.Memo memo = 13; + temporal.api.common.v1.SearchAttributes search_attributes = 14; +} + +message StartChildWorkflowExecutionCommandAttributes { + string namespace = 1; + string workflow_id = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Payloads input = 5; + // Total workflow execution timeout including retries and continue as new. + google.protobuf.Duration workflow_execution_timeout = 6 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 7 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 8 [(gogoproto.stdduration) = true]; + // Default: PARENT_CLOSE_POLICY_TERMINATE. + temporal.api.enums.v1.ParentClosePolicy parent_close_policy = 9; + string control = 10; + // Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE. + temporal.api.enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 11; + temporal.api.common.v1.RetryPolicy retry_policy = 12; + string cron_schedule = 13; + temporal.api.common.v1.Header header = 14; + temporal.api.common.v1.Memo memo = 15; + temporal.api.common.v1.SearchAttributes search_attributes = 16; +} + +message Command { + temporal.api.enums.v1.CommandType command_type = 1; + oneof attributes { + ScheduleActivityTaskCommandAttributes schedule_activity_task_command_attributes = 2; + StartTimerCommandAttributes start_timer_command_attributes = 3; + CompleteWorkflowExecutionCommandAttributes complete_workflow_execution_command_attributes = 4; + FailWorkflowExecutionCommandAttributes fail_workflow_execution_command_attributes = 5; + RequestCancelActivityTaskCommandAttributes request_cancel_activity_task_command_attributes = 6; + CancelTimerCommandAttributes cancel_timer_command_attributes = 7; + CancelWorkflowExecutionCommandAttributes cancel_workflow_execution_command_attributes = 8; + RequestCancelExternalWorkflowExecutionCommandAttributes request_cancel_external_workflow_execution_command_attributes = 9; + RecordMarkerCommandAttributes record_marker_command_attributes = 10; + ContinueAsNewWorkflowExecutionCommandAttributes continue_as_new_workflow_execution_command_attributes = 11; + StartChildWorkflowExecutionCommandAttributes start_child_workflow_execution_command_attributes = 12; + SignalExternalWorkflowExecutionCommandAttributes signal_external_workflow_execution_command_attributes = 13; + UpsertWorkflowSearchAttributesCommandAttributes upsert_workflow_search_attributes_command_attributes = 14; + } +} diff --git a/protos/api_upstream/temporal/api/common/v1/message.proto b/protos/api_upstream/temporal/api/common/v1/message.proto new file mode 100644 index 000000000..814d8d104 --- /dev/null +++ b/protos/api_upstream/temporal/api/common/v1/message.proto @@ -0,0 +1,93 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.common.v1; + +option go_package = "go.temporal.io/api/common/v1;common"; +option java_package = "io.temporal.api.common.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Common::V1"; + +import "google/protobuf/duration.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/common.proto"; + +message DataBlob { + temporal.api.enums.v1.EncodingType encoding_type = 1; + bytes data = 2; +} + +message Payloads { + repeated Payload payloads = 1; +} + +message Payload { + map metadata = 1; + bytes data = 2; +} + +message SearchAttributes { + map indexed_fields = 1; +} + +message Memo { + map fields = 1; +} + +message Header { + map fields = 1; +} + +message WorkflowExecution { + string workflow_id = 1; + string run_id = 2; +} + +message WorkflowType { + string name = 1; +} + +message ActivityType { + string name = 1; +} + +message RetryPolicy { + // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. + google.protobuf.Duration initial_interval = 1 [(gogoproto.stdduration) = true]; + // Coefficient used to calculate the next retry interval. + // The next retry interval is previous interval multiplied by the coefficient. + // Must be 1 or larger. + double backoff_coefficient = 2; + // Maximum interval between retries. Exponential backoff leads to interval increase. + // This value is the cap of the increase. Default is 100x of the initial interval. + google.protobuf.Duration maximum_interval = 3 [(gogoproto.stdduration) = true]; + // Maximum number of attempts. When exceeded the retries stop even if not expired yet. + // 1 disables retries. 0 means unlimited (up to the timeouts) + int32 maximum_attempts = 4; + // Non-Retryable errors types. Will stop retrying if error type matches this list. + repeated string non_retryable_error_types = 5; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/command_type.proto b/protos/api_upstream/temporal/api/enums/v1/command_type.proto new file mode 100644 index 000000000..19c2c6bc1 --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/command_type.proto @@ -0,0 +1,49 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "CommandTypeProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +// Whenever this list of command types is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering. +enum CommandType { + COMMAND_TYPE_UNSPECIFIED = 0; + COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK = 1; + COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK = 2; + COMMAND_TYPE_START_TIMER = 3; + COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION = 4; + COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION = 5; + COMMAND_TYPE_CANCEL_TIMER = 6; + COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION = 7; + COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION = 8; + COMMAND_TYPE_RECORD_MARKER = 9; + COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION = 10; + COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION = 11; + COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION = 12; + COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES = 13; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/common.proto b/protos/api_upstream/temporal/api/enums/v1/common.proto new file mode 100644 index 000000000..7d4b0440c --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/common.proto @@ -0,0 +1,54 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum EncodingType { + ENCODING_TYPE_UNSPECIFIED = 0; + ENCODING_TYPE_PROTO3 = 1; + ENCODING_TYPE_JSON = 2; +} + +enum IndexedValueType { + INDEXED_VALUE_TYPE_UNSPECIFIED = 0; + INDEXED_VALUE_TYPE_STRING = 1; + INDEXED_VALUE_TYPE_KEYWORD = 2; + INDEXED_VALUE_TYPE_INT = 3; + INDEXED_VALUE_TYPE_DOUBLE = 4; + INDEXED_VALUE_TYPE_BOOL = 5; + INDEXED_VALUE_TYPE_DATETIME = 6; +} + +enum Severity { + SEVERITY_UNSPECIFIED = 0; + SEVERITY_HIGH = 1; + SEVERITY_MEDIUM = 2; + SEVERITY_LOW = 3; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/event_type.proto b/protos/api_upstream/temporal/api/enums/v1/event_type.proto new file mode 100644 index 000000000..909194fb0 --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/event_type.proto @@ -0,0 +1,76 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "EventTypeProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +// Whenever this list of events is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering. +enum EventType { + EVENT_TYPE_UNSPECIFIED = 0; + EVENT_TYPE_WORKFLOW_EXECUTION_STARTED = 1; + EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED = 2; + EVENT_TYPE_WORKFLOW_EXECUTION_FAILED = 3; + EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT = 4; + EVENT_TYPE_WORKFLOW_TASK_SCHEDULED = 5; + EVENT_TYPE_WORKFLOW_TASK_STARTED = 6; + EVENT_TYPE_WORKFLOW_TASK_COMPLETED = 7; + EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT = 8; + EVENT_TYPE_WORKFLOW_TASK_FAILED = 9; + EVENT_TYPE_ACTIVITY_TASK_SCHEDULED = 10; + EVENT_TYPE_ACTIVITY_TASK_STARTED = 11; + EVENT_TYPE_ACTIVITY_TASK_COMPLETED = 12; + EVENT_TYPE_ACTIVITY_TASK_FAILED = 13; + EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT = 14; + EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED = 15; + EVENT_TYPE_ACTIVITY_TASK_CANCELED = 16; + EVENT_TYPE_TIMER_STARTED = 17; + EVENT_TYPE_TIMER_FIRED = 18; + EVENT_TYPE_TIMER_CANCELED = 19; + EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED = 20; + EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED = 21; + EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED = 22; + EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED = 23; + EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED = 24; + EVENT_TYPE_MARKER_RECORDED = 25; + EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED = 26; + EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED = 27; + EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW = 28; + EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED = 29; + EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED = 30; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED = 31; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED = 32; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED = 33; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED = 34; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT = 35; + EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED = 36; + EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED = 37; + EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED = 38; + EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED = 39; + EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES = 40; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto b/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto new file mode 100644 index 000000000..2e9c39312 --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto @@ -0,0 +1,73 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "FailedCauseProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum WorkflowTaskFailedCause { + WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED = 0; + WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND = 1; + WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES = 2; + WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES = 3; + WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES = 4; + WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES = 5; + WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES = 6; + WORKFLOW_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES = 7; + WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES = 8; + WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES = 9; + WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 10; + WORKFLOW_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES = 11; + WORKFLOW_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID = 12; + WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE = 13; + WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE = 14; + WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 15; + WORKFLOW_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES = 16; + WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND = 17; + WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND = 18; + WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE = 19; + WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW = 20; + WORKFLOW_TASK_FAILED_CAUSE_BAD_BINARY = 21; + WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID = 22; + WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES = 23; +} + +enum StartChildWorkflowExecutionFailedCause { + START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0; + START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_EXISTS = 1; +} + +enum CancelExternalWorkflowExecutionFailedCause { + CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0; + CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND = 1; +} + +enum SignalExternalWorkflowExecutionFailedCause { + SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0; + SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND = 1; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/namespace.proto b/protos/api_upstream/temporal/api/enums/v1/namespace.proto new file mode 100644 index 000000000..31615f3f1 --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/namespace.proto @@ -0,0 +1,44 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "NamespaceProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum NamespaceState { + NAMESPACE_STATE_UNSPECIFIED = 0; + NAMESPACE_STATE_REGISTERED = 1; + NAMESPACE_STATE_DEPRECATED = 2; + NAMESPACE_STATE_DELETED = 3; +} + +enum ArchivalState { + ARCHIVAL_STATE_UNSPECIFIED = 0; + ARCHIVAL_STATE_DISABLED = 1; + ARCHIVAL_STATE_ENABLED = 2; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/query.proto b/protos/api_upstream/temporal/api/enums/v1/query.proto new file mode 100644 index 000000000..cd4b15e7c --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/query.proto @@ -0,0 +1,49 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "QueryProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum QueryResultType { + QUERY_RESULT_TYPE_UNSPECIFIED = 0; + QUERY_RESULT_TYPE_ANSWERED = 1; + QUERY_RESULT_TYPE_FAILED = 2; +} + +enum QueryRejectCondition { + QUERY_REJECT_CONDITION_UNSPECIFIED = 0; + // None indicates that query should not be rejected. + QUERY_REJECT_CONDITION_NONE = 1; + // NotOpen indicates that query should be rejected if workflow is not open. + QUERY_REJECT_CONDITION_NOT_OPEN = 2; + // NotCompletedCleanly indicates that query should be rejected if workflow did not complete cleanly. + QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY = 3; +} + + diff --git a/protos/api_upstream/temporal/api/enums/v1/task_queue.proto b/protos/api_upstream/temporal/api/enums/v1/task_queue.proto new file mode 100644 index 000000000..7eb12b534 --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/task_queue.proto @@ -0,0 +1,45 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "TaskQueueProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum TaskQueueKind { + TASK_QUEUE_KIND_UNSPECIFIED = 0; + TASK_QUEUE_KIND_NORMAL = 1; + TASK_QUEUE_KIND_STICKY = 2; +} + +enum TaskQueueType { + TASK_QUEUE_TYPE_UNSPECIFIED = 0; + // Workflow type of task queue. + TASK_QUEUE_TYPE_WORKFLOW = 1; + // Activity type of task queue. + TASK_QUEUE_TYPE_ACTIVITY = 2; +} diff --git a/protos/api_upstream/temporal/api/enums/v1/workflow.proto b/protos/api_upstream/temporal/api/enums/v1/workflow.proto new file mode 100644 index 000000000..acb56d5fd --- /dev/null +++ b/protos/api_upstream/temporal/api/enums/v1/workflow.proto @@ -0,0 +1,105 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowProto"; +option ruby_package = "Temporal::Api::Enums::V1"; + +enum WorkflowIdReusePolicy { + WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED = 0; + // Allow start a workflow execution using the same workflow Id, when workflow not running. + WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE = 1; + // Allow start a workflow execution using the same workflow Id, when workflow not running, and the last execution close state is in + // [terminated, cancelled, timed out, failed]. + WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2; + // Do not allow start a workflow execution using the same workflow Id at all. + WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE = 3; +} + +enum ParentClosePolicy { + PARENT_CLOSE_POLICY_UNSPECIFIED = 0; + // Terminate means terminating the child workflow. + PARENT_CLOSE_POLICY_TERMINATE = 1; + // Abandon means not doing anything on the child workflow. + PARENT_CLOSE_POLICY_ABANDON = 2; + // Cancel means requesting cancellation on the child workflow. + PARENT_CLOSE_POLICY_REQUEST_CANCEL = 3; +} + +enum ContinueAsNewInitiator { + CONTINUE_AS_NEW_INITIATOR_UNSPECIFIED = 0; + CONTINUE_AS_NEW_INITIATOR_WORKFLOW = 1; + CONTINUE_AS_NEW_INITIATOR_RETRY = 2; + CONTINUE_AS_NEW_INITIATOR_CRON_SCHEDULE = 3; +} + +// (-- api-linter: core::0216::synonyms=disabled +// aip.dev/not-precedent: There is WorkflowExecutionState already in another package. --) +enum WorkflowExecutionStatus { + WORKFLOW_EXECUTION_STATUS_UNSPECIFIED = 0; + // Value 1 is hardcoded in SQL persistence. + WORKFLOW_EXECUTION_STATUS_RUNNING = 1; + WORKFLOW_EXECUTION_STATUS_COMPLETED = 2; + WORKFLOW_EXECUTION_STATUS_FAILED = 3; + WORKFLOW_EXECUTION_STATUS_CANCELED = 4; + WORKFLOW_EXECUTION_STATUS_TERMINATED = 5; + WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW = 6; + WORKFLOW_EXECUTION_STATUS_TIMED_OUT = 7; +} + +enum PendingActivityState { + PENDING_ACTIVITY_STATE_UNSPECIFIED = 0; + PENDING_ACTIVITY_STATE_SCHEDULED = 1; + PENDING_ACTIVITY_STATE_STARTED = 2; + PENDING_ACTIVITY_STATE_CANCEL_REQUESTED = 3; +} + +enum HistoryEventFilterType { + HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED = 0; + HISTORY_EVENT_FILTER_TYPE_ALL_EVENT = 1; + HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT = 2; +} + +enum RetryState { + RETRY_STATE_UNSPECIFIED = 0; + RETRY_STATE_IN_PROGRESS = 1; + RETRY_STATE_NON_RETRYABLE_FAILURE = 2; + RETRY_STATE_TIMEOUT = 3; + RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED = 4; + RETRY_STATE_RETRY_POLICY_NOT_SET = 5; + RETRY_STATE_INTERNAL_SERVER_ERROR = 6; + RETRY_STATE_CANCEL_REQUESTED = 7; +} + +enum TimeoutType { + TIMEOUT_TYPE_UNSPECIFIED = 0; + TIMEOUT_TYPE_START_TO_CLOSE = 1; + TIMEOUT_TYPE_SCHEDULE_TO_START = 2; + TIMEOUT_TYPE_SCHEDULE_TO_CLOSE = 3; + TIMEOUT_TYPE_HEARTBEAT = 4; +} diff --git a/protos/api_upstream/temporal/api/errordetails/v1/message.proto b/protos/api_upstream/temporal/api/errordetails/v1/message.proto new file mode 100644 index 000000000..29dd07537 --- /dev/null +++ b/protos/api_upstream/temporal/api/errordetails/v1/message.proto @@ -0,0 +1,69 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +// These error details extend failures defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto + +package temporal.api.errordetails.v1; + +option go_package = "go.temporal.io/api/errordetails/v1;errordetails"; +option java_package = "io.temporal.api.errordetails.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::ErrorDetails::V1"; + +message NotFoundFailure { + string current_cluster = 1; + string active_cluster = 2; +} + +message WorkflowExecutionAlreadyStartedFailure { + string start_request_id = 1; + string run_id = 2; +} + +message NamespaceNotActiveFailure { + string namespace = 1; + string current_cluster = 2; + string active_cluster = 3; +} + +message ClientVersionNotSupportedFailure { + string client_version = 1; + string client_name = 2; + string supported_versions = 3; +} + +message ServerVersionNotSupportedFailure { + string server_version = 1; + string client_supported_server_versions = 2; +} + +message NamespaceAlreadyExistsFailure { +} + +message CancellationAlreadyRequestedFailure { +} + +message QueryFailedFailure { +} diff --git a/protos/api_upstream/temporal/api/failure/v1/message.proto b/protos/api_upstream/temporal/api/failure/v1/message.proto new file mode 100644 index 000000000..9f8e521cc --- /dev/null +++ b/protos/api_upstream/temporal/api/failure/v1/message.proto @@ -0,0 +1,95 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.failure.v1; + +option go_package = "go.temporal.io/api/failure/v1;failure"; +option java_package = "io.temporal.api.failure.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Failure::V1"; + +import "temporal/api/common/v1/message.proto"; +import "temporal/api/enums/v1/workflow.proto"; + +message ApplicationFailureInfo { + string type = 1; + bool non_retryable = 2; + temporal.api.common.v1.Payloads details = 3; +} + +message TimeoutFailureInfo { + temporal.api.enums.v1.TimeoutType timeout_type = 1; + temporal.api.common.v1.Payloads last_heartbeat_details = 2; +} + +message CanceledFailureInfo { + temporal.api.common.v1.Payloads details = 1; +} + +message TerminatedFailureInfo { +} + +message ServerFailureInfo { + bool non_retryable = 1; +} + +message ResetWorkflowFailureInfo { + temporal.api.common.v1.Payloads last_heartbeat_details = 1; +} + +message ActivityFailureInfo { + int64 scheduled_event_id = 1; + int64 started_event_id = 2; + string identity = 3; + temporal.api.common.v1.ActivityType activity_type = 4; + string activity_id = 5; + temporal.api.enums.v1.RetryState retry_state = 6; +} + +message ChildWorkflowExecutionFailureInfo { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + int64 initiated_event_id = 4; + int64 started_event_id = 5; + temporal.api.enums.v1.RetryState retry_state = 6; +} + +message Failure { + string message = 1; + string source = 2; + string stack_trace = 3; + Failure cause = 4; + oneof failure_info { + ApplicationFailureInfo application_failure_info = 5; + TimeoutFailureInfo timeout_failure_info = 6; + CanceledFailureInfo canceled_failure_info = 7; + TerminatedFailureInfo terminated_failure_info = 8; + ServerFailureInfo server_failure_info = 9; + ResetWorkflowFailureInfo reset_workflow_failure_info = 10; + ActivityFailureInfo activity_failure_info = 11; + ChildWorkflowExecutionFailureInfo child_workflow_execution_failure_info = 12; + } +} diff --git a/protos/api_upstream/temporal/api/filter/v1/message.proto b/protos/api_upstream/temporal/api/filter/v1/message.proto new file mode 100644 index 000000000..70681c09e --- /dev/null +++ b/protos/api_upstream/temporal/api/filter/v1/message.proto @@ -0,0 +1,55 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.filter.v1; + +option go_package = "go.temporal.io/api/filter/v1;filter"; +option java_package = "io.temporal.api.filter.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Filter::V1"; + +import "google/protobuf/timestamp.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/workflow.proto"; + +message WorkflowExecutionFilter { + string workflow_id = 1; + string run_id = 2; +} + +message WorkflowTypeFilter { + string name = 1; +} + +message StartTimeFilter { + google.protobuf.Timestamp earliest_time = 1 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp latest_time = 2 [(gogoproto.stdtime) = true]; +} + +message StatusFilter { + temporal.api.enums.v1.WorkflowExecutionStatus status = 1; +} diff --git a/protos/api_upstream/temporal/api/history/v1/message.proto b/protos/api_upstream/temporal/api/history/v1/message.proto new file mode 100644 index 000000000..d1cfd290f --- /dev/null +++ b/protos/api_upstream/temporal/api/history/v1/message.proto @@ -0,0 +1,478 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.history.v1; + +option go_package = "go.temporal.io/api/history/v1;history"; +option java_package = "io.temporal.api.history.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::History::V1"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/event_type.proto"; +import "temporal/api/enums/v1/failed_cause.proto"; +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/common/v1/message.proto"; +import "temporal/api/failure/v1/message.proto"; +import "temporal/api/workflow/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; + +message WorkflowExecutionStartedEventAttributes { + temporal.api.common.v1.WorkflowType workflow_type = 1; + string parent_workflow_namespace = 2; + temporal.api.common.v1.WorkflowExecution parent_workflow_execution = 3; + int64 parent_initiated_event_id = 4; + temporal.api.taskqueue.v1.TaskQueue task_queue = 5; + temporal.api.common.v1.Payloads input = 6; + // Total workflow execution timeout including retries and continue as new. + google.protobuf.Duration workflow_execution_timeout = 7 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 8 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 9 [(gogoproto.stdduration) = true]; + string continued_execution_run_id = 10; + temporal.api.enums.v1.ContinueAsNewInitiator initiator = 11; + temporal.api.failure.v1.Failure continued_failure = 12; + temporal.api.common.v1.Payloads last_completion_result = 13; + // This is the runId when the WorkflowExecutionStarted event is written. + string original_execution_run_id = 14; + string identity = 15; + // This is the very first runId along the chain of ContinueAsNew and Reset. + string first_execution_run_id = 16; + temporal.api.common.v1.RetryPolicy retry_policy = 17; + int32 attempt = 18; + // The absolute time at which workflow is timed out. + // This time is passed without change to the next run/retry of a workflow. + google.protobuf.Timestamp workflow_execution_expiration_time = 19 [(gogoproto.stdtime) = true]; + string cron_schedule = 20; + google.protobuf.Duration first_workflow_task_backoff = 21 [(gogoproto.stdduration) = true]; + temporal.api.common.v1.Memo memo = 22; + temporal.api.common.v1.SearchAttributes search_attributes = 23; + temporal.api.workflow.v1.ResetPoints prev_auto_reset_points = 24; + temporal.api.common.v1.Header header = 25; +} + +message WorkflowExecutionCompletedEventAttributes { + temporal.api.common.v1.Payloads result = 1; + int64 workflow_task_completed_event_id = 2; +} + +message WorkflowExecutionFailedEventAttributes { + temporal.api.failure.v1.Failure failure = 1; + temporal.api.enums.v1.RetryState retry_state = 2; + int64 workflow_task_completed_event_id = 3; +} + +message WorkflowExecutionTimedOutEventAttributes { + temporal.api.enums.v1.RetryState retry_state = 1; +} + +message WorkflowExecutionContinuedAsNewEventAttributes { + string new_execution_run_id = 1; + temporal.api.common.v1.WorkflowType workflow_type = 2; + temporal.api.taskqueue.v1.TaskQueue task_queue = 3; + temporal.api.common.v1.Payloads input = 4; + // workflow_execution_timeout is omitted as it shouldn'be overridden from within a workflow. + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 5 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 6 [(gogoproto.stdduration) = true]; + int64 workflow_task_completed_event_id = 7; + google.protobuf.Duration backoff_start_interval = 8 [(gogoproto.stdduration) = true]; + temporal.api.enums.v1.ContinueAsNewInitiator initiator = 9; + temporal.api.failure.v1.Failure failure = 10; + temporal.api.common.v1.Payloads last_completion_result = 11; + temporal.api.common.v1.Header header = 12; + temporal.api.common.v1.Memo memo = 13; + temporal.api.common.v1.SearchAttributes search_attributes = 14; +} + +message WorkflowTaskScheduledEventAttributes { + temporal.api.taskqueue.v1.TaskQueue task_queue = 1; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_close_timeout = 2 [(gogoproto.stdduration) = true]; + int32 attempt = 3; +} + +message WorkflowTaskStartedEventAttributes { + int64 scheduled_event_id = 1; + string identity = 2; + string request_id = 3; +} + +message WorkflowTaskCompletedEventAttributes { + int64 scheduled_event_id = 1; + int64 started_event_id = 2; + string identity = 3; + string binary_checksum = 4; +} + +message WorkflowTaskTimedOutEventAttributes { + int64 scheduled_event_id = 1; + int64 started_event_id = 2; + temporal.api.enums.v1.TimeoutType timeout_type = 3; +} + +message WorkflowTaskFailedEventAttributes { + int64 scheduled_event_id = 1; + int64 started_event_id = 2; + temporal.api.enums.v1.WorkflowTaskFailedCause cause = 3; + temporal.api.failure.v1.Failure failure = 4; + string identity = 5; + // For reset workflow. + string base_run_id = 6; + string new_run_id = 7; + int64 fork_event_version = 8; + string binary_checksum = 9; +} + +message ActivityTaskScheduledEventAttributes { + string activity_id = 1; + temporal.api.common.v1.ActivityType activity_type = 2; + string namespace = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Header header = 5; + temporal.api.common.v1.Payloads input = 6; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Indicates how long the caller is willing to wait for an activity completion. + // Limits for how long retries are happening. Either this or start_to_close_timeout_seconds must be specified. + google.protobuf.Duration schedule_to_close_timeout = 7 [(gogoproto.stdduration) = true]; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Limits time an activity task can stay in a task queue before a worker picks it up. + // This timeout is always non retryable as all a retry would achieve is to put it back into the same queue. + // Defaults to schedule_to_close_timeout_seconds or workflow execution timeout if not specified. + google.protobuf.Duration schedule_to_start_timeout = 8 [(gogoproto.stdduration) = true]; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + // Maximum time an activity is allowed to execute after a pick up by a worker. + // This timeout is always retryable. Either this or schedule_to_close_timeout_seconds must be specified. + google.protobuf.Duration start_to_close_timeout = 9 [(gogoproto.stdduration) = true]; + // Maximum time between successful worker heartbeats. + google.protobuf.Duration heartbeat_timeout = 10 [(gogoproto.stdduration) = true]; + int64 workflow_task_completed_event_id = 11; + // Activities are provided by a default retry policy controlled through the service dynamic configuration. + // Retries are happening up to schedule_to_close_timeout. + // To disable retries set retry_policy.maximum_attempts to 1. + temporal.api.common.v1.RetryPolicy retry_policy = 12; +} + +message ActivityTaskStartedEventAttributes { + int64 scheduled_event_id = 1; + string identity = 2; + string request_id = 3; + int32 attempt = 4; + temporal.api.failure.v1.Failure last_failure = 5; +} + +message ActivityTaskCompletedEventAttributes { + temporal.api.common.v1.Payloads result = 1; + int64 scheduled_event_id = 2; + int64 started_event_id = 3; + string identity = 4; +} + +message ActivityTaskFailedEventAttributes { + temporal.api.failure.v1.Failure failure = 1; + int64 scheduled_event_id = 2; + int64 started_event_id = 3; + string identity = 4; + temporal.api.enums.v1.RetryState retry_state = 5; +} + +message ActivityTaskTimedOutEventAttributes { + // For retry activity, it may have a failure before timeout. It is stored as `cause` in `failure`. + temporal.api.failure.v1.Failure failure = 1; + int64 scheduled_event_id = 2; + int64 started_event_id = 3; + temporal.api.enums.v1.RetryState retry_state = 4; +} + +message ActivityTaskCancelRequestedEventAttributes { + int64 scheduled_event_id = 1; + int64 workflow_task_completed_event_id = 2; +} + +message ActivityTaskCanceledEventAttributes { + temporal.api.common.v1.Payloads details = 1; + int64 latest_cancel_requested_event_id = 2; + int64 scheduled_event_id = 3; + int64 started_event_id = 4; + string identity = 5; +} + +message TimerStartedEventAttributes { + string timer_id = 1; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_fire_timeout = 2 [(gogoproto.stdduration) = true]; + int64 workflow_task_completed_event_id = 3; +} + +message TimerFiredEventAttributes { + string timer_id = 1; + int64 started_event_id = 2; +} + +message TimerCanceledEventAttributes { + string timer_id = 1; + int64 started_event_id = 2; + int64 workflow_task_completed_event_id = 3; + string identity = 4; +} + +message WorkflowExecutionCancelRequestedEventAttributes { + string cause = 1; + int64 external_initiated_event_id = 2; + temporal.api.common.v1.WorkflowExecution external_workflow_execution = 3; + string identity = 4; +} + +message WorkflowExecutionCanceledEventAttributes { + int64 workflow_task_completed_event_id = 1; + temporal.api.common.v1.Payloads details = 2; +} + +message MarkerRecordedEventAttributes { + string marker_name = 1; + map details = 2; + int64 workflow_task_completed_event_id = 3; + temporal.api.common.v1.Header header = 4; + temporal.api.failure.v1.Failure failure = 5; +} + +message WorkflowExecutionSignaledEventAttributes { + string signal_name = 1; + temporal.api.common.v1.Payloads input = 2; + string identity = 3; +} + +message WorkflowExecutionTerminatedEventAttributes { + string reason = 1; + temporal.api.common.v1.Payloads details = 2; + string identity = 3; +} + +message RequestCancelExternalWorkflowExecutionInitiatedEventAttributes { + int64 workflow_task_completed_event_id = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + string control = 4; + bool child_workflow_only = 5; +} + +message RequestCancelExternalWorkflowExecutionFailedEventAttributes { + temporal.api.enums.v1.CancelExternalWorkflowExecutionFailedCause cause = 1; + int64 workflow_task_completed_event_id = 2; + string namespace = 3; + temporal.api.common.v1.WorkflowExecution workflow_execution = 4; + int64 initiated_event_id = 5; + string control = 6; +} + +message ExternalWorkflowExecutionCancelRequestedEventAttributes { + int64 initiated_event_id = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; +} + +message SignalExternalWorkflowExecutionInitiatedEventAttributes { + int64 workflow_task_completed_event_id = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + string signal_name = 4; + temporal.api.common.v1.Payloads input = 5; + string control = 6; + bool child_workflow_only = 7; +} + +message SignalExternalWorkflowExecutionFailedEventAttributes { + temporal.api.enums.v1.SignalExternalWorkflowExecutionFailedCause cause = 1; + int64 workflow_task_completed_event_id = 2; + string namespace = 3; + temporal.api.common.v1.WorkflowExecution workflow_execution = 4; + int64 initiated_event_id = 5; + string control = 6; +} + +message ExternalWorkflowExecutionSignaledEventAttributes { + int64 initiated_event_id = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + string control = 4; +} + +message UpsertWorkflowSearchAttributesEventAttributes { + int64 workflow_task_completed_event_id = 1; + temporal.api.common.v1.SearchAttributes search_attributes = 2; +} + +message StartChildWorkflowExecutionInitiatedEventAttributes { + string namespace = 1; + string workflow_id = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Payloads input = 5; + // Total workflow execution timeout including retries and continue as new. + google.protobuf.Duration workflow_execution_timeout = 6 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 7 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 8 [(gogoproto.stdduration) = true]; + // Default: PARENT_CLOSE_POLICY_TERMINATE. + temporal.api.enums.v1.ParentClosePolicy parent_close_policy = 9; + string control = 10; + int64 workflow_task_completed_event_id = 11; + // Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE. + temporal.api.enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 12; + temporal.api.common.v1.RetryPolicy retry_policy = 13; + string cron_schedule = 14; + temporal.api.common.v1.Header header = 15; + temporal.api.common.v1.Memo memo = 16; + temporal.api.common.v1.SearchAttributes search_attributes = 17; +} + +message StartChildWorkflowExecutionFailedEventAttributes { + string namespace = 1; + string workflow_id = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.enums.v1.StartChildWorkflowExecutionFailedCause cause = 4; + string control = 5; + int64 initiated_event_id = 6; + int64 workflow_task_completed_event_id = 7; +} + +message ChildWorkflowExecutionStartedEventAttributes { + string namespace = 1; + int64 initiated_event_id = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + temporal.api.common.v1.WorkflowType workflow_type = 4; + temporal.api.common.v1.Header header = 5; +} + +message ChildWorkflowExecutionCompletedEventAttributes { + temporal.api.common.v1.Payloads result = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + temporal.api.common.v1.WorkflowType workflow_type = 4; + int64 initiated_event_id = 5; + int64 started_event_id = 6; +} + +message ChildWorkflowExecutionFailedEventAttributes { + temporal.api.failure.v1.Failure failure = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + temporal.api.common.v1.WorkflowType workflow_type = 4; + int64 initiated_event_id = 5; + int64 started_event_id = 6; + temporal.api.enums.v1.RetryState retry_state = 7; +} + +message ChildWorkflowExecutionCanceledEventAttributes { + temporal.api.common.v1.Payloads details = 1; + string namespace = 2; + temporal.api.common.v1.WorkflowExecution workflow_execution = 3; + temporal.api.common.v1.WorkflowType workflow_type = 4; + int64 initiated_event_id = 5; + int64 started_event_id = 6; +} + +message ChildWorkflowExecutionTimedOutEventAttributes { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + int64 initiated_event_id = 4; + int64 started_event_id = 5; + temporal.api.enums.v1.RetryState retry_state = 6; +} + +message ChildWorkflowExecutionTerminatedEventAttributes { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + int64 initiated_event_id = 4; + int64 started_event_id = 5; +} + +message HistoryEvent { + int64 event_id = 1; + google.protobuf.Timestamp event_time = 2 [(gogoproto.stdtime) = true]; + temporal.api.enums.v1.EventType event_type = 3; + int64 version = 4; + int64 task_id = 5; + oneof attributes { + WorkflowExecutionStartedEventAttributes workflow_execution_started_event_attributes = 6; + WorkflowExecutionCompletedEventAttributes workflow_execution_completed_event_attributes = 7; + WorkflowExecutionFailedEventAttributes workflow_execution_failed_event_attributes = 8; + WorkflowExecutionTimedOutEventAttributes workflow_execution_timed_out_event_attributes = 9; + WorkflowTaskScheduledEventAttributes workflow_task_scheduled_event_attributes = 10; + WorkflowTaskStartedEventAttributes workflow_task_started_event_attributes = 11; + WorkflowTaskCompletedEventAttributes workflow_task_completed_event_attributes = 12; + WorkflowTaskTimedOutEventAttributes workflow_task_timed_out_event_attributes = 13; + WorkflowTaskFailedEventAttributes workflow_task_failed_event_attributes = 14; + ActivityTaskScheduledEventAttributes activity_task_scheduled_event_attributes = 15; + ActivityTaskStartedEventAttributes activity_task_started_event_attributes = 16; + ActivityTaskCompletedEventAttributes activity_task_completed_event_attributes = 17; + ActivityTaskFailedEventAttributes activity_task_failed_event_attributes = 18; + ActivityTaskTimedOutEventAttributes activity_task_timed_out_event_attributes = 19; + TimerStartedEventAttributes timer_started_event_attributes = 20; + TimerFiredEventAttributes timer_fired_event_attributes = 21; + ActivityTaskCancelRequestedEventAttributes activity_task_cancel_requested_event_attributes = 22; + ActivityTaskCanceledEventAttributes activity_task_canceled_event_attributes = 23; + TimerCanceledEventAttributes timer_canceled_event_attributes = 24; + MarkerRecordedEventAttributes marker_recorded_event_attributes = 25; + WorkflowExecutionSignaledEventAttributes workflow_execution_signaled_event_attributes = 26; + WorkflowExecutionTerminatedEventAttributes workflow_execution_terminated_event_attributes = 27; + WorkflowExecutionCancelRequestedEventAttributes workflow_execution_cancel_requested_event_attributes = 28; + WorkflowExecutionCanceledEventAttributes workflow_execution_canceled_event_attributes = 29; + RequestCancelExternalWorkflowExecutionInitiatedEventAttributes request_cancel_external_workflow_execution_initiated_event_attributes = 30; + RequestCancelExternalWorkflowExecutionFailedEventAttributes request_cancel_external_workflow_execution_failed_event_attributes = 31; + ExternalWorkflowExecutionCancelRequestedEventAttributes external_workflow_execution_cancel_requested_event_attributes = 32; + WorkflowExecutionContinuedAsNewEventAttributes workflow_execution_continued_as_new_event_attributes = 33; + StartChildWorkflowExecutionInitiatedEventAttributes start_child_workflow_execution_initiated_event_attributes = 34; + StartChildWorkflowExecutionFailedEventAttributes start_child_workflow_execution_failed_event_attributes = 35; + ChildWorkflowExecutionStartedEventAttributes child_workflow_execution_started_event_attributes = 36; + ChildWorkflowExecutionCompletedEventAttributes child_workflow_execution_completed_event_attributes = 37; + ChildWorkflowExecutionFailedEventAttributes child_workflow_execution_failed_event_attributes = 38; + ChildWorkflowExecutionCanceledEventAttributes child_workflow_execution_canceled_event_attributes = 39; + ChildWorkflowExecutionTimedOutEventAttributes child_workflow_execution_timed_out_event_attributes = 40; + ChildWorkflowExecutionTerminatedEventAttributes child_workflow_execution_terminated_event_attributes = 41; + SignalExternalWorkflowExecutionInitiatedEventAttributes signal_external_workflow_execution_initiated_event_attributes = 42; + SignalExternalWorkflowExecutionFailedEventAttributes signal_external_workflow_execution_failed_event_attributes = 43; + ExternalWorkflowExecutionSignaledEventAttributes external_workflow_execution_signaled_event_attributes = 44; + UpsertWorkflowSearchAttributesEventAttributes upsert_workflow_search_attributes_event_attributes = 45; + } +} + +message History { + repeated HistoryEvent events = 1; +} diff --git a/protos/api_upstream/temporal/api/namespace/v1/message.proto b/protos/api_upstream/temporal/api/namespace/v1/message.proto new file mode 100644 index 000000000..0808b8a55 --- /dev/null +++ b/protos/api_upstream/temporal/api/namespace/v1/message.proto @@ -0,0 +1,77 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.namespace.v1; + +option go_package = "go.temporal.io/api/namespace/v1;namespace"; +option java_package = "io.temporal.api.namespace.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Namespace::V1"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/namespace.proto"; + + +message NamespaceInfo { + string name = 1; + temporal.api.enums.v1.NamespaceState state = 2; + string description = 3; + string owner_email = 4; + // A key-value map for any customized purpose. + map data = 5; + string id = 6; +} + +message NamespaceConfig { + google.protobuf.Duration workflow_execution_retention_ttl = 1 [(gogoproto.stdduration) = true]; + BadBinaries bad_binaries = 2; + // If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server configuration is used. + temporal.api.enums.v1.ArchivalState history_archival_state = 3; + string history_archival_uri = 4; + // If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server configuration is used. + temporal.api.enums.v1.ArchivalState visibility_archival_state = 5; + string visibility_archival_uri = 6; +} + +message BadBinaries { + map binaries = 1; +} + +message BadBinaryInfo { + string reason = 1; + string operator = 2; + google.protobuf.Timestamp create_time = 3 [(gogoproto.stdtime) = true]; +} + +message UpdateNamespaceInfo { + string description = 1; + string owner_email = 2; + // A key-value map for any customized purpose. + map data = 3; +} diff --git a/protos/api_upstream/temporal/api/query/v1/message.proto b/protos/api_upstream/temporal/api/query/v1/message.proto new file mode 100644 index 000000000..5cdb1b0ea --- /dev/null +++ b/protos/api_upstream/temporal/api/query/v1/message.proto @@ -0,0 +1,49 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.query.v1; + +option go_package = "go.temporal.io/api/query/v1;query"; +option java_package = "io.temporal.api.query.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Query::V1"; + +import "temporal/api/enums/v1/query.proto"; +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/common/v1/message.proto"; + +message WorkflowQuery { + string query_type = 1; + temporal.api.common.v1.Payloads query_args = 2; +} +message WorkflowQueryResult { + temporal.api.enums.v1.QueryResultType result_type = 1; + temporal.api.common.v1.Payloads answer = 2; + string error_message = 3; +} + +message QueryRejected { + temporal.api.enums.v1.WorkflowExecutionStatus status = 1; +} diff --git a/protos/api_upstream/temporal/api/replication/v1/message.proto b/protos/api_upstream/temporal/api/replication/v1/message.proto new file mode 100644 index 000000000..f39361db3 --- /dev/null +++ b/protos/api_upstream/temporal/api/replication/v1/message.proto @@ -0,0 +1,40 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.replication.v1; + +option go_package = "go.temporal.io/api/replication/v1;replication"; +option java_package = "io.temporal.api.replication.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Replication::V1"; + +message ClusterReplicationConfig { + string cluster_name = 1; +} + +message NamespaceReplicationConfig { + string active_cluster_name = 1; + repeated ClusterReplicationConfig clusters = 2; +} diff --git a/protos/api_upstream/temporal/api/taskqueue/v1/message.proto b/protos/api_upstream/temporal/api/taskqueue/v1/message.proto new file mode 100644 index 000000000..7e4ccfb98 --- /dev/null +++ b/protos/api_upstream/temporal/api/taskqueue/v1/message.proto @@ -0,0 +1,81 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.taskqueue.v1; + +option go_package = "go.temporal.io/api/taskqueue/v1;taskqueue"; +option java_package = "io.temporal.api.taskqueue.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::TaskQueue::V1"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/task_queue.proto"; + +message TaskQueue { + string name = 1; + // Default: TASK_QUEUE_KIND_NORMAL. + temporal.api.enums.v1.TaskQueueKind kind = 2; +} + +message TaskQueueMetadata { + google.protobuf.DoubleValue max_tasks_per_second = 1; +} + +message TaskQueueStatus { + int64 backlog_count_hint = 1; + int64 read_level = 2; + int64 ack_level = 3; + double rate_per_second = 4; + TaskIdBlock task_id_block = 5; +} + +message TaskIdBlock { + int64 start_id = 1; + int64 end_id = 2; +} + +message TaskQueuePartitionMetadata { + string key = 1; + string owner_host_name = 2; +} + +message PollerInfo { + // Unix Nano + google.protobuf.Timestamp last_access_time = 1 [(gogoproto.stdtime) = true]; + string identity = 2; + double rate_per_second = 3; +} + +message StickyExecutionAttributes { + TaskQueue worker_task_queue = 1; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_start_timeout = 2 [(gogoproto.stdduration) = true]; +} diff --git a/protos/api_upstream/temporal/api/version/v1/message.proto b/protos/api_upstream/temporal/api/version/v1/message.proto new file mode 100644 index 000000000..3d2300fd9 --- /dev/null +++ b/protos/api_upstream/temporal/api/version/v1/message.proto @@ -0,0 +1,58 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.version.v1; + +option go_package = "go.temporal.io/api/version/v1;version"; +option java_package = "io.temporal.api.version.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Version::V1"; + +import "google/protobuf/timestamp.proto"; +import "dependencies/gogoproto/gogo.proto"; +import "temporal/api/enums/v1/common.proto"; + +// ReleaseInfo contains information about specific version of temporal. +message ReleaseInfo { + string version = 1; + google.protobuf.Timestamp release_time = 2 [(gogoproto.stdtime) = true]; + string notes = 3; +} + +// Alert contains notification and severity. +message Alert { + string message = 1; + temporal.api.enums.v1.Severity severity = 2; +} + +// VersionInfo contains details about current and recommended release versions as well as alerts and upgrade instructions. +message VersionInfo { + ReleaseInfo current = 1; + ReleaseInfo recommended = 2; + string instructions = 3; + repeated Alert alerts = 4; + google.protobuf.Timestamp last_update_time = 5 [(gogoproto.stdtime) = true]; +} + diff --git a/protos/api_upstream/temporal/api/workflow/v1/message.proto b/protos/api_upstream/temporal/api/workflow/v1/message.proto new file mode 100644 index 000000000..e6989524d --- /dev/null +++ b/protos/api_upstream/temporal/api/workflow/v1/message.proto @@ -0,0 +1,105 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.workflow.v1; + +option go_package = "go.temporal.io/api/workflow/v1;workflow"; +option java_package = "io.temporal.api.workflow.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporal::Api::Workflow::V1"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/common/v1/message.proto"; +import "temporal/api/failure/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; + +message WorkflowExecutionInfo { + temporal.api.common.v1.WorkflowExecution execution = 1; + temporal.api.common.v1.WorkflowType type = 2; + google.protobuf.Timestamp start_time = 3 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp close_time = 4 [(gogoproto.stdtime) = true]; + temporal.api.enums.v1.WorkflowExecutionStatus status = 5; + int64 history_length = 6; + string parent_namespace_id = 7; + temporal.api.common.v1.WorkflowExecution parent_execution = 8; + google.protobuf.Timestamp execution_time = 9 [(gogoproto.stdtime) = true]; + temporal.api.common.v1.Memo memo = 10; + temporal.api.common.v1.SearchAttributes search_attributes = 11; + ResetPoints auto_reset_points = 12; + string task_queue = 13; +} + +message WorkflowExecutionConfig { + temporal.api.taskqueue.v1.TaskQueue task_queue = 1; + google.protobuf.Duration workflow_execution_timeout = 2 [(gogoproto.stdduration) = true]; + google.protobuf.Duration workflow_run_timeout = 3 [(gogoproto.stdduration) = true]; + google.protobuf.Duration default_workflow_task_timeout = 4 [(gogoproto.stdduration) = true]; +} + +message PendingActivityInfo { + string activity_id = 1; + temporal.api.common.v1.ActivityType activity_type = 2; + temporal.api.enums.v1.PendingActivityState state = 3; + temporal.api.common.v1.Payloads heartbeat_details = 4; + google.protobuf.Timestamp last_heartbeat_time = 5 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp last_started_time = 6 [(gogoproto.stdtime) = true]; + int32 attempt = 7; + int32 maximum_attempts = 8; + google.protobuf.Timestamp scheduled_time = 9 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp expiration_time = 10 [(gogoproto.stdtime) = true]; + temporal.api.failure.v1.Failure last_failure = 11; + string last_worker_identity = 12; +} + +message PendingChildExecutionInfo { + string workflow_id = 1; + string run_id = 2; + string workflow_type_name = 3; + int64 initiated_id = 4; + // Default: PARENT_CLOSE_POLICY_TERMINATE. + temporal.api.enums.v1.ParentClosePolicy parent_close_policy = 5; +} + +message ResetPoints { + repeated ResetPointInfo points = 1; +} + +message ResetPointInfo { + string binary_checksum = 1; + string run_id = 2; + int64 first_workflow_task_completed_id = 3; + google.protobuf.Timestamp create_time = 4 [(gogoproto.stdtime) = true]; + // (-- api-linter: core::0214::resource-expiry=disabled + // aip.dev/not-precedent: TTL is not defined for ResetPointInfo. --) + // The time that the run is deleted due to retention. + google.protobuf.Timestamp expire_time = 5 [(gogoproto.stdtime) = true]; + // false if the reset point has pending childWFs/reqCancels/signalExternals. + bool resettable = 6; +} diff --git a/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto b/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto new file mode 100644 index 000000000..6ca3f7a90 --- /dev/null +++ b/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto @@ -0,0 +1,598 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.workflowservice.v1; + +option go_package = "go.temporal.io/api/workflowservice/v1;workflowservice"; +option java_package = "io.temporal.api.workflowservice.v1"; +option java_multiple_files = true; +option java_outer_classname = "RequestResponseProto"; +option ruby_package = "Temporal::Api::WorkflowService::V1"; + +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/enums/v1/namespace.proto"; +import "temporal/api/enums/v1/failed_cause.proto"; +import "temporal/api/enums/v1/common.proto"; +import "temporal/api/enums/v1/query.proto"; +import "temporal/api/enums/v1/task_queue.proto"; +import "temporal/api/common/v1/message.proto"; +import "temporal/api/history/v1/message.proto"; +import "temporal/api/workflow/v1/message.proto"; +import "temporal/api/command/v1/message.proto"; +import "temporal/api/failure/v1/message.proto"; +import "temporal/api/filter/v1/message.proto"; +import "temporal/api/namespace/v1/message.proto"; +import "temporal/api/query/v1/message.proto"; +import "temporal/api/replication/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; +import "temporal/api/version/v1/message.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "dependencies/gogoproto/gogo.proto"; + +message RegisterNamespaceRequest { + string namespace = 1; + string description = 2; + string owner_email = 3; + google.protobuf.Duration workflow_execution_retention_period = 4 [(gogoproto.stdduration) = true]; + repeated temporal.api.replication.v1.ClusterReplicationConfig clusters = 5; + string active_cluster_name = 6; + // A key-value map for any customized purpose. + map data = 7; + string security_token = 8; + bool is_global_namespace = 9; + // If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server configuration is used. + temporal.api.enums.v1.ArchivalState history_archival_state = 10; + string history_archival_uri = 11; + // If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server configuration is used. + temporal.api.enums.v1.ArchivalState visibility_archival_state = 12; + string visibility_archival_uri = 13; +} + +message RegisterNamespaceResponse { +} + +message ListNamespacesRequest { + int32 page_size = 1; + bytes next_page_token = 2; +} + +message ListNamespacesResponse { + repeated DescribeNamespaceResponse namespaces = 1; + bytes next_page_token = 2; +} + +message DescribeNamespaceRequest { + string namespace = 1; + string id = 2; +} + +message DescribeNamespaceResponse { + temporal.api.namespace.v1.NamespaceInfo namespace_info = 1; + temporal.api.namespace.v1.NamespaceConfig config = 2; + temporal.api.replication.v1.NamespaceReplicationConfig replication_config = 3; + int64 failover_version = 4; + bool is_global_namespace = 5; +} + +// (-- api-linter: core::0134::request-mask-required=disabled +// aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --) +// (-- api-linter: core::0134::request-resource-required=disabled +// aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --) +message UpdateNamespaceRequest { + string namespace = 1; + temporal.api.namespace.v1.UpdateNamespaceInfo update_info = 2; + temporal.api.namespace.v1.NamespaceConfig config = 3; + temporal.api.replication.v1.NamespaceReplicationConfig replication_config = 4; + string security_token = 5; + string delete_bad_binary = 6; +} + +message UpdateNamespaceResponse { + temporal.api.namespace.v1.NamespaceInfo namespace_info = 1; + temporal.api.namespace.v1.NamespaceConfig config = 2; + temporal.api.replication.v1.NamespaceReplicationConfig replication_config = 3; + int64 failover_version = 4; + bool is_global_namespace = 5; +} + +message DeprecateNamespaceRequest { + string namespace = 1; + string security_token = 2; +} + +message DeprecateNamespaceResponse { +} + +message StartWorkflowExecutionRequest { + string namespace = 1; + string workflow_id = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Payloads input = 5; + // Total workflow execution timeout including retries and continue as new. + google.protobuf.Duration workflow_execution_timeout = 6 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow run. + google.protobuf.Duration workflow_run_timeout = 7 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task. + google.protobuf.Duration workflow_task_timeout = 8 [(gogoproto.stdduration) = true]; + string identity = 9; + string request_id = 10; + // Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE. + temporal.api.enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 11; + // Retries up to workflow_execution_timeout_seconds. + temporal.api.common.v1.RetryPolicy retry_policy = 12; + string cron_schedule = 13; + temporal.api.common.v1.Memo memo = 14; + temporal.api.common.v1.SearchAttributes search_attributes = 15; + temporal.api.common.v1.Header header = 16; +} + +message StartWorkflowExecutionResponse { + string run_id = 1; +} + +message GetWorkflowExecutionHistoryRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution execution = 2; + int32 maximum_page_size = 3; + bytes next_page_token = 4; + bool wait_new_event = 5; + // Default: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT. + temporal.api.enums.v1.HistoryEventFilterType history_event_filter_type = 6; + bool skip_archival = 7; +} + +message GetWorkflowExecutionHistoryResponse { + temporal.api.history.v1.History history = 1; + repeated temporal.api.common.v1.DataBlob raw_history = 2; + bytes next_page_token = 3; + bool archived = 4; +} + +message PollWorkflowTaskQueueRequest { + string namespace = 1; + temporal.api.taskqueue.v1.TaskQueue task_queue = 2; + string identity = 3; + string binary_checksum = 4; +} + +message PollWorkflowTaskQueueResponse { + bytes task_token = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + int64 previous_started_event_id = 4; + int64 started_event_id = 5; + int32 attempt = 6; + int64 backlog_count_hint = 7; + temporal.api.history.v1.History history = 8; + bytes next_page_token = 9; + temporal.api.query.v1.WorkflowQuery query = 10; + temporal.api.taskqueue.v1.TaskQueue workflow_execution_task_queue = 11; + google.protobuf.Timestamp scheduled_time = 12 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp started_time = 13 [(gogoproto.stdtime) = true]; + map queries = 14; +} + +message RespondWorkflowTaskCompletedRequest { + bytes task_token = 1; + repeated temporal.api.command.v1.Command commands = 2; + string identity = 3; + temporal.api.taskqueue.v1.StickyExecutionAttributes sticky_attributes = 4; + bool return_new_workflow_task = 5; + bool force_create_new_workflow_task = 6; + string binary_checksum = 7; + map query_results = 8; + string namespace = 9; +} + +message RespondWorkflowTaskCompletedResponse { + PollWorkflowTaskQueueResponse workflow_task = 1; +} + +message RespondWorkflowTaskFailedRequest { + bytes task_token = 1; + temporal.api.enums.v1.WorkflowTaskFailedCause cause = 2; + temporal.api.failure.v1.Failure failure = 3; + string identity = 4; + string binary_checksum = 5; + string namespace = 6; +} + +message RespondWorkflowTaskFailedResponse { +} + +message PollActivityTaskQueueRequest { + string namespace = 1; + temporal.api.taskqueue.v1.TaskQueue task_queue = 2; + string identity = 3; + temporal.api.taskqueue.v1.TaskQueueMetadata task_queue_metadata = 4; +} + +message PollActivityTaskQueueResponse { + bytes task_token = 1; + string workflow_namespace = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.common.v1.WorkflowExecution workflow_execution = 4; + temporal.api.common.v1.ActivityType activity_type = 5; + string activity_id = 6; + temporal.api.common.v1.Header header = 7; + temporal.api.common.v1.Payloads input = 8; + temporal.api.common.v1.Payloads heartbeat_details = 9; + google.protobuf.Timestamp scheduled_time = 10 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp current_attempt_scheduled_time = 11 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp started_time = 12 [(gogoproto.stdtime) = true]; + int32 attempt = 13; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_close_timeout = 14 [(gogoproto.stdduration) = true]; + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_close_timeout = 15 [(gogoproto.stdduration) = true]; + google.protobuf.Duration heartbeat_timeout = 16 [(gogoproto.stdduration) = true]; + // This is an actual retry policy the service uses. + // It can be different from the one provided (or not) during activity scheduling + // as the service can override the provided one in case its values are not specified + // or exceed configured system limits. + temporal.api.common.v1.RetryPolicy retry_policy = 17; +} + +message RecordActivityTaskHeartbeatRequest { + bytes task_token = 1; + temporal.api.common.v1.Payloads details = 2; + string identity = 3; + string namespace = 4; +} + +message RecordActivityTaskHeartbeatResponse { + bool cancel_requested = 1; +} + +message RecordActivityTaskHeartbeatByIdRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string activity_id = 4; + temporal.api.common.v1.Payloads details = 5; + string identity = 6; +} + +message RecordActivityTaskHeartbeatByIdResponse { + bool cancel_requested = 1; +} + +message RespondActivityTaskCompletedRequest { + bytes task_token = 1; + temporal.api.common.v1.Payloads result = 2; + string identity = 3; + string namespace = 4; +} + +message RespondActivityTaskCompletedResponse { +} + +message RespondActivityTaskCompletedByIdRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string activity_id = 4; + temporal.api.common.v1.Payloads result = 5; + string identity = 6; +} + +message RespondActivityTaskCompletedByIdResponse { +} + +message RespondActivityTaskFailedRequest { + bytes task_token = 1; + temporal.api.failure.v1.Failure failure = 2; + string identity = 3; + string namespace = 4; +} + +message RespondActivityTaskFailedResponse { +} + +message RespondActivityTaskFailedByIdRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string activity_id = 4; + temporal.api.failure.v1.Failure failure = 5; + string identity = 6; +} + +message RespondActivityTaskFailedByIdResponse { +} + +message RespondActivityTaskCanceledRequest { + bytes task_token = 1; + temporal.api.common.v1.Payloads details = 2; + string identity = 3; + string namespace = 4; +} + +message RespondActivityTaskCanceledResponse { +} + +message RespondActivityTaskCanceledByIdRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string activity_id = 4; + temporal.api.common.v1.Payloads details = 5; + string identity = 6; +} + +message RespondActivityTaskCanceledByIdResponse { +} + +message RequestCancelWorkflowExecutionRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + string identity = 3; + string request_id = 4; + string first_execution_run_id = 5; +} + +message RequestCancelWorkflowExecutionResponse { +} + +message SignalWorkflowExecutionRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + string signal_name = 3; + temporal.api.common.v1.Payloads input = 4; + string identity = 5; + string request_id = 6; + string control = 7; +} + +message SignalWorkflowExecutionResponse { +} + +message SignalWithStartWorkflowExecutionRequest { + string namespace = 1; + string workflow_id = 2; + temporal.api.common.v1.WorkflowType workflow_type = 3; + temporal.api.taskqueue.v1.TaskQueue task_queue = 4; + temporal.api.common.v1.Payloads input = 5; + // Total workflow execution timeout including retries and continue as new + google.protobuf.Duration workflow_execution_timeout = 6 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow run + google.protobuf.Duration workflow_run_timeout = 7 [(gogoproto.stdduration) = true]; + // Timeout of a single workflow task + google.protobuf.Duration workflow_task_timeout = 8 [(gogoproto.stdduration) = true]; + string identity = 9; + string request_id = 10; + temporal.api.enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 11; + string signal_name = 12; + temporal.api.common.v1.Payloads signal_input = 13; + string control = 14; + // Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE. + temporal.api.common.v1.RetryPolicy retry_policy = 15; + string cron_schedule = 16; + temporal.api.common.v1.Memo memo = 17; + temporal.api.common.v1.SearchAttributes search_attributes = 18; + temporal.api.common.v1.Header header = 19; +} + +message SignalWithStartWorkflowExecutionResponse { + string run_id = 1; +} + +message ResetWorkflowExecutionRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + string reason = 3; + int64 workflow_task_finish_event_id = 4; + string request_id = 5; +} + +message ResetWorkflowExecutionResponse { + string run_id = 1; +} + +message TerminateWorkflowExecutionRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution workflow_execution = 2; + string reason = 3; + temporal.api.common.v1.Payloads details = 4; + string identity = 5; + string first_execution_run_id = 6; +} + +message TerminateWorkflowExecutionResponse { +} + +message ListOpenWorkflowExecutionsRequest { + string namespace = 1; + int32 maximum_page_size = 2; + bytes next_page_token = 3; + temporal.api.filter.v1.StartTimeFilter start_time_filter = 4; + oneof filters { + temporal.api.filter.v1.WorkflowExecutionFilter execution_filter = 5; + temporal.api.filter.v1.WorkflowTypeFilter type_filter = 6; + } +} + +message ListOpenWorkflowExecutionsResponse { + repeated temporal.api.workflow.v1.WorkflowExecutionInfo executions = 1; + bytes next_page_token = 2; +} + +message ListClosedWorkflowExecutionsRequest { + string namespace = 1; + int32 maximum_page_size = 2; + bytes next_page_token = 3; + temporal.api.filter.v1.StartTimeFilter start_time_filter = 4; + oneof filters { + temporal.api.filter.v1.WorkflowExecutionFilter execution_filter = 5; + temporal.api.filter.v1.WorkflowTypeFilter type_filter = 6; + temporal.api.filter.v1.StatusFilter status_filter = 7; + } +} + +message ListClosedWorkflowExecutionsResponse { + repeated temporal.api.workflow.v1.WorkflowExecutionInfo executions = 1; + bytes next_page_token = 2; +} + +message ListWorkflowExecutionsRequest { + string namespace = 1; + int32 page_size = 2; + bytes next_page_token = 3; + string query = 4; +} + +message ListWorkflowExecutionsResponse { + repeated temporal.api.workflow.v1.WorkflowExecutionInfo executions = 1; + bytes next_page_token = 2; +} + +message ListArchivedWorkflowExecutionsRequest { + string namespace = 1; + int32 page_size = 2; + bytes next_page_token = 3; + string query = 4; +} + +message ListArchivedWorkflowExecutionsResponse { + repeated temporal.api.workflow.v1.WorkflowExecutionInfo executions = 1; + bytes next_page_token = 2; +} + +message ScanWorkflowExecutionsRequest { + string namespace = 1; + int32 page_size = 2; + bytes next_page_token = 3; + string query = 4; +} + +message ScanWorkflowExecutionsResponse { + repeated temporal.api.workflow.v1.WorkflowExecutionInfo executions = 1; + bytes next_page_token = 2; +} + +message CountWorkflowExecutionsRequest { + string namespace = 1; + string query = 2; +} + +message CountWorkflowExecutionsResponse { + int64 count = 1; +} + +message GetSearchAttributesRequest { +} + +message GetSearchAttributesResponse { + map keys = 1; +} + +// TODO: deprecated APIs +message RespondQueryTaskCompletedRequest { + bytes task_token = 1; + temporal.api.enums.v1.QueryResultType completed_type = 2; + temporal.api.common.v1.Payloads query_result = 3; + string error_message = 4; + reserved 5; + string namespace = 6; +} + +message RespondQueryTaskCompletedResponse { +} + +message ResetStickyTaskQueueRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution execution = 2; +} + +message ResetStickyTaskQueueResponse { +} + +message QueryWorkflowRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution execution = 2; + temporal.api.query.v1.WorkflowQuery query = 3; + // QueryRejectCondition can used to reject the query if workflow state does not satisfy condition. + // Default: QUERY_REJECT_CONDITION_NONE. + temporal.api.enums.v1.QueryRejectCondition query_reject_condition = 4; +} + +message QueryWorkflowResponse { + temporal.api.common.v1.Payloads query_result = 1; + temporal.api.query.v1.QueryRejected query_rejected = 2; +} + +message DescribeWorkflowExecutionRequest { + string namespace = 1; + temporal.api.common.v1.WorkflowExecution execution = 2; +} + +message DescribeWorkflowExecutionResponse { + temporal.api.workflow.v1.WorkflowExecutionConfig execution_config = 1; + temporal.api.workflow.v1.WorkflowExecutionInfo workflow_execution_info = 2; + repeated temporal.api.workflow.v1.PendingActivityInfo pending_activities = 3; + repeated temporal.api.workflow.v1.PendingChildExecutionInfo pending_children = 4; +} + +message DescribeTaskQueueRequest { + string namespace = 1; + temporal.api.taskqueue.v1.TaskQueue task_queue = 2; + temporal.api.enums.v1.TaskQueueType task_queue_type = 3; + bool include_task_queue_status = 4; +} + +message DescribeTaskQueueResponse { + repeated temporal.api.taskqueue.v1.PollerInfo pollers = 1; + temporal.api.taskqueue.v1.TaskQueueStatus task_queue_status = 2; +} + +message GetClusterInfoRequest { +} + +// GetClusterInfoResponse contains information about Temporal cluster. +message GetClusterInfoResponse { + // Key is client name i.e "temporal-go", "temporal-java", or "temporal-cli". + // Value is ranges of supported versions of this client i.e ">1.1.1 <=1.4.0 || ^5.0.0". + map supported_clients = 1; + string server_version = 2; + string cluster_id = 3; + temporal.api.version.v1.VersionInfo version_info = 4; + string cluster_name = 5; + int32 history_shard_count = 6; +} + +message ListTaskQueuePartitionsRequest { + string namespace = 1; + temporal.api.taskqueue.v1.TaskQueue task_queue = 2; +} + +message ListTaskQueuePartitionsResponse { + repeated temporal.api.taskqueue.v1.TaskQueuePartitionMetadata activity_task_queue_partitions = 1; + repeated temporal.api.taskqueue.v1.TaskQueuePartitionMetadata workflow_task_queue_partitions = 2; +} diff --git a/protos/api_upstream/temporal/api/workflowservice/v1/service.proto b/protos/api_upstream/temporal/api/workflowservice/v1/service.proto new file mode 100644 index 000000000..a2b25de94 --- /dev/null +++ b/protos/api_upstream/temporal/api/workflowservice/v1/service.proto @@ -0,0 +1,283 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.workflowservice.v1; + +option go_package = "go.temporal.io/api/workflowservice/v1;workflowservice"; +option java_package = "io.temporal.api.workflowservice.v1"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option ruby_package = "Temporal::Api::WorkflowService::V1"; + + +import "temporal/api/workflowservice/v1/request_response.proto"; + +// WorkflowService API is exposed to provide support for long running applications. Application is expected to call +// StartWorkflowExecution to create an instance for each instance of long running workflow. Such applications are expected +// to have a worker which regularly polls for WorkflowTask and ActivityTask from the WorkflowService. For each +// WorkflowTask, application is expected to process the history of events for that session and respond back with next +// commands. For each ActivityTask, application is expected to execute the actual logic for that task and respond back +// with completion or failure. Worker is expected to regularly heartbeat while activity task is running. +service WorkflowService { + + // RegisterNamespace creates a new namespace which can be used as a container for all resources. Namespace is a top level + // entity within Temporal, used as a container for all resources like workflow executions, task queues, etc. Namespace + // acts as a sandbox and provides isolation for all resources within the namespace. All resources belongs to exactly one + // namespace. + rpc RegisterNamespace (RegisterNamespaceRequest) returns (RegisterNamespaceResponse) { + } + + // DescribeNamespace returns the information and configuration for a registered namespace. + rpc DescribeNamespace (DescribeNamespaceRequest) returns (DescribeNamespaceResponse) { + } + + // ListNamespaces returns the information and configuration for all namespaces. + rpc ListNamespaces (ListNamespacesRequest) returns (ListNamespacesResponse) { + } + + // (-- api-linter: core::0134::method-signature=disabled + // aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --) + // (-- api-linter: core::0134::response-message-name=disabled + // aip.dev/not-precedent: UpdateNamespace RPC doesn't follow Google API format. --) + // UpdateNamespace is used to update the information and configuration for a registered namespace. + rpc UpdateNamespace (UpdateNamespaceRequest) returns (UpdateNamespaceResponse) { + } + + // DeprecateNamespace is used to update state of a registered namespace to DEPRECATED. Once the namespace is deprecated + // it cannot be used to start new workflow executions. Existing workflow executions will continue to run on + // deprecated namespaces. + rpc DeprecateNamespace (DeprecateNamespaceRequest) returns (DeprecateNamespaceResponse) { + } + + // StartWorkflowExecution starts a new long running workflow instance. It will create the instance with + // 'WorkflowExecutionStarted' event in history and also schedule the first WorkflowTask for the worker to make the + // first command for this instance. It will return 'WorkflowExecutionAlreadyStartedFailure', if an instance already + // exists with same workflowId. + rpc StartWorkflowExecution (StartWorkflowExecutionRequest) returns (StartWorkflowExecutionResponse) { + } + + // GetWorkflowExecutionHistory returns the history of specified workflow execution. It fails with 'NotFoundFailure' if specified workflow + // execution in unknown to the service. + rpc GetWorkflowExecutionHistory (GetWorkflowExecutionHistoryRequest) returns (GetWorkflowExecutionHistoryResponse) { + } + + // PollWorkflowTaskQueue is called by application worker to process WorkflowTask from a specific task queue. A + // WorkflowTask is dispatched to callers for active workflow executions, with pending workflow tasks. + // Application is then expected to call 'RespondWorkflowTaskCompleted' API when it is done processing the WorkflowTask. + // It will also create a 'WorkflowTaskStarted' event in the history for that session before handing off WorkflowTask to + // application worker. + rpc PollWorkflowTaskQueue (PollWorkflowTaskQueueRequest) returns (PollWorkflowTaskQueueResponse) { + } + + // RespondWorkflowTaskCompleted is called by application worker to complete a WorkflowTask handed as a result of + // 'PollWorkflowTaskQueue' API call. Completing a WorkflowTask will result in new events for the workflow execution and + // potentially new ActivityTask being created for corresponding commands. It will also create a WorkflowTaskCompleted + // event in the history for that session. Use the 'taskToken' provided as response of PollWorkflowTaskQueue API call + // for completing the WorkflowTask. + // The response could contain a new workflow task if there is one or if the request asking for one. + rpc RespondWorkflowTaskCompleted (RespondWorkflowTaskCompletedRequest) returns (RespondWorkflowTaskCompletedResponse) { + } + + // RespondWorkflowTaskFailed is called by application worker to indicate failure. This results in + // WorkflowTaskFailedEvent written to the history and a new WorkflowTask created. This API can be used by client to + // either clear sticky task queue or report any panics during WorkflowTask processing. Temporal will only append first + // WorkflowTaskFailed event to the history of workflow execution for consecutive failures. + rpc RespondWorkflowTaskFailed (RespondWorkflowTaskFailedRequest) returns (RespondWorkflowTaskFailedResponse) { + } + + // PollActivityTaskQueue is called by application worker to process ActivityTask from a specific task queue. ActivityTask + // is dispatched to callers whenever a ScheduleTask command is made for a workflow execution. + // Application is expected to call 'RespondActivityTaskCompleted' or 'RespondActivityTaskFailed' once it is done + // processing the task. + // Application also needs to call 'RecordActivityTaskHeartbeat' API within 'heartbeatTimeoutSeconds' interval to + // prevent the task from getting timed out. An event 'ActivityTaskStarted' event is also written to workflow execution + // history before the ActivityTask is dispatched to application worker. + rpc PollActivityTaskQueue (PollActivityTaskQueueRequest) returns (PollActivityTaskQueueResponse) { + } + + // RecordActivityTaskHeartbeat is called by application worker while it is processing an ActivityTask. If worker fails + // to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timedout and + // 'ActivityTaskTimedOut' event will be written to the workflow history. Calling 'RecordActivityTaskHeartbeat' will + // fail with 'NotFoundFailure' in such situations. Use the 'taskToken' provided as response of + // PollActivityTaskQueue API call for heart beating. + rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) { + } + + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: "By" is used to indicate request type. --) + // RecordActivityTaskHeartbeatById is called by application worker while it is processing an ActivityTask. If worker fails + // to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timed out and + // 'ActivityTaskTimedOut' event will be written to the workflow history. Calling 'RecordActivityTaskHeartbeatById' will + // fail with 'NotFoundFailure' in such situations. Instead of using 'taskToken' like in RecordActivityTaskHeartbeat, + // use Namespace, WorkflowId and ActivityId + rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) { + } + + // RespondActivityTaskCompleted is called by application worker when it is done processing an ActivityTask. It will + // result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new WorkflowTask + // created for the workflow so new commands could be made. Use the 'taskToken' provided as response of + // PollActivityTaskQueue API call for completion. It fails with 'NotFoundFailure' if the taskToken is not valid + // anymore due to activity timeout. + rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) { + } + + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: "By" is used to indicate request type. --) + // RespondActivityTaskCompletedById is called by application worker when it is done processing an ActivityTask. + // It will result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new WorkflowTask + // created for the workflow so new commands could be made. Similar to RespondActivityTaskCompleted but use Namespace, + // WorkflowId and ActivityId instead of 'taskToken' for completion. It fails with 'NotFoundFailure' + // if the these Ids are not valid anymore due to activity timeout. + rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) { + } + + // RespondActivityTaskFailed is called by application worker when it is done processing an ActivityTask. It will + // result in a new 'ActivityTaskFailed' event being written to the workflow history and a new WorkflowTask + // created for the workflow instance so new commands could be made. Use the 'taskToken' provided as response of + // PollActivityTaskQueue API call for completion. It fails with 'NotFoundFailure' if the taskToken is not valid + // anymore due to activity timeout. + rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) { + } + + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: "By" is used to indicate request type. --) + // RespondActivityTaskFailedById is called by application worker when it is done processing an ActivityTask. + // It will result in a new 'ActivityTaskFailed' event being written to the workflow history and a new WorkflowTask + // created for the workflow instance so new commands could be made. Similar to RespondActivityTaskFailed but use + // Namespace, WorkflowId and ActivityId instead of 'taskToken' for completion. It fails with 'NotFoundFailure' + // if the these Ids are not valid anymore due to activity timeout. + rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) { + } + + // RespondActivityTaskCanceled is called by application worker when it is successfully canceled an ActivityTask. It will + // result in a new 'ActivityTaskCanceled' event being written to the workflow history and a new WorkflowTask + // created for the workflow instance so new commands could be made. Use the 'taskToken' provided as response of + // PollActivityTaskQueue API call for completion. It fails with 'NotFoundFailure' if the taskToken is not valid + // anymore due to activity timeout. + rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) { + } + + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: "By" is used to indicate request type. --) + // RespondActivityTaskCanceledById is called by application worker when it is successfully canceled an ActivityTask. + // It will result in a new 'ActivityTaskCanceled' event being written to the workflow history and a new WorkflowTask + // created for the workflow instance so new commands could be made. Similar to RespondActivityTaskCanceled but use + // Namespace, WorkflowId and ActivityId instead of 'taskToken' for completion. It fails with 'NotFoundFailure' + // if the these Ids are not valid anymore due to activity timeout. + rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) { + } + + // RequestCancelWorkflowExecution is called by application worker when it wants to request cancellation of a workflow instance. + // It will result in a new 'WorkflowExecutionCancelRequested' event being written to the workflow history and a new WorkflowTask + // created for the workflow instance so new commands could be made. It fails with 'NotFoundFailure' if the workflow is not valid + // anymore due to completion or doesn't exist. + rpc RequestCancelWorkflowExecution (RequestCancelWorkflowExecutionRequest) returns (RequestCancelWorkflowExecutionResponse) { + } + + // SignalWorkflowExecution is used to send a signal event to running workflow execution. This results in + // WorkflowExecutionSignaled event recorded in the history and a workflow task being created for the execution. + rpc SignalWorkflowExecution (SignalWorkflowExecutionRequest) returns (SignalWorkflowExecutionResponse) { + } + + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: "With" is used to indicate combined operation. --) + // SignalWithStartWorkflowExecution is used to ensure sending signal to a workflow. + // If the workflow is running, this results in WorkflowExecutionSignaled event being recorded in the history + // and a workflow task being created for the execution. + // If the workflow is not running or not found, this results in WorkflowExecutionStarted and WorkflowExecutionSignaled + // events being recorded in history, and a workflow task being created for the execution + rpc SignalWithStartWorkflowExecution (SignalWithStartWorkflowExecutionRequest) returns (SignalWithStartWorkflowExecutionResponse) { + } + + // ResetWorkflowExecution reset an existing workflow execution to WorkflowTaskCompleted event(exclusive). + // And it will immediately terminating the current execution instance. + rpc ResetWorkflowExecution (ResetWorkflowExecutionRequest) returns (ResetWorkflowExecutionResponse) { + } + + // TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event + // in the history and immediately terminating the execution instance. + rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (TerminateWorkflowExecutionResponse) { + } + + // ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace. + rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) { + } + + // ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace. + rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) { + } + + // ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace. + rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) { + } + + // ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace. + rpc ListArchivedWorkflowExecutions (ListArchivedWorkflowExecutionsRequest) returns (ListArchivedWorkflowExecutionsResponse) { + } + + // ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order. + rpc ScanWorkflowExecutions (ScanWorkflowExecutionsRequest) returns (ScanWorkflowExecutionsResponse) { + } + + // CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace. + rpc CountWorkflowExecutions (CountWorkflowExecutionsRequest) returns (CountWorkflowExecutionsResponse) { + } + + // GetSearchAttributes is a visibility API to get all legal keys that could be used in list APIs + rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) { + } + + // RespondQueryTaskCompleted is called by application worker to complete a QueryTask (which is a WorkflowTask for query) + // as a result of 'PollWorkflowTaskQueue' API call. Completing a QueryTask will unblock the client call to 'QueryWorkflow' + // API and return the query result to client as a response to 'QueryWorkflow' API call. + rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) { + } + + // ResetStickyTaskQueue resets the sticky task queue related information in mutable state of a given workflow. + // Things cleared are: + // 1. StickyTaskQueue + // 2. StickyScheduleToStartTimeout + rpc ResetStickyTaskQueue (ResetStickyTaskQueueRequest) returns (ResetStickyTaskQueueResponse) { + } + + // QueryWorkflow returns query result for a specified workflow execution + rpc QueryWorkflow (QueryWorkflowRequest) returns (QueryWorkflowResponse) { + } + + // DescribeWorkflowExecution returns information about the specified workflow execution. + rpc DescribeWorkflowExecution (DescribeWorkflowExecutionRequest) returns (DescribeWorkflowExecutionResponse) { + } + + // DescribeTaskQueue returns information about the target task queue, right now this API returns the + // pollers which polled this task queue in last few minutes. + rpc DescribeTaskQueue (DescribeTaskQueueRequest) returns (DescribeTaskQueueResponse) { + } + + // GetClusterInfo returns information about temporal cluster + rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse){ + } + + rpc ListTaskQueuePartitions(ListTaskQueuePartitionsRequest) returns (ListTaskQueuePartitionsResponse) { + } +} diff --git a/protos/core_interface.proto b/protos/core_interface.proto index 5c3c6722e..7db4e526f 100644 --- a/protos/core_interface.proto +++ b/protos/core_interface.proto @@ -2,6 +2,15 @@ syntax = "proto3"; package temporal.api.coresdk.v1; +// Note: Intellij will think these imports don't work because of the slightly odd nature of +// the include paths. They work. + +import "temporal/api/workflowservice/v1/request_response.proto"; +import "temporal/api/taskqueue/v1/message.proto"; +import "temporal/api/enums/v1/failed_cause.proto"; +import "temporal/api/failure/v1/message.proto"; +import "temporal/api/common/v1/message.proto"; + // TODO: SDK prefix in front of everything is maybe pointless given it's all within this package service CoreSDKService { @@ -24,12 +33,12 @@ message PollSDKTaskResp { message SDKWFTask { // Original task from temporal service - temporal.api.request_response.v1.PollWorkflowTaskQueueResponse original = 1; + temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponse original = 1; } message SDKActivityTask { // Original task from temporal service - temporal.api.request_response.v1.PollActivityTaskQueueResponse original = 1; + temporal.api.workflowservice.v1.PollActivityTaskQueueResponse original = 1; } @@ -79,5 +88,6 @@ message SDKWFCommand { oneof command { // Commands go here. Should we reuse and add on top of the originals? // https://github.com/temporalio/api/blob/master/temporal/api/command/v1/message.proto#L174 + bool nothing = 1; } } \ No newline at end of file