From 76de78ab7cb59de4d292738980d50fef83e2394c Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 15 May 2026 15:41:23 -0600 Subject: [PATCH 1/4] use oneof and add Links --- Makefile | 7 +- cmd/protoc-gen-nexus-rpc-yaml/generator.go | 348 ++++- cmd/protoc-gen-nexus-rpc-yaml/main.go | 5 +- .../temporal-json-schema-models-nexusrpc.yaml | 491 ++++++ nexus/temporal-proto-models-nexusrpc.yaml | 15 + openapi/openapiv2.json | 1333 +++-------------- openapi/openapiv3.yaml | 1257 ++-------------- temporal/api/history/v1/message.proto | 10 - temporal/api/namespace/v1/message.proto | 4 - temporal/api/sdk/v1/external_storage.proto | 20 - temporal/api/workflow/v1/message.proto | 45 +- .../workflowservice/v1/request_response.proto | 184 +-- temporal/api/workflowservice/v1/service.proto | 161 +- 13 files changed, 1311 insertions(+), 2569 deletions(-) create mode 100644 nexus/temporal-json-schema-models-nexusrpc.yaml delete mode 100644 temporal/api/sdk/v1/external_storage.proto diff --git a/Makefile b/Makefile index ea42652e9..b17c5af50 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ ci-build: install proto http-api-docs install: grpc-install api-linter-install buf-install # Run all linters and compile proto files. -proto: grpc http-api-docs nexus-rpc-yaml +proto: sync-nexus-annotations grpc http-api-docs nexus-rpc-yaml ######################################################################## ##### Variables ###### @@ -119,12 +119,13 @@ buf-lint: $(STAMPDIR)/buf-mod-prune buf-breaking: @printf $(COLOR) "Run buf breaking changes check against master branch..." - @(cd $(PROTO_ROOT) && buf breaking --against 'https://github.com/temporalio/api.git#branch=master') +# @(cd $(PROTO_ROOT) && buf breaking --against 'https://github.com/temporalio/api.git#branch=master') nexus-rpc-yaml: nexus-rpc-yaml-install - printf $(COLOR) "Generate nexus/temporal-proto-models-nexusrpc.yaml..." + printf $(COLOR) "Generate nexus/temporal-json-schema-models-nexusrpc.yaml and nexus/temporal-proto-models-nexusrpc.yaml..." mkdir -p nexus protoc -I $(PROTO_ROOT) \ + --nexus-rpc-yaml_opt=nexus-rpc_out=nexus/temporal-json-schema-models-nexusrpc.yaml \ --nexus-rpc-yaml_opt=nexus-rpc_langs_out=nexus/temporal-proto-models-nexusrpc.yaml \ --nexus-rpc-yaml_opt=python_package_prefix=temporalio.api \ --nexus-rpc-yaml_opt=typescript_package_prefix=@temporalio/api \ diff --git a/cmd/protoc-gen-nexus-rpc-yaml/generator.go b/cmd/protoc-gen-nexus-rpc-yaml/generator.go index 2e4a939c8..f44043e7f 100644 --- a/cmd/protoc-gen-nexus-rpc-yaml/generator.go +++ b/cmd/protoc-gen-nexus-rpc-yaml/generator.go @@ -17,9 +17,17 @@ import ( // params holds the parsed protoc plugin options. // Passed via --nexus-rpc-yaml_opt=key=value (multiple opts are comma-joined by protoc). // -// - nexus-rpc_langs_out: optional. Output path for the langs YAML. -// If empty, nothing is written. -// Example: "nexus/temporal-proto-models-nexusrpc.yaml" +// - openapi_ref_prefix: optional. When set, nexus-rpc_out emits a bare $ref to the OpenAPI +// schema rather than inlining schemas under components/schemas. +// Example: "../openapi/openapiv3.yaml#/types/" +// +// - nexus-rpc_out: optional. Output path for nexus-rpc.yaml (relative to --nexus-rpc-yaml_out dir). +// If empty, nexus-rpc.yaml is not written. +// Example: "nexus/nexus-rpc.yaml" +// +// - nexus-rpc_langs_out: optional. Output path for nexus-rpc.langs.yaml. +// If empty, nexus-rpc.langs.yaml is not written. +// Example: "nexus/nexus-rpc.langs.yaml" // // - python_package_prefix: optional. Dot-separated package prefix for $pythonRef. // The last two path segments of the go_package ({service}/v{n}) are appended. @@ -40,6 +48,8 @@ import ( // any of these values. Applied after include_operation_tags. // Example: exclude_operation_tags=internal type params struct { + openAPIRefPrefix string + nexusRpcOut string nexusRpcLangsOut string pythonPackagePrefix string typescriptPackagePrefix string @@ -59,6 +69,10 @@ func parseParams(raw string) (params, error) { return p, fmt.Errorf("invalid parameter %q: expected key=value", kv) } switch key { + case "openapi_ref_prefix": + p.openAPIRefPrefix = value + case "nexus-rpc_out": + p.nexusRpcOut = value case "nexus-rpc_langs_out": p.nexusRpcLangsOut = value case "python_package_prefix": @@ -106,8 +120,10 @@ func generate(gen *protogen.Plugin) error { return err } + nexusDoc := newDoc() langsDoc := newDoc() hasOps := false + collector := newSchemaCollector() for _, f := range gen.Files { if !f.Generate { @@ -118,9 +134,33 @@ func generate(gen *protogen.Plugin) error { if !shouldIncludeOperation(p, m) { continue } + svcName := string(svc.Desc.Name()) methodName := string(m.Desc.Name()) hasOps = true + + if p.openAPIRefPrefix != "" { + addOperation(nexusDoc, svcName, methodName, + map[string]string{"$ref": p.openAPIRefPrefix + string(m.Input.Desc.Name())}, + map[string]string{"$ref": p.openAPIRefPrefix + string(m.Output.Desc.Name())}, + ) + } else { + inputName := msgSchemaName(m.Input.Desc) + outputName := msgSchemaName(m.Output.Desc) + collector.collect(m.Input.Desc) + collector.collect(m.Output.Desc) + if refs := protoRefMap(langRefs(p, f.Desc, m.Input.Desc)); refs != nil { + collector.protoRefs[inputName] = refs + } + if refs := protoRefMap(langRefs(p, f.Desc, m.Output.Desc)); refs != nil { + collector.protoRefs[outputName] = refs + } + addOperation(nexusDoc, svcName, methodName, + map[string]string{"$ref": "#/types/" + inputName}, + map[string]string{"$ref": "#/types/" + outputName}, + ) + } + addOperation(langsDoc, svcName, methodName, langRefs(p, f.Desc, m.Input.Desc), langRefs(p, f.Desc, m.Output.Desc), @@ -132,6 +172,16 @@ func generate(gen *protogen.Plugin) error { if !hasOps { return nil } + + if p.openAPIRefPrefix == "" { + addTypes(nexusDoc, collector) + } + + if p.nexusRpcOut != "" { + if err := writeFile(gen, p.nexusRpcOut, nexusDoc); err != nil { + return err + } + } if p.nexusRpcLangsOut != "" { return writeFile(gen, p.nexusRpcLangsOut, langsDoc) } @@ -184,6 +234,298 @@ func langRefs(p params, file protoreflect.FileDescriptor, msg protoreflect.Messa return refs } +// schemaCollector recursively collects JSON Schema nodes for proto message types. +type schemaCollector struct { + schemas map[string]*yaml.Node + visited map[string]bool + protoRefs map[string]map[string]string // schema name → {$goProtoRef: ..., $pythonProtoRef: ...} +} + +func newSchemaCollector() *schemaCollector { + return &schemaCollector{ + schemas: make(map[string]*yaml.Node), + visited: make(map[string]bool), + protoRefs: make(map[string]map[string]string), + } +} + +// protoRefMap converts a langRefs map (keys like $goRef, $pythonRef) to proto ref keys +// ($goProtoRef, $pythonProtoRef, …). Returns nil if refs is empty. +func protoRefMap(refs map[string]string) map[string]string { + if len(refs) == 0 { + return nil + } + result := make(map[string]string, len(refs)) + for k, v := range refs { + result[strings.TrimSuffix(k, "Ref")+"ProtoRef"] = v + } + return result +} + +// msgSchemaName converts a proto message full name to a JSON Schema component name. +// It strips the proto package prefix and retains at most the last 2 path segments, +// joining them with "_". This matches the OpenAPI spec naming convention: +// +// temporal.api.common.v1.Payload.ExternalPayloadDetails → Payload_ExternalPayloadDetails +// temporal.api.common.v1.Link.WorkflowEvent.EventReference → WorkflowEvent_EventReference +// temporal.api.common.v1.Link.WorkflowEvent → Link_WorkflowEvent +func msgSchemaName(msg protoreflect.MessageDescriptor) string { + fullName := string(msg.FullName()) + pkg := string(msg.ParentFile().Package()) + if pkg != "" { + fullName = strings.TrimPrefix(fullName, pkg+".") + } + parts := strings.Split(fullName, ".") + if len(parts) > 2 { + parts = parts[len(parts)-2:] + } + return strings.Join(parts, "_") +} + +// collect adds the JSON Schema for msg and all transitively referenced messages to c.schemas. +// Marking visited before processing fields prevents infinite loops from circular references. +func (c *schemaCollector) collect(msg protoreflect.MessageDescriptor) { + name := msgSchemaName(msg) + if c.visited[name] { + return + } + c.visited[name] = true + + objNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + objNode.Content = append(objNode.Content, scalarNode("type"), scalarNode("object")) + + fields := msg.Fields() + if fields.Len() > 0 { + propsNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + for i := 0; i < fields.Len(); i++ { + field := fields.Get(i) + propsNode.Content = append(propsNode.Content, + scalarNode(field.JSONName()), + c.fieldNode(field), + ) + } + objNode.Content = append(objNode.Content, scalarNode("properties"), propsNode) + } + + c.schemas[name] = objNode +} + +// fieldNode returns the JSON Schema node for a single proto field, handling map, +// repeated (list), and singular cardinalities. +func (c *schemaCollector) fieldNode(field protoreflect.FieldDescriptor) *yaml.Node { + if field.IsMap() { + // map → {type: object, additionalProperties: } + valueField := field.Message().Fields().ByName("value") + node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + node.Content = append(node.Content, + scalarNode("type"), + scalarNode("object"), + scalarNode("additionalProperties"), + c.kindNode(valueField), + ) + return node + } + item := c.kindNode(field) + if field.IsList() { + // repeated T → {type: array, items: } + node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + node.Content = append(node.Content, + scalarNode("type"), + scalarNode("array"), + scalarNode("items"), + item, + ) + return node + } + return item +} + +// kindNode returns the JSON Schema for the base (scalar/message/enum) type of a field, +// ignoring any repeated/map cardinality wrapping. +func (c *schemaCollector) kindNode(field protoreflect.FieldDescriptor) *yaml.Node { + switch field.Kind() { + case protoreflect.BoolKind: + return typeNode("boolean") + case protoreflect.StringKind: + return typeNode("string") + case protoreflect.BytesKind: + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("string"), + scalarNode("format"), scalarNode("byte"), + ) + return n + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("integer"), + scalarNode("format"), scalarNode("int32"), + ) + return n + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("integer"), + scalarNode("format"), scalarNode("uint32"), + ) + return n + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind, + protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + // protojson encodes 64-bit integers as decimal strings to avoid JS precision loss. + return typeNode("string") + case protoreflect.FloatKind: + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("number"), + scalarNode("format"), scalarNode("float"), + ) + return n + case protoreflect.DoubleKind: + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("number"), + scalarNode("format"), scalarNode("double"), + ) + return n + case protoreflect.EnumKind: + return enumNode(field.Enum()) + case protoreflect.MessageKind, protoreflect.GroupKind: + return c.msgRefNode(field.Message()) + } + return typeNode("object") +} + +// msgRefNode returns an inline schema for well-known proto types, or a $ref for all others. +// It also triggers recursive schema collection for non-well-known message types. +func (c *schemaCollector) msgRefNode(msg protoreflect.MessageDescriptor) *yaml.Node { + switch string(msg.FullName()) { + case "google.protobuf.Duration": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("string"), + scalarNode("pattern"), scalarNode(`^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$`), + ) + return n + case "google.protobuf.Timestamp": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("string"), + scalarNode("format"), scalarNode("date-time"), + ) + return n + case "google.protobuf.Empty": + return typeNode("object") + case "google.protobuf.Any", + "google.protobuf.Struct", + "google.protobuf.Value": + return typeNode("object") + case "google.protobuf.ListValue": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("array"), + scalarNode("items"), typeNode("object"), + ) + return n + case "google.protobuf.BoolValue": + return typeNode("boolean") + case "google.protobuf.StringValue": + return typeNode("string") + case "google.protobuf.BytesValue": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("string"), + scalarNode("format"), scalarNode("byte"), + ) + return n + case "google.protobuf.Int32Value", + "google.protobuf.UInt32Value": + return typeNode("integer") + case "google.protobuf.Int64Value", + "google.protobuf.UInt64Value": + return typeNode("string") + case "google.protobuf.FloatValue": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("number"), + scalarNode("format"), scalarNode("float"), + ) + return n + case "google.protobuf.DoubleValue": + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, + scalarNode("type"), scalarNode("number"), + scalarNode("format"), scalarNode("double"), + ) + return n + } + name := msgSchemaName(msg) + c.collect(msg) + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, scalarNode("$ref"), scalarNode("#/types/"+name)) + return n +} + +// enumNode builds a JSON Schema enum node listing all enum value names. +func enumNode(e protoreflect.EnumDescriptor) *yaml.Node { + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + seqNode := &yaml.Node{Kind: yaml.SequenceNode, Tag: "!!seq"} + values := e.Values() + for i := 0; i < values.Len(); i++ { + seqNode.Content = append(seqNode.Content, scalarNode(string(values.Get(i).Name()))) + } + n.Content = append(n.Content, + scalarNode("enum"), seqNode, + scalarNode("type"), scalarNode("string"), + scalarNode("format"), scalarNode("enum"), + ) + return n +} + +func typeNode(t string) *yaml.Node { + n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + n.Content = append(n.Content, scalarNode("type"), scalarNode(t)) + return n +} + +// addTypes inserts a "types:" section into doc, positioned between the +// "nexusrpc" version header and the "services" block. Types are sorted +// alphabetically for deterministic output. +func addTypes(doc *yaml.Node, c *schemaCollector) { + root := doc.Content[0] + + names := make([]string, 0, len(c.schemas)) + for name := range c.schemas { + names = append(names, name) + } + sort.Strings(names) + + typesNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} + for _, name := range names { + schema := c.schemas[name] + if refs, ok := c.protoRefs[name]; ok { + refKeys := make([]string, 0, len(refs)) + for k := range refs { + refKeys = append(refKeys, k) + } + sort.Strings(refKeys) + prefix := make([]*yaml.Node, 0, 2*len(refs)) + for _, k := range refKeys { + prefix = append(prefix, scalarNode(k), scalarNode(refs[k])) + } + schema.Content = append(prefix, schema.Content...) + } + typesNode.Content = append(typesNode.Content, scalarNode(name), schema) + } + + // root.Content layout: [nexusrpc, 1.0.0, services, {...}] + // After insert: [nexusrpc, 1.0.0, types, {...}, services, {...}] + newContent := make([]*yaml.Node, 0, len(root.Content)+2) + newContent = append(newContent, root.Content[:2]...) + newContent = append(newContent, scalarNode("types"), typesNode) + newContent = append(newContent, root.Content[2:]...) + root.Content = newContent +} + // newDoc creates a yaml.Node document with the "nexusrpc: 1.0.0" header // and an empty "services" mapping node. func newDoc() *yaml.Node { diff --git a/cmd/protoc-gen-nexus-rpc-yaml/main.go b/cmd/protoc-gen-nexus-rpc-yaml/main.go index 31cdca92f..23c3a8e7c 100644 --- a/cmd/protoc-gen-nexus-rpc-yaml/main.go +++ b/cmd/protoc-gen-nexus-rpc-yaml/main.go @@ -1,5 +1,6 @@ -// protoc-gen-nexus-rpc-yaml is a protoc plugin that generates nexus/temporal-proto-models-nexusrpc.yaml -// from proto service methods annotated with option (nexusannotations.v1.operation).tags = "exposed". +// protoc-gen-nexus-rpc-yaml is a protoc plugin that generates nexus/nexus-rpc.yaml +// and nexus/nexus-rpc.langs.yaml from proto service methods annotated with +// option (nexusannotations.v1.operation).tags = "exposed". package main import ( diff --git a/nexus/temporal-json-schema-models-nexusrpc.yaml b/nexus/temporal-json-schema-models-nexusrpc.yaml new file mode 100644 index 000000000..6ab424d04 --- /dev/null +++ b/nexus/temporal-json-schema-models-nexusrpc.yaml @@ -0,0 +1,491 @@ +nexusrpc: 1.0.0 +types: + Deployment: + type: object + properties: + seriesName: + type: string + buildId: + type: string + Header: + type: object + properties: + fields: + type: object + additionalProperties: + $ref: '#/types/Payload' + Link: + type: object + properties: + workflowEvent: + $ref: '#/types/Link_WorkflowEvent' + batchJob: + $ref: '#/types/Link_BatchJob' + activity: + $ref: '#/types/Link_Activity' + nexusOperation: + $ref: '#/types/Link_NexusOperation' + Link_Activity: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + Link_BatchJob: + type: object + properties: + jobId: + type: string + Link_NexusOperation: + type: object + properties: + namespace: + type: string + operationId: + type: string + runId: + type: string + Link_WorkflowEvent: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + eventRef: + $ref: '#/types/WorkflowEvent_EventReference' + requestIdRef: + $ref: '#/types/WorkflowEvent_RequestIdReference' + Memo: + type: object + properties: + fields: + type: object + additionalProperties: + $ref: '#/types/Payload' + Payload: + type: object + properties: + metadata: + type: object + additionalProperties: + type: string + format: byte + data: + type: string + format: byte + externalPayloads: + type: array + items: + $ref: '#/types/Payload_ExternalPayloadDetails' + Payload_ExternalPayloadDetails: + type: object + properties: + sizeBytes: + type: string + Payloads: + type: object + properties: + payloads: + type: array + items: + $ref: '#/types/Payload' + Priority: + type: object + properties: + priorityKey: + type: integer + format: int32 + fairnessKey: + type: string + fairnessWeight: + type: number + format: float + RetryPolicy: + type: object + properties: + initialInterval: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + backoffCoefficient: + type: number + format: double + maximumInterval: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + maximumAttempts: + type: integer + format: int32 + nonRetryableErrorTypes: + type: array + items: + type: string + SearchAttributes: + type: object + properties: + indexedFields: + type: object + additionalProperties: + $ref: '#/types/Payload' + SignalWithStartWorkflowExecutionRequest: + $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.SignalWithStartWorkflowExecutionRequest + $goProtoRef: go.temporal.io/api/workflowservice/v1.SignalWithStartWorkflowExecutionRequest + $javaProtoRef: io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest + $pythonProtoRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest + $rubyProtoRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionRequest + $typescriptProtoRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionRequest' + type: object + properties: + namespace: + type: string + workflowId: + type: string + workflowType: + $ref: '#/types/WorkflowType' + taskQueue: + $ref: '#/types/TaskQueue' + input: + $ref: '#/types/Payloads' + workflowExecutionTimeout: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + workflowRunTimeout: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + workflowTaskTimeout: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + identity: + type: string + requestId: + type: string + workflowIdReusePolicy: + enum: + - WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED + - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE + - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY + - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE + - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING + type: string + format: enum + workflowIdConflictPolicy: + enum: + - WORKFLOW_ID_CONFLICT_POLICY_UNSPECIFIED + - WORKFLOW_ID_CONFLICT_POLICY_FAIL + - WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING + - WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING + type: string + format: enum + signalName: + type: string + signalInput: + $ref: '#/types/Payloads' + control: + type: string + retryPolicy: + $ref: '#/types/RetryPolicy' + cronSchedule: + type: string + memo: + $ref: '#/types/Memo' + searchAttributes: + $ref: '#/types/SearchAttributes' + header: + $ref: '#/types/Header' + workflowStartDelay: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + userMetadata: + $ref: '#/types/UserMetadata' + links: + type: array + items: + $ref: '#/types/Link' + versioningOverride: + $ref: '#/types/VersioningOverride' + priority: + $ref: '#/types/Priority' + timeSkippingConfig: + $ref: '#/types/TimeSkippingConfig' + SignalWithStartWorkflowExecutionResponse: + $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.SignalWithStartWorkflowExecutionResponse + $goProtoRef: go.temporal.io/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse + $javaProtoRef: io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse + $pythonProtoRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse + $rubyProtoRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse + $typescriptProtoRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' + type: object + properties: + runId: + type: string + started: + type: boolean + signalLink: + $ref: '#/types/Link' + TaskQueue: + type: object + properties: + name: + type: string + kind: + enum: + - TASK_QUEUE_KIND_UNSPECIFIED + - TASK_QUEUE_KIND_NORMAL + - TASK_QUEUE_KIND_STICKY + - TASK_QUEUE_KIND_WORKER_COMMANDS + type: string + format: enum + normalName: + type: string + TimeSkippingConfig: + type: object + properties: + enabled: + type: boolean + disablePropagation: + type: boolean + maxSkippedDuration: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + maxElapsedDuration: + type: string + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + maxTargetTime: + type: string + format: date-time + UserMetadata: + type: object + properties: + summary: + $ref: '#/types/Payload' + details: + $ref: '#/types/Payload' + VersioningOverride: + type: object + properties: + pinned: + $ref: '#/types/VersioningOverride_PinnedOverride' + autoUpgrade: + type: boolean + behavior: + enum: + - VERSIONING_BEHAVIOR_UNSPECIFIED + - VERSIONING_BEHAVIOR_PINNED + - VERSIONING_BEHAVIOR_AUTO_UPGRADE + type: string + format: enum + deployment: + $ref: '#/types/Deployment' + pinnedVersion: + type: string + VersioningOverride_PinnedOverride: + type: object + properties: + behavior: + enum: + - PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED + - PINNED_OVERRIDE_BEHAVIOR_PINNED + type: string + format: enum + version: + $ref: '#/types/WorkerDeploymentVersion' + WaitForExternalWorkflowRequest: + $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest + $goProtoRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest + $javaProtoRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest + $pythonProtoRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest + $rubyProtoRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest + $typescriptProtoRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' + type: object + properties: + namespace: + type: string + execution: + $ref: '#/types/WorkflowExecution' + requestId: + type: string + WaitForExternalWorkflowResponse: + $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse + $goProtoRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse + $javaProtoRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse + $pythonProtoRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse + $rubyProtoRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse + $typescriptProtoRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' + type: object + WorkerDeploymentVersion: + type: object + properties: + buildId: + type: string + deploymentName: + type: string + WorkflowEvent_EventReference: + type: object + properties: + eventId: + type: string + eventType: + enum: + - EVENT_TYPE_UNSPECIFIED + - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED + - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED + - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT + - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED + - EVENT_TYPE_WORKFLOW_TASK_STARTED + - EVENT_TYPE_WORKFLOW_TASK_COMPLETED + - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT + - EVENT_TYPE_WORKFLOW_TASK_FAILED + - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED + - EVENT_TYPE_ACTIVITY_TASK_STARTED + - EVENT_TYPE_ACTIVITY_TASK_COMPLETED + - EVENT_TYPE_ACTIVITY_TASK_FAILED + - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT + - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED + - EVENT_TYPE_ACTIVITY_TASK_CANCELED + - EVENT_TYPE_TIMER_STARTED + - EVENT_TYPE_TIMER_FIRED + - EVENT_TYPE_TIMER_CANCELED + - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED + - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED + - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED + - EVENT_TYPE_MARKER_RECORDED + - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED + - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED + - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW + - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED + - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED + - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED + - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY + - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY + - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED + - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED + - EVENT_TYPE_NEXUS_OPERATION_STARTED + - EVENT_TYPE_NEXUS_OPERATION_COMPLETED + - EVENT_TYPE_NEXUS_OPERATION_FAILED + - EVENT_TYPE_NEXUS_OPERATION_CANCELED + - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED + - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED + - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED + - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED + - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + type: string + format: enum + WorkflowEvent_RequestIdReference: + type: object + properties: + requestId: + type: string + eventType: + enum: + - EVENT_TYPE_UNSPECIFIED + - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED + - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED + - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT + - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED + - EVENT_TYPE_WORKFLOW_TASK_STARTED + - EVENT_TYPE_WORKFLOW_TASK_COMPLETED + - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT + - EVENT_TYPE_WORKFLOW_TASK_FAILED + - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED + - EVENT_TYPE_ACTIVITY_TASK_STARTED + - EVENT_TYPE_ACTIVITY_TASK_COMPLETED + - EVENT_TYPE_ACTIVITY_TASK_FAILED + - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT + - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED + - EVENT_TYPE_ACTIVITY_TASK_CANCELED + - EVENT_TYPE_TIMER_STARTED + - EVENT_TYPE_TIMER_FIRED + - EVENT_TYPE_TIMER_CANCELED + - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED + - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED + - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED + - EVENT_TYPE_MARKER_RECORDED + - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED + - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED + - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW + - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT + - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED + - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED + - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED + - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED + - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED + - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED + - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY + - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY + - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED + - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED + - EVENT_TYPE_NEXUS_OPERATION_STARTED + - EVENT_TYPE_NEXUS_OPERATION_COMPLETED + - EVENT_TYPE_NEXUS_OPERATION_FAILED + - EVENT_TYPE_NEXUS_OPERATION_CANCELED + - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED + - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED + - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED + - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED + - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED + - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + type: string + format: enum + WorkflowExecution: + type: object + properties: + workflowId: + type: string + runId: + type: string + WorkflowType: + type: object + properties: + name: + type: string +services: + WorkflowService: + operations: + SignalWithStartWorkflowExecution: + input: + $ref: '#/types/SignalWithStartWorkflowExecutionRequest' + output: + $ref: '#/types/SignalWithStartWorkflowExecutionResponse' + WaitForExternalWorkflow: + input: + $ref: '#/types/WaitForExternalWorkflowRequest' + output: + $ref: '#/types/WaitForExternalWorkflowResponse' diff --git a/nexus/temporal-proto-models-nexusrpc.yaml b/nexus/temporal-proto-models-nexusrpc.yaml index e0761fd15..a9f010b20 100644 --- a/nexus/temporal-proto-models-nexusrpc.yaml +++ b/nexus/temporal-proto-models-nexusrpc.yaml @@ -17,3 +17,18 @@ services: $pythonRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse $rubyRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse $typescriptRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' + WaitForExternalWorkflow: + input: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' + output: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 12d163654..42e22ce01 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -150,13 +150,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "weakConsistency", - "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -723,102 +716,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { - "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { - "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -912,101 +809,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { - "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { - "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -3488,13 +3290,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "includeSystemWorkers", - "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -4179,6 +3974,51 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { + "post": { + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", @@ -4675,16 +4515,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution4", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -4697,21 +4536,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -4721,7 +4560,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -4730,16 +4569,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution4", + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" } }, "default": { @@ -4752,21 +4590,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow to pause.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", + "description": "ID of the workflow execution to be paused. Required.", "in": "path", "required": true, "type": "string" @@ -4776,7 +4607,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" } } ], @@ -4785,15 +4616,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById4", + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", + "operationId": "SignalWithStartWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" } }, "default": { @@ -4806,21 +4638,19 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -4830,7 +4660,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" } } ], @@ -4839,216 +4669,7 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { - "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution4", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { - "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions4", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { - "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", - "operationId": "PauseWorkflowExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow to pause.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { - "post": { - "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", - "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", - "operationId": "SignalWithStartWorkflowExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { "post": { "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", "operationId": "UnpauseWorkflowExecution2", @@ -5437,13 +5058,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "weakConsistency", - "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -6180,199 +5794,12 @@ "/namespaces/{namespace}/activities/{activityId}/heartbeat": { "post": { "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Id of the activity we're heartbeating", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/pause": { - "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/reset": { - "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { - "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "operationId": "RecordActivityTaskHeartbeatById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -6392,7 +5819,7 @@ }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -6402,7 +5829,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -6411,16 +5838,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { - "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1PollActivityExecutionResponse" } }, "default": { @@ -6444,12 +5870,11 @@ "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" - } + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6457,16 +5882,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/unpause": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -6479,14 +5903,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -6496,7 +5920,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -6505,15 +5929,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/activities/{activityId}/terminate": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions", + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -6526,14 +5951,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6543,7 +5966,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -8963,13 +8386,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "includeSystemWorkers", - "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -9654,16 +9070,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { + "/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { "post": { - "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", - "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", - "operationId": "RequestCancelWorkflowExecution", + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" } }, "default": { @@ -9681,7 +9096,7 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" @@ -9691,7 +9106,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" } } ], @@ -9700,15 +9115,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { - "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", - "operationId": "ResetWorkflowExecution", + "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", + "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", + "operationId": "RequestCancelWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" + "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" } }, "default": { @@ -9736,7 +9152,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" } } ], @@ -9745,16 +9161,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution", + "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", + "operationId": "ResetWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" } }, "default": { @@ -9777,19 +9192,12 @@ "required": true, "type": "string" }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" } } ], @@ -9798,15 +9206,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" } }, "default": { @@ -9830,47 +9239,8 @@ "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { - "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "The namespace name of the target Workflow.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowExecution.workflowId", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -9880,7 +9250,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" } } ], @@ -9889,15 +9259,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" } }, "default": { @@ -9910,7 +9280,6 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" @@ -9921,119 +9290,12 @@ "required": true, "type": "string" }, - { - "name": "request.input.name", - "description": "The name of the Update handler to invoke on the target Workflow.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowId}": { - "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { - "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById3", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Id of the activity to complete", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" } } ], @@ -10042,15 +9304,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById3", + "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", + "operationId": "UpdateWorkflowExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" } }, "default": { @@ -10063,21 +9325,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to fail", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -10087,7 +9341,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" } } ], @@ -10096,15 +9350,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById3", + "summary": "Invokes the specified Update function on user Workflow code.", + "operationId": "UpdateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" } }, "default": { @@ -10117,21 +9371,20 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" }, { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity we're heartbeating", + "name": "request.input.name", + "description": "The name of the Update handler to invoke on the target Workflow.", "in": "path", "required": true, "type": "string" @@ -10141,7 +9394,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" } } ], @@ -10150,16 +9403,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/namespaces/{namespace}/workflows/{workflowId}": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution3", + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -10172,21 +9425,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -10196,7 +9440,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -10205,16 +9449,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution3", + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -10227,21 +9470,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to complete", "in": "path", "required": true, "type": "string" @@ -10251,7 +9494,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -10260,15 +9503,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById3", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -10295,7 +9538,7 @@ }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "Id of the activity to fail", "in": "path", "required": true, "type": "string" @@ -10305,7 +9548,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -10314,16 +9557,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution3", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -10336,21 +9578,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -10360,7 +9602,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -10369,15 +9611,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions3", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -10397,14 +9639,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -10414,7 +9656,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -11250,36 +10492,6 @@ "reason": { "type": "string", "description": "Reason to pause the activity." - }, - "requestId": { - "type": "string", - "description": "Used to de-dupe pause requests." - } - }, - "description": "Deprecated. Use `PauseActivityExecutionRequest`." - }, - "WorkflowServicePauseActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "reason": { - "type": "string", - "description": "Reason to pause the activity." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - }, - "requestId": { - "type": "string", - "description": "Used to de-dupe pause requests." } } }, @@ -11517,43 +10729,10 @@ }, "restoreOriginalOptions": { "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." } }, - "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." - }, - "WorkflowServiceResetActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "resetHeartbeat": { - "type": "boolean", - "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." - }, - "keepPaused": { - "type": "boolean", - "title": "If activity is paused, it will remain paused after reset" - }, - "jitter": { - "type": "string", - "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" - }, - "restoreOriginalOptions": { - "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } - } + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -12512,40 +11691,6 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } - }, - "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." - }, - "WorkflowServiceUnpauseActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "resetAttempts": { - "type": "boolean", - "description": "Providing this flag will also reset the number of attempts." - }, - "resetHeartbeat": { - "type": "boolean", - "description": "Providing this flag will also reset the heartbeat details." - }, - "reason": { - "type": "string", - "description": "Reason to unpause the activity." - }, - "jitter": { - "type": "string", - "description": "If set, the activity will start at a random time within the specified jitter duration." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } } }, "WorkflowServiceUnpauseWorkflowExecutionBody": { @@ -12569,35 +11714,6 @@ } } }, - "WorkflowServiceUpdateActivityExecutionOptionsBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "title": "The identity of the client who initiated this request" - }, - "activityOptions": { - "$ref": "#/definitions/v1ActivityOptions", - "title": "Activity options. Partial updates are accepted and controlled by update_mask" - }, - "updateMask": { - "type": "string", - "title": "Controls which fields from `activity_options` will be applied" - }, - "restoreOriginal": { - "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } - } - }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -12631,10 +11747,10 @@ }, "restoreOriginal": { "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } }, - "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions\nDeprecated. Use `UpdateActivityExecutionOptionsRequest`." + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", @@ -12920,6 +12036,25 @@ }, "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." }, + "WorkflowServiceWaitForExternalWorkflowBody": { + "type": "object", + "properties": { + "execution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "The workflow execution to wait for.", + "title": "The workflow execution to wait for." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe requests. Typically should be UUID." + } + } + }, "apiActivityV1CallbackInfo": { "type": "object", "properties": { @@ -16450,14 +15585,6 @@ "pollerAutoscaling": { "type": "boolean", "title": "True if the namespace supports poller autoscaling" - }, - "workerCommands": { - "type": "boolean", - "description": "True if the namespace supports worker commands (server-to-worker communication via control queues)." - }, - "standaloneNexusOperation": { - "type": "boolean", - "description": "True if the namespace supports standalone Nexus operations." } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." @@ -17166,12 +16293,8 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityExecutionResponse": { - "type": "object" - }, "v1PauseActivityResponse": { - "type": "object", - "description": "Deprecated. Use `PauseActivityExecutionResponse`." + "type": "object" }, "v1PauseWorkflowExecutionResponse": { "type": "object", @@ -18005,12 +17128,8 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityExecutionResponse": { - "type": "object" - }, "v1ResetActivityResponse": { - "type": "object", - "description": "Deprecated. Use `ResetActivityExecutionRequest`." + "type": "object" }, "v1ResetOptions": { "type": "object", @@ -18955,14 +18074,6 @@ "priority": { "$ref": "#/definitions/v1Priority", "title": "Priority metadata" - }, - "timeSkippingConfig": { - "$ref": "#/definitions/v1TimeSkippingConfig", - "description": "The propagated time-skipping configuration for the child workflow." - }, - "initialSkippedDuration": { - "type": "string", - "description": "Propagate the duration skipped to the child workflow." } } }, @@ -19351,7 +18462,11 @@ "properties": { "enabled": { "type": "boolean", - "description": "Enables or disables time skipping for this workflow execution." + "description": "Enables or disables time skipping for this workflow execution.\nBy default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \nat the time they are started.\nChanges made after a transitively related workflow has started are not propagated." + }, + "disablePropagation": { + "type": "boolean", + "description": "If set, the enabled field is not propagated to transitively related workflows." }, "maxSkippedDuration": { "type": "string", @@ -19360,9 +18475,14 @@ "maxElapsedDuration": { "type": "string", "description": "Maximum elapsed time since time skipping was enabled.\nThis includes both skipped time and real time elapsing." + }, + "maxTargetTime": { + "type": "string", + "format": "date-time", + "description": "Absolute virtual timestamp at which time skipping is disabled.\nTime skipping will not advance beyond this point." } }, - "description": "Configuration for time skipping during a workflow execution.\nWhen enabled, virtual time advances automatically whenever there is no in-flight work.\nIn-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\nand possibly other features added in the future.\nUser timers are not classified as in-flight work and will be skipped over.\nWhen time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.\n\nPropagation behavior of time skipping:\nThe enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n(1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n(2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n(3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." + "description": "Configuration for time skipping during a workflow execution.\nWhen enabled, virtual time advances automatically whenever there is no in-flight work.\nIn-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\nand possibly other features added in the future.\nUser timers are not classified as in-flight work and will be skipped over.\nWhen time advances, it skips to the earlier of the next user timer or the configured bound, if either exists." }, "v1TimeoutFailureInfo": { "type": "object", @@ -19488,26 +18608,13 @@ } } }, - "v1UnpauseActivityExecutionResponse": { - "type": "object" - }, "v1UnpauseActivityResponse": { - "type": "object", - "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." + "type": "object" }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, - "v1UpdateActivityExecutionOptionsResponse": { - "type": "object", - "properties": { - "activityOptions": { - "$ref": "#/definitions/v1ActivityOptions", - "title": "Activity options after an update" - } - } - }, "v1UpdateActivityOptionsResponse": { "type": "object", "properties": { @@ -19515,8 +18622,7 @@ "$ref": "#/definitions/v1ActivityOptions", "title": "Activity options after an update" } - }, - "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." + } }, "v1UpdateAdmittedEventOrigin": { "type": "string", @@ -19813,6 +18919,9 @@ }, "description": "Used to override the versioning behavior (and pinned deployment version, if applicable) of a\nspecific workflow execution. If set, this override takes precedence over worker-sent values.\nSee `WorkflowExecutionInfo.VersioningInfo` for more information.\n\nTo remove the override, call `UpdateWorkflowExecutionOptions` with a null\n`VersioningOverride`, and use the `update_mask` to indicate that it should be mutated.\n\nPinned behavior overrides are automatically inherited by child workflows, workflow retries, continue-as-new\nworkflows, and cron workflows." }, + "v1WaitForExternalWorkflowResponse": { + "type": "object" + }, "v1WaitPolicy": { "type": "object", "properties": { @@ -20660,7 +19769,7 @@ }, "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", - "description": "Time-skipping configuration for this workflow execution.\nIf not set, the time-skipping configuration is not updated by this request;\nthe existing configuration is preserved." + "description": "Time-skipping configuration for this workflow execution.\nIf not set, the time-skipping conf will not get updated upon request, \ni.e. the existing time-skipping conf will be preserved." } } }, @@ -20930,10 +20039,6 @@ "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", "description": "Initial time-skipping configuration for this workflow execution, recorded at start time.\nThis may have been set explicitly via the start workflow request, or propagated from a\nparent/previous execution.\n\nThe configuration may be updated after start via UpdateWorkflowExecutionOptions, which\nwill be reflected in the WorkflowExecutionOptionsUpdatedEvent." - }, - "initialSkippedDuration": { - "type": "string", - "description": "The time skipped by the previous execution that started this workflow.\nIt can happen in cases of child workflows and continue-as-new workflows." } }, "title": "Always the first event in workflow history" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 14a6a130c..a52c301c6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -109,15 +109,6 @@ paths: in: query schema: type: string - - name: weakConsistency - in: query - description: |- - If true, the server may serve the response from an eventually-consistent - source instead of reading through to persistence. Defaults to false, - which preserves read-after-write consistency. SDKs should set this when - fetching namespace capabilities on worker/client startup. - schema: - type: boolean responses: "200": description: OK @@ -670,107 +661,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/reset: - post: - tags: - - WorkflowService - description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -854,92 +744,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -3161,13 +2965,6 @@ paths: * Status schema: type: string - - name: includeSystemWorkers - in: query - description: |- - When true, the response will include system workers that are created implicitly - by the server and not by the user. By default, system workers are excluded. - schema: - type: boolean responses: "200": description: OK @@ -3754,6 +3551,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + post: + tags: + - WorkflowService + description: |- + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}: post: tags: @@ -3942,45 +3781,33 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -3988,7 +3815,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -3996,47 +3823,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: post: tags: - WorkflowService description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow to pause. required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. + description: ID of the workflow execution to be paused. Required. required: true schema: type: string @@ -4044,7 +3861,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' required: true responses: "200": @@ -4052,217 +3869,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to confirm is cancelled - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: workflowId - in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: - post: - tags: - - WorkflowService - description: |- - Note: This is an experimental API and the behavior may change in a future release. - PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in - - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history - - No new workflow tasks or activity tasks are dispatched. - - Any workflow task currently executing on the worker will be allowed to complete. - - Any activity task currently executing will be paused. - - All server-side events will continue to be processed by the server. - - Queries & Updates on a paused workflow will be rejected. - operationId: PauseWorkflowExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow to pause. - required: true - schema: - type: string - - name: workflowId - in: path - description: ID of the workflow execution to be paused. Required. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseWorkflowExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseWorkflowExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: - post: - tags: - - WorkflowService - description: |- - SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if - it isn't yet started. + SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if + it isn't yet started. If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history and a workflow task is generated. @@ -4888,15 +4508,6 @@ paths: in: query schema: type: string - - name: weakConsistency - in: query - description: |- - If true, the server may serve the response from an eventually-consistent - source instead of reading through to persistence. Defaults to false, - which preserves read-after-write consistency. SDKs should set this when - fetching namespace capabilities on worker/client startup. - schema: - type: boolean responses: "200": description: OK @@ -5673,107 +5284,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/reset: - post: - tags: - - WorkflowService - description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -5857,92 +5367,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/activity-complete: post: tags: @@ -8106,13 +7530,6 @@ paths: * Status schema: type: string - - name: includeSystemWorkers - in: query - description: |- - When true, the response will include system workers that are created implicitly - by the server and not by the user. By default, system workers are excluded. - schema: - type: boolean responses: "200": description: OK @@ -8699,172 +8116,26 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}: - post: - tags: - - WorkflowService - description: |- - StartWorkflowExecution starts a new workflow execution. - - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCompletedById + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to complete - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: - post: - tags: - - WorkflowService - description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to fail - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: - post: - tags: - - WorkflowService - description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId + - name: namespace in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - - name: activityId + - name: execution.workflow_id in: path - description: Id of the activity we're heartbeating required: true schema: type: string @@ -8872,7 +8143,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' required: true responses: "200": @@ -8880,52 +8151,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + /namespaces/{namespace}/workflows/{workflowId}: post: tags: - WorkflowService description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + StartWorkflowExecution starts a new workflow execution. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. required: true schema: type: string @@ -8933,7 +8184,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/StartWorkflowExecutionRequest' required: true responses: "200": @@ -8941,47 +8192,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/StartWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: post: tags: - WorkflowService description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCompletedById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to complete required: true schema: type: string @@ -8989,7 +8233,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' required: true responses: "200": @@ -8997,24 +8241,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by + See `RecordActivityTaskFailed`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + operationId: RespondActivityTaskFailedById parameters: - name: namespace in: path @@ -9030,7 +8274,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: Id of the activity to fail required: true schema: type: string @@ -9038,7 +8282,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -9046,45 +8290,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity we're heartbeating required: true schema: type: string @@ -9092,7 +8331,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -9100,21 +8339,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -9124,15 +8366,13 @@ paths: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -9140,7 +8380,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -9148,7 +8388,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: @@ -12921,12 +12161,6 @@ components: pollerAutoscaling: type: boolean description: True if the namespace supports poller autoscaling - workerCommands: - type: boolean - description: True if the namespace supports worker commands (server-to-worker communication via control queues). - standaloneNexusOperation: - type: boolean - description: True if the namespace supports standalone Nexus operations. description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object @@ -13579,38 +12813,6 @@ components: PatchScheduleResponse: type: object properties: {} - PauseActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - reason: - type: string - description: Reason to pause the activity. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - requestId: - type: string - description: Used to de-dupe pause requests. - PauseActivityExecutionResponse: - type: object - properties: {} PauseActivityRequest: type: object properties: @@ -13635,14 +12837,9 @@ components: reason: type: string description: Reason to pause the activity. - requestId: - type: string - description: Used to de-dupe pause requests. - description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} - description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -14772,52 +13969,6 @@ components: Indicate if the request is still buffered. If so, the event ID is not known and its value will be an invalid event ID. description: RequestIdInfo contains details of a request ID. - ResetActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - resetHeartbeat: - type: boolean - description: |- - Indicates that activity should reset heartbeat details. - This flag will be applied only to the new instance of the activity. - keepPaused: - type: boolean - description: If activity is paused, it will remain paused after reset - jitter: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: |- - If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. - (unless it is paused and keep_paused is set) - restoreOriginalOptions: - type: boolean - description: |- - If set, the activity options will be restored to the defaults. - Default options are then options activity was created with. - They are part of the first schedule event. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - ResetActivityExecutionResponse: - type: object - properties: {} ResetActivityRequest: type: object properties: @@ -14859,14 +14010,11 @@ components: description: |- If set, the activity options will be restored to the defaults. Default options are then options activity was created with. - They are part of the first schedule event. - description: |- - NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities - Deprecated. Use `ResetActivityExecutionRequest`. + They are part of the first SCHEDULE event. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' ResetActivityResponse: type: object properties: {} - description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -16493,14 +15641,6 @@ components: allOf: - $ref: '#/components/schemas/Priority' description: Priority metadata - timeSkippingConfig: - allOf: - - $ref: '#/components/schemas/TimeSkippingConfig' - description: The propagated time-skipping configuration for the child workflow. - initialSkippedDuration: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: Propagate the duration skipped to the child workflow. StartNexusOperationExecutionRequest: type: object properties: @@ -17187,7 +16327,10 @@ components: properties: enabled: type: boolean - description: Enables or disables time skipping for this workflow execution. + description: "Enables or disables time skipping for this workflow execution.\n By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \n at the time they are started.\n Changes made after a transitively related workflow has started are not propagated." + disablePropagation: + type: boolean + description: If set, the enabled field is not propagated to transitively related workflows. maxSkippedDuration: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string @@ -17198,7 +16341,19 @@ components: description: |- Maximum elapsed time since time skipping was enabled. This includes both skipped time and real time elapsing. - description: "Configuration for time skipping during a workflow execution.\n When enabled, virtual time advances automatically whenever there is no in-flight work.\n In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\n and possibly other features added in the future.\n User timers are not classified as in-flight work and will be skipped over.\n When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.\n \n Propagation behavior of time skipping:\n The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." + maxTargetTime: + type: string + description: |- + Absolute virtual timestamp at which time skipping is disabled. + Time skipping will not advance beyond this point. + format: date-time + description: |- + Configuration for time skipping during a workflow execution. + When enabled, virtual time advances automatically whenever there is no in-flight work. + In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, + and possibly other features added in the future. + User timers are not classified as in-flight work and will be skipped over. + When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists. TimeoutFailureInfo: type: object properties: @@ -17315,45 +16470,6 @@ components: applied: type: boolean description: True is the rule was applied, based on the rule conditions (predicate/visibility_query). - UnpauseActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - resetAttempts: - type: boolean - description: Providing this flag will also reset the number of attempts. - resetHeartbeat: - type: boolean - description: Providing this flag will also reset the heartbeat details. - reason: - type: string - description: Reason to unpause the activity. - jitter: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: If set, the activity will start at a random time within the specified jitter duration. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - UnpauseActivityExecutionResponse: - type: object - properties: {} UnpauseActivityRequest: type: object properties: @@ -17386,11 +16502,9 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. - description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} - description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -17416,52 +16530,6 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. - UpdateActivityExecutionOptionsRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request - activityOptions: - allOf: - - $ref: '#/components/schemas/ActivityOptions' - description: Activity options. Partial updates are accepted and controlled by update_mask - updateMask: - type: string - description: Controls which fields from `activity_options` will be applied - format: field-mask - restoreOriginal: - type: boolean - description: |- - If set, the activity options will be restored to the default. - Default options are then options activity was created with. - They are part of the first schedule event. - This flag cannot be combined with any other option; if you supply - restore_original together with other options, the request will be rejected. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - UpdateActivityExecutionOptionsResponse: - type: object - properties: - activityOptions: - allOf: - - $ref: '#/components/schemas/ActivityOptions' - description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: @@ -17497,12 +16565,10 @@ components: description: |- If set, the activity options will be restored to the default. Default options are then options activity was created with. - They are part of the first schedule event. + They are part of the first SCHEDULE event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: |- - NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions - Deprecated. Use `UpdateActivityExecutionOptionsRequest`. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' UpdateActivityOptionsResponse: type: object properties: @@ -17510,7 +16576,6 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update - description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: @@ -18105,6 +17170,21 @@ components: If omitted and the target workflow is not pinned, the override request will be rejected with a PreconditionFailed error. + WaitForExternalWorkflowRequest: + type: object + properties: + namespace: + type: string + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: The workflow execution to wait for. + requestId: + type: string + description: Used to de-dupe requests. Typically should be UUID. + WaitForExternalWorkflowResponse: + type: object + properties: {} WaitPolicy: type: object properties: @@ -19238,10 +18318,7 @@ components: timeSkippingConfig: allOf: - $ref: '#/components/schemas/TimeSkippingConfig' - description: |- - Time-skipping configuration for this workflow execution. - If not set, the time-skipping configuration is not updated by this request; - the existing configuration is preserved. + description: "Time-skipping configuration for this workflow execution.\n If not set, the time-skipping conf will not get updated upon request, \n i.e. the existing time-skipping conf will be preserved." WorkflowExecutionOptionsUpdatedEventAttributes: type: object properties: @@ -19585,12 +18662,6 @@ components: The configuration may be updated after start via UpdateWorkflowExecutionOptions, which will be reflected in the WorkflowExecutionOptionsUpdatedEvent. - initialSkippedDuration: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: |- - The time skipped by the previous execution that started this workflow. - It can happen in cases of child workflows and continue-as-new workflows. description: Always the first event in workflow history WorkflowExecutionTerminatedEventAttributes: type: object diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index e57ec8d60..e873412bf 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -204,10 +204,6 @@ message WorkflowExecutionStartedEventAttributes { // The configuration may be updated after start via UpdateWorkflowExecutionOptions, which // will be reflected in the WorkflowExecutionOptionsUpdatedEvent. temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 41; - - // The time skipped by the previous execution that started this workflow. - // It can happen in cases of child workflows and continue-as-new workflows. - google.protobuf.Duration initial_skipped_duration = 42; } // Wrapper for a target deployment version that the SDK declined to upgrade to. @@ -774,12 +770,6 @@ message StartChildWorkflowExecutionInitiatedEventAttributes { bool inherit_build_id = 19 [deprecated = true]; // Priority metadata temporal.api.common.v1.Priority priority = 20; - - // The propagated time-skipping configuration for the child workflow. - temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 21; - - // Propagate the duration skipped to the child workflow. - google.protobuf.Duration initial_skipped_duration = 30; } message StartChildWorkflowExecutionFailedEventAttributes { diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index 56d0193a5..cded0e372 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -50,10 +50,6 @@ message NamespaceInfo { bool worker_poll_complete_on_shutdown = 8; // True if the namespace supports poller autoscaling bool poller_autoscaling = 9; - // True if the namespace supports worker commands (server-to-worker communication via control queues). - bool worker_commands = 10; - // True if the namespace supports standalone Nexus operations. - bool standalone_nexus_operation = 11; } // Namespace configured limits diff --git a/temporal/api/sdk/v1/external_storage.proto b/temporal/api/sdk/v1/external_storage.proto deleted file mode 100644 index 5a08f9995..000000000 --- a/temporal/api/sdk/v1/external_storage.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package temporal.api.sdk.v1; - -option go_package = "go.temporal.io/api/sdk/v1;sdk"; -option java_package = "io.temporal.api.sdk.v1"; -option java_multiple_files = true; -option java_outer_classname = "ExternalStorageProto"; -option ruby_package = "Temporalio::Api::Sdk::V1"; -option csharp_namespace = "Temporalio.Api.Sdk.V1"; - -// ExternalStorageReference identifies a payload stored in an external storage system. -// It is used as a claim-check token, allowing the actual payload data to be retrieved -// from the named driver using the provided claim data. -message ExternalStorageReference { - // The name of the storage driver responsible for retrieving the payload. - string driver_name = 1; - // Driver-specific key-value pairs that identify and provide access to the stored payload. - map claim_data = 2; -} diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 51b39b76a..c21d84953 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -580,8 +580,8 @@ message WorkflowExecutionOptions { temporal.api.common.v1.Priority priority = 2; // Time-skipping configuration for this workflow execution. - // If not set, the time-skipping configuration is not updated by this request; - // the existing configuration is preserved. + // If not set, the time-skipping conf will not get updated upon request, + // i.e. the existing time-skipping conf will be preserved. TimeSkippingConfig time_skipping_config = 3; } @@ -591,32 +591,31 @@ message WorkflowExecutionOptions { // and possibly other features added in the future. // User timers are not classified as in-flight work and will be skipped over. // When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists. -// -// Propagation behavior of time skipping: -// The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows: -// (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are -// inherited from the current execution. The configured bound is shared between the inherited skipped -// duration and any additional duration skipped by the new run. -// (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the -// current workflow started; the accumulated skipped duration of the current run is not propagated. -// (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays -// all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that -// point, the resulting run ends up with the same final time-skipping configuration as the previous run. message TimeSkippingConfig { - reserved 2, 6; - reserved "disable_propagation", "max_target_time"; // Enables or disables time skipping for this workflow execution. + // By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) + // at the time they are started. + // Changes made after a transitively related workflow has started are not propagated. bool enabled = 1; - // Optional bound that limits the gap between the virtual time of this execution and wall-clock time. - // Once the bound is reached, time skipping is automatically disabled, - // but can be re-enabled by setting `enabled` to true via UpdateWorkflowExecutionOptions. - // This bound cannot be set to a value smaller than the execution's currently skipped duration. + // If set, the enabled field is not propagated to transitively related workflows. + bool disable_propagation = 2; + + // Optional bound that limits how long time skipping remains active. + // Once the bound is reached, time skipping is automatically disabled. + // It can later be re-enabled via UpdateWorkflowExecutionOptions. + // + // This is particularly useful in testing scenarios where workflows + // are expected to receive signals, updates, or other events while + // timers are in progress. // - // This is useful in testing scenarios where a workflow is expected to receive - // signals, updates, or other external events while timers are in progress. + // This bound is not propagated to transitively related workflows. + // When bound is also needed for transitively related workflows, + // it is recommended to set disable_propagation to true + // and configure TimeSkippingConfig explicitly for transitively related workflows. oneof bound { + // Maximum total virtual time that can be skipped. google.protobuf.Duration max_skipped_duration = 4; @@ -624,6 +623,10 @@ message TimeSkippingConfig { // This includes both skipped time and real time elapsing. // (-- api-linter: core::0142::time-field-names=disabled --) google.protobuf.Duration max_elapsed_duration = 5; + + // Absolute virtual timestamp at which time skipping is disabled. + // Time skipping will not advance beyond this point. + google.protobuf.Timestamp max_target_time = 6; } } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f4012c73d..c09021d0e 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -86,11 +86,6 @@ message ListNamespacesResponse { message DescribeNamespaceRequest { string namespace = 1; string id = 2; - // If true, the server may serve the response from an eventually-consistent - // source instead of reading through to persistence. Defaults to false, - // which preserves read-after-write consistency. SDKs should set this when - // fetching namespace capabilities on worker/client startup. - bool weak_consistency = 3; } message DescribeNamespaceResponse { @@ -204,7 +199,6 @@ message StartWorkflowExecutionRequest { temporal.api.common.v1.Priority priority = 27; // Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`. temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28; - // Time-skipping configuration. If not set, time skipping is disabled. temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 29; } @@ -2071,7 +2065,6 @@ message ExecuteMultiOperationResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions -// Deprecated. Use `UpdateActivityExecutionOptionsRequest`. message UpdateActivityOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; @@ -2099,56 +2092,17 @@ message UpdateActivityOptionsRequest { // If set, the activity options will be restored to the default. // Default options are then options activity was created with. - // They are part of the first schedule event. - // This flag cannot be combined with any other option; if you supply - // restore_original together with other options, the request will be rejected. - bool restore_original = 8; -} - -message UpdateActivityExecutionOptionsRequest { - // Namespace of the workflow which scheduled this activity - string namespace = 1; - - // If provided, targets a workflow activity for the given workflow ID. - // If empty, targets a standalone activity. - string workflow_id = 2; - // The ID of the activity to target. - string activity_id = 3; - // Run ID of the workflow or standalone activity. - string run_id = 4; - - // The identity of the client who initiated this request - string identity = 5; - - // Activity options. Partial updates are accepted and controlled by update_mask - temporal.api.activity.v1.ActivityOptions activity_options = 6; - - // Controls which fields from `activity_options` will be applied - google.protobuf.FieldMask update_mask = 7; - - // If set, the activity options will be restored to the default. - // Default options are then options activity was created with. - // They are part of the first schedule event. + // They are part of the first SCHEDULE event. // This flag cannot be combined with any other option; if you supply // restore_original together with other options, the request will be rejected. bool restore_original = 8; - - // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - string resource_id = 9; } -// Deprecated. Use `UpdateActivityExecutionOptionsResponse`. message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } -message UpdateActivityExecutionOptionsResponse { - // Activity options after an update - temporal.api.activity.v1.ActivityOptions activity_options = 1; -} - -// Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2169,45 +2123,11 @@ message PauseActivityRequest { // Reason to pause the activity. string reason = 6; - - // Used to de-dupe pause requests. - string request_id = 7; - -} - -message PauseActivityExecutionRequest { - // Namespace of the workflow which scheduled this activity. - string namespace = 1; - - // If provided, pause a workflow activity (or activities) for the given workflow ID. - // If empty, targets a standalone activity. - string workflow_id = 2; - // The ID of the activity to target. - string activity_id = 3; - // Run ID of the workflow or standalone activity. - string run_id = 4; - - // The identity of the client who initiated this request. - string identity = 5; - - // Reason to pause the activity. - string reason = 6; - - // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - string resource_id = 7; - - // Used to de-dupe pause requests. - string request_id = 8; } -// Deprecated. Use `PauseActivityExecutionResponse`. message PauseActivityResponse { } -message PauseActivityExecutionResponse { -} - -// Deprecated. Use `UnpauseActivityExecutionRequest`. message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2237,46 +2157,10 @@ message UnpauseActivityRequest { google.protobuf.Duration jitter = 9; } -message UnpauseActivityExecutionRequest { - // Namespace of the workflow which scheduled this activity. - string namespace = 1; - - // If provided, targets a workflow activity for the given workflow ID. - // If empty, targets a standalone activity. - string workflow_id = 2; - // The ID of the activity to target. - string activity_id = 3; - // Run ID of the workflow or standalone activity. - string run_id = 4; - - // The identity of the client who initiated this request. - string identity = 5; - - // Providing this flag will also reset the number of attempts. - bool reset_attempts = 6; - - // Providing this flag will also reset the heartbeat details. - bool reset_heartbeat = 7; - - // Reason to unpause the activity. - string reason = 8; - - // If set, the activity will start at a random time within the specified jitter duration. - google.protobuf.Duration jitter = 9; - - // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - string resource_id = 10; -} - -// Deprecated. Use `UnpauseActivityExecutionResponse`. message UnpauseActivityResponse { } -message UnpauseActivityExecutionResponse { -} - // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities -// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2309,52 +2193,14 @@ message ResetActivityRequest { // If set, the activity options will be restored to the defaults. // Default options are then options activity was created with. - // They are part of the first schedule event. - bool restore_original_options = 9; -} - -message ResetActivityExecutionRequest { - // Namespace of the workflow which scheduled this activity. - string namespace = 1; - - // If provided, targets a workflow activity for the given workflow ID. - // If empty, targets a standalone activity. - string workflow_id = 2; - // The ID of the activity to target. - string activity_id = 3; - // Run ID of the workflow or standalone activity. - string run_id = 4; - - // The identity of the client who initiated this request. - string identity = 5; - - // Indicates that activity should reset heartbeat details. - // This flag will be applied only to the new instance of the activity. - bool reset_heartbeat = 6; - - // If activity is paused, it will remain paused after reset - bool keep_paused = 7; - - // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. - // (unless it is paused and keep_paused is set) - google.protobuf.Duration jitter = 8; - - // If set, the activity options will be restored to the defaults. - // Default options are then options activity was created with. - // They are part of the first schedule event. + // They are part of the first SCHEDULE event. bool restore_original_options = 9; - // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - string resource_id = 10; } -// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityResponse { } -message ResetActivityExecutionResponse { -} - // Keep the parameters in sync with: // - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions. // - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions. @@ -2935,10 +2781,6 @@ message ListWorkersRequest { //* StartTime //* Status string query = 4; - - // When true, the response will include system workers that are created implicitly - // by the server and not by the user. By default, system workers are excluded. - bool include_system_workers = 5; } message ListWorkersResponse { @@ -3544,3 +3386,25 @@ message DeleteNexusOperationExecutionRequest { message DeleteNexusOperationExecutionResponse { } + +message WaitForExternalWorkflowRequest { + string namespace = 1; + // The workflow execution to wait for. + temporal.api.common.v1.WorkflowExecution execution = 2; + // Used to de-dupe requests. Typically should be UUID. + string request_id = 3; + string identity = 4; + + repeated temporal.api.common.v1.Link links = 5; +} + +message WaitForExternalWorkflowResponse { + temporal.api.enums.v1.WorkflowExecutionStatus status = 1; + + repeated temporal.api.common.v1.Link links = 2; + + oneof status { + temporal.api.common.v1.Payload result = 3; + temporal.api.failure.v1.Failure failure = 4; + } +} \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 49be10dfb..96b192bdb 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1530,10 +1530,6 @@ service WorkflowService { body: "*" } }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" - }; } // WorkerHeartbeat receive heartbeat request from the worker. @@ -1869,141 +1865,6 @@ service WorkflowService { // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteActivityExecution (DeleteActivityExecutionRequest) returns (DeleteActivityExecutionResponse) {} - // PauseActivityExecution pauses the execution of an activity specified by its ID. - // This API can be used to target a workflow activity or a standalone activity - // - // Pausing an activity means: - // - If the activity is currently waiting for a retry or is running and subsequently fails, - // it will not be rescheduled until it is unpaused. - // - If the activity is already paused, calling this method will have no effect. - // - If the activity is running and finishes successfully, the activity will be completed. - // - If the activity is running and finishes with failure: - // * if there is no retry left - the activity will be completed. - // * if there are more retries left - the activity will be paused. - // For long-running activities: - // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - // - // Returns a `NotFound` error if there is no pending activity with the provided ID - rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { - option (google.api.http) = { - // Standalone activity - post: "/namespaces/{namespace}/activities/{activity_id}/pause" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/pause" - body: "*" - } - // Workflow activity - additional_bindings { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" - body: "*" - } - additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "{resource_id}" - }; - } - - // ResetActivityExecution resets the execution of an activity specified by its ID. - // This API can be used to target a workflow activity or a standalone activity. - // - // Resetting an activity means: - // * number of attempts will be reset to 0. - // * activity timeouts will be reset. - // * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - // it will be scheduled immediately (* see 'jitter' flag) - // - // Returns a `NotFound` error if there is no pending activity with the provided ID or type. - rpc ResetActivityExecution (ResetActivityExecutionRequest) returns (ResetActivityExecutionResponse) { - option (google.api.http) = { - // Standalone activity - post: "/namespaces/{namespace}/activities/{activity_id}/reset" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/reset" - body: "*" - } - // Workflow activity - additional_bindings { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" - body: "*" - } - additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "{resource_id}" - }; - } - - // UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - // This API can be used to target a workflow activity or a standalone activity. - // - // If activity is not paused, this call will have no effect. - // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - // Once the activity is unpaused, all timeout timers will be regenerated. - // - // Returns a `NotFound` error if there is no pending activity with the provided ID - rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { - option (google.api.http) = { - // Standalone activity - post: "/namespaces/{namespace}/activities/{activity_id}/unpause" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/unpause" - body: "*" - } - // Workflow activity - additional_bindings { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" - body: "*" - } - additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "{resource_id}" - }; - } - - // UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - // This API can be used to target a workflow activity or a standalone activity. - rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { - option (google.api.http) = { - // Standalone activity - post: "/namespaces/{namespace}/activities/{activity_id}/update-options" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/update-options" - body: "*" - } - // Workflow activity - additional_bindings { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" - body: "*" - } - additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "{resource_id}" - }; - } - // TerminateNexusOperationExecution terminates an existing Nexus operation immediately. // // Termination happens immediately and the operation handler cannot react to it. A terminated operation will have @@ -2026,4 +1887,26 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: Nexus operation deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteNexusOperationExecution (DeleteNexusOperationExecutionRequest) returns (DeleteNexusOperationExecutionResponse) {} + // WaitForExternalWorkflow asynchronously waits for an external workflow to complete + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + rpc WaitForExternalWorkflow (WaitForExternalWorkflowRequest) returns (WaitForExternalWorkflowResponse) { + option (nexusannotations.v1.operation).tags = "exposed"; + + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } } From c2161ac6e2e746a303e9f0a8bd753120da0d2327 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 15 May 2026 15:43:54 -0600 Subject: [PATCH 2/4] diffs --- Makefile | 7 +- cmd/protoc-gen-nexus-rpc-yaml/generator.go | 348 +---- cmd/protoc-gen-nexus-rpc-yaml/main.go | 5 +- nexus/temporal-proto-models-nexusrpc.yaml | 15 - openapi/openapiv2.json | 1333 ++++++++++++++--- openapi/openapiv3.yaml | 1255 ++++++++++++++-- temporal/api/history/v1/message.proto | 10 + temporal/api/namespace/v1/message.proto | 4 + temporal/api/sdk/v1/external_storage.proto | 20 + temporal/api/workflow/v1/message.proto | 45 +- .../workflowservice/v1/request_response.proto | 2 +- 11 files changed, 2270 insertions(+), 774 deletions(-) create mode 100644 temporal/api/sdk/v1/external_storage.proto diff --git a/Makefile b/Makefile index b17c5af50..ea42652e9 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ ci-build: install proto http-api-docs install: grpc-install api-linter-install buf-install # Run all linters and compile proto files. -proto: sync-nexus-annotations grpc http-api-docs nexus-rpc-yaml +proto: grpc http-api-docs nexus-rpc-yaml ######################################################################## ##### Variables ###### @@ -119,13 +119,12 @@ buf-lint: $(STAMPDIR)/buf-mod-prune buf-breaking: @printf $(COLOR) "Run buf breaking changes check against master branch..." -# @(cd $(PROTO_ROOT) && buf breaking --against 'https://github.com/temporalio/api.git#branch=master') + @(cd $(PROTO_ROOT) && buf breaking --against 'https://github.com/temporalio/api.git#branch=master') nexus-rpc-yaml: nexus-rpc-yaml-install - printf $(COLOR) "Generate nexus/temporal-json-schema-models-nexusrpc.yaml and nexus/temporal-proto-models-nexusrpc.yaml..." + printf $(COLOR) "Generate nexus/temporal-proto-models-nexusrpc.yaml..." mkdir -p nexus protoc -I $(PROTO_ROOT) \ - --nexus-rpc-yaml_opt=nexus-rpc_out=nexus/temporal-json-schema-models-nexusrpc.yaml \ --nexus-rpc-yaml_opt=nexus-rpc_langs_out=nexus/temporal-proto-models-nexusrpc.yaml \ --nexus-rpc-yaml_opt=python_package_prefix=temporalio.api \ --nexus-rpc-yaml_opt=typescript_package_prefix=@temporalio/api \ diff --git a/cmd/protoc-gen-nexus-rpc-yaml/generator.go b/cmd/protoc-gen-nexus-rpc-yaml/generator.go index f44043e7f..2e4a939c8 100644 --- a/cmd/protoc-gen-nexus-rpc-yaml/generator.go +++ b/cmd/protoc-gen-nexus-rpc-yaml/generator.go @@ -17,17 +17,9 @@ import ( // params holds the parsed protoc plugin options. // Passed via --nexus-rpc-yaml_opt=key=value (multiple opts are comma-joined by protoc). // -// - openapi_ref_prefix: optional. When set, nexus-rpc_out emits a bare $ref to the OpenAPI -// schema rather than inlining schemas under components/schemas. -// Example: "../openapi/openapiv3.yaml#/types/" -// -// - nexus-rpc_out: optional. Output path for nexus-rpc.yaml (relative to --nexus-rpc-yaml_out dir). -// If empty, nexus-rpc.yaml is not written. -// Example: "nexus/nexus-rpc.yaml" -// -// - nexus-rpc_langs_out: optional. Output path for nexus-rpc.langs.yaml. -// If empty, nexus-rpc.langs.yaml is not written. -// Example: "nexus/nexus-rpc.langs.yaml" +// - nexus-rpc_langs_out: optional. Output path for the langs YAML. +// If empty, nothing is written. +// Example: "nexus/temporal-proto-models-nexusrpc.yaml" // // - python_package_prefix: optional. Dot-separated package prefix for $pythonRef. // The last two path segments of the go_package ({service}/v{n}) are appended. @@ -48,8 +40,6 @@ import ( // any of these values. Applied after include_operation_tags. // Example: exclude_operation_tags=internal type params struct { - openAPIRefPrefix string - nexusRpcOut string nexusRpcLangsOut string pythonPackagePrefix string typescriptPackagePrefix string @@ -69,10 +59,6 @@ func parseParams(raw string) (params, error) { return p, fmt.Errorf("invalid parameter %q: expected key=value", kv) } switch key { - case "openapi_ref_prefix": - p.openAPIRefPrefix = value - case "nexus-rpc_out": - p.nexusRpcOut = value case "nexus-rpc_langs_out": p.nexusRpcLangsOut = value case "python_package_prefix": @@ -120,10 +106,8 @@ func generate(gen *protogen.Plugin) error { return err } - nexusDoc := newDoc() langsDoc := newDoc() hasOps := false - collector := newSchemaCollector() for _, f := range gen.Files { if !f.Generate { @@ -134,33 +118,9 @@ func generate(gen *protogen.Plugin) error { if !shouldIncludeOperation(p, m) { continue } - svcName := string(svc.Desc.Name()) methodName := string(m.Desc.Name()) hasOps = true - - if p.openAPIRefPrefix != "" { - addOperation(nexusDoc, svcName, methodName, - map[string]string{"$ref": p.openAPIRefPrefix + string(m.Input.Desc.Name())}, - map[string]string{"$ref": p.openAPIRefPrefix + string(m.Output.Desc.Name())}, - ) - } else { - inputName := msgSchemaName(m.Input.Desc) - outputName := msgSchemaName(m.Output.Desc) - collector.collect(m.Input.Desc) - collector.collect(m.Output.Desc) - if refs := protoRefMap(langRefs(p, f.Desc, m.Input.Desc)); refs != nil { - collector.protoRefs[inputName] = refs - } - if refs := protoRefMap(langRefs(p, f.Desc, m.Output.Desc)); refs != nil { - collector.protoRefs[outputName] = refs - } - addOperation(nexusDoc, svcName, methodName, - map[string]string{"$ref": "#/types/" + inputName}, - map[string]string{"$ref": "#/types/" + outputName}, - ) - } - addOperation(langsDoc, svcName, methodName, langRefs(p, f.Desc, m.Input.Desc), langRefs(p, f.Desc, m.Output.Desc), @@ -172,16 +132,6 @@ func generate(gen *protogen.Plugin) error { if !hasOps { return nil } - - if p.openAPIRefPrefix == "" { - addTypes(nexusDoc, collector) - } - - if p.nexusRpcOut != "" { - if err := writeFile(gen, p.nexusRpcOut, nexusDoc); err != nil { - return err - } - } if p.nexusRpcLangsOut != "" { return writeFile(gen, p.nexusRpcLangsOut, langsDoc) } @@ -234,298 +184,6 @@ func langRefs(p params, file protoreflect.FileDescriptor, msg protoreflect.Messa return refs } -// schemaCollector recursively collects JSON Schema nodes for proto message types. -type schemaCollector struct { - schemas map[string]*yaml.Node - visited map[string]bool - protoRefs map[string]map[string]string // schema name → {$goProtoRef: ..., $pythonProtoRef: ...} -} - -func newSchemaCollector() *schemaCollector { - return &schemaCollector{ - schemas: make(map[string]*yaml.Node), - visited: make(map[string]bool), - protoRefs: make(map[string]map[string]string), - } -} - -// protoRefMap converts a langRefs map (keys like $goRef, $pythonRef) to proto ref keys -// ($goProtoRef, $pythonProtoRef, …). Returns nil if refs is empty. -func protoRefMap(refs map[string]string) map[string]string { - if len(refs) == 0 { - return nil - } - result := make(map[string]string, len(refs)) - for k, v := range refs { - result[strings.TrimSuffix(k, "Ref")+"ProtoRef"] = v - } - return result -} - -// msgSchemaName converts a proto message full name to a JSON Schema component name. -// It strips the proto package prefix and retains at most the last 2 path segments, -// joining them with "_". This matches the OpenAPI spec naming convention: -// -// temporal.api.common.v1.Payload.ExternalPayloadDetails → Payload_ExternalPayloadDetails -// temporal.api.common.v1.Link.WorkflowEvent.EventReference → WorkflowEvent_EventReference -// temporal.api.common.v1.Link.WorkflowEvent → Link_WorkflowEvent -func msgSchemaName(msg protoreflect.MessageDescriptor) string { - fullName := string(msg.FullName()) - pkg := string(msg.ParentFile().Package()) - if pkg != "" { - fullName = strings.TrimPrefix(fullName, pkg+".") - } - parts := strings.Split(fullName, ".") - if len(parts) > 2 { - parts = parts[len(parts)-2:] - } - return strings.Join(parts, "_") -} - -// collect adds the JSON Schema for msg and all transitively referenced messages to c.schemas. -// Marking visited before processing fields prevents infinite loops from circular references. -func (c *schemaCollector) collect(msg protoreflect.MessageDescriptor) { - name := msgSchemaName(msg) - if c.visited[name] { - return - } - c.visited[name] = true - - objNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - objNode.Content = append(objNode.Content, scalarNode("type"), scalarNode("object")) - - fields := msg.Fields() - if fields.Len() > 0 { - propsNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - for i := 0; i < fields.Len(); i++ { - field := fields.Get(i) - propsNode.Content = append(propsNode.Content, - scalarNode(field.JSONName()), - c.fieldNode(field), - ) - } - objNode.Content = append(objNode.Content, scalarNode("properties"), propsNode) - } - - c.schemas[name] = objNode -} - -// fieldNode returns the JSON Schema node for a single proto field, handling map, -// repeated (list), and singular cardinalities. -func (c *schemaCollector) fieldNode(field protoreflect.FieldDescriptor) *yaml.Node { - if field.IsMap() { - // map → {type: object, additionalProperties: } - valueField := field.Message().Fields().ByName("value") - node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - node.Content = append(node.Content, - scalarNode("type"), - scalarNode("object"), - scalarNode("additionalProperties"), - c.kindNode(valueField), - ) - return node - } - item := c.kindNode(field) - if field.IsList() { - // repeated T → {type: array, items: } - node := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - node.Content = append(node.Content, - scalarNode("type"), - scalarNode("array"), - scalarNode("items"), - item, - ) - return node - } - return item -} - -// kindNode returns the JSON Schema for the base (scalar/message/enum) type of a field, -// ignoring any repeated/map cardinality wrapping. -func (c *schemaCollector) kindNode(field protoreflect.FieldDescriptor) *yaml.Node { - switch field.Kind() { - case protoreflect.BoolKind: - return typeNode("boolean") - case protoreflect.StringKind: - return typeNode("string") - case protoreflect.BytesKind: - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("string"), - scalarNode("format"), scalarNode("byte"), - ) - return n - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("integer"), - scalarNode("format"), scalarNode("int32"), - ) - return n - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("integer"), - scalarNode("format"), scalarNode("uint32"), - ) - return n - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind, - protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - // protojson encodes 64-bit integers as decimal strings to avoid JS precision loss. - return typeNode("string") - case protoreflect.FloatKind: - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("number"), - scalarNode("format"), scalarNode("float"), - ) - return n - case protoreflect.DoubleKind: - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("number"), - scalarNode("format"), scalarNode("double"), - ) - return n - case protoreflect.EnumKind: - return enumNode(field.Enum()) - case protoreflect.MessageKind, protoreflect.GroupKind: - return c.msgRefNode(field.Message()) - } - return typeNode("object") -} - -// msgRefNode returns an inline schema for well-known proto types, or a $ref for all others. -// It also triggers recursive schema collection for non-well-known message types. -func (c *schemaCollector) msgRefNode(msg protoreflect.MessageDescriptor) *yaml.Node { - switch string(msg.FullName()) { - case "google.protobuf.Duration": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("string"), - scalarNode("pattern"), scalarNode(`^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$`), - ) - return n - case "google.protobuf.Timestamp": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("string"), - scalarNode("format"), scalarNode("date-time"), - ) - return n - case "google.protobuf.Empty": - return typeNode("object") - case "google.protobuf.Any", - "google.protobuf.Struct", - "google.protobuf.Value": - return typeNode("object") - case "google.protobuf.ListValue": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("array"), - scalarNode("items"), typeNode("object"), - ) - return n - case "google.protobuf.BoolValue": - return typeNode("boolean") - case "google.protobuf.StringValue": - return typeNode("string") - case "google.protobuf.BytesValue": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("string"), - scalarNode("format"), scalarNode("byte"), - ) - return n - case "google.protobuf.Int32Value", - "google.protobuf.UInt32Value": - return typeNode("integer") - case "google.protobuf.Int64Value", - "google.protobuf.UInt64Value": - return typeNode("string") - case "google.protobuf.FloatValue": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("number"), - scalarNode("format"), scalarNode("float"), - ) - return n - case "google.protobuf.DoubleValue": - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, - scalarNode("type"), scalarNode("number"), - scalarNode("format"), scalarNode("double"), - ) - return n - } - name := msgSchemaName(msg) - c.collect(msg) - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, scalarNode("$ref"), scalarNode("#/types/"+name)) - return n -} - -// enumNode builds a JSON Schema enum node listing all enum value names. -func enumNode(e protoreflect.EnumDescriptor) *yaml.Node { - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - seqNode := &yaml.Node{Kind: yaml.SequenceNode, Tag: "!!seq"} - values := e.Values() - for i := 0; i < values.Len(); i++ { - seqNode.Content = append(seqNode.Content, scalarNode(string(values.Get(i).Name()))) - } - n.Content = append(n.Content, - scalarNode("enum"), seqNode, - scalarNode("type"), scalarNode("string"), - scalarNode("format"), scalarNode("enum"), - ) - return n -} - -func typeNode(t string) *yaml.Node { - n := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - n.Content = append(n.Content, scalarNode("type"), scalarNode(t)) - return n -} - -// addTypes inserts a "types:" section into doc, positioned between the -// "nexusrpc" version header and the "services" block. Types are sorted -// alphabetically for deterministic output. -func addTypes(doc *yaml.Node, c *schemaCollector) { - root := doc.Content[0] - - names := make([]string, 0, len(c.schemas)) - for name := range c.schemas { - names = append(names, name) - } - sort.Strings(names) - - typesNode := &yaml.Node{Kind: yaml.MappingNode, Tag: "!!map"} - for _, name := range names { - schema := c.schemas[name] - if refs, ok := c.protoRefs[name]; ok { - refKeys := make([]string, 0, len(refs)) - for k := range refs { - refKeys = append(refKeys, k) - } - sort.Strings(refKeys) - prefix := make([]*yaml.Node, 0, 2*len(refs)) - for _, k := range refKeys { - prefix = append(prefix, scalarNode(k), scalarNode(refs[k])) - } - schema.Content = append(prefix, schema.Content...) - } - typesNode.Content = append(typesNode.Content, scalarNode(name), schema) - } - - // root.Content layout: [nexusrpc, 1.0.0, services, {...}] - // After insert: [nexusrpc, 1.0.0, types, {...}, services, {...}] - newContent := make([]*yaml.Node, 0, len(root.Content)+2) - newContent = append(newContent, root.Content[:2]...) - newContent = append(newContent, scalarNode("types"), typesNode) - newContent = append(newContent, root.Content[2:]...) - root.Content = newContent -} - // newDoc creates a yaml.Node document with the "nexusrpc: 1.0.0" header // and an empty "services" mapping node. func newDoc() *yaml.Node { diff --git a/cmd/protoc-gen-nexus-rpc-yaml/main.go b/cmd/protoc-gen-nexus-rpc-yaml/main.go index 23c3a8e7c..31cdca92f 100644 --- a/cmd/protoc-gen-nexus-rpc-yaml/main.go +++ b/cmd/protoc-gen-nexus-rpc-yaml/main.go @@ -1,6 +1,5 @@ -// protoc-gen-nexus-rpc-yaml is a protoc plugin that generates nexus/nexus-rpc.yaml -// and nexus/nexus-rpc.langs.yaml from proto service methods annotated with -// option (nexusannotations.v1.operation).tags = "exposed". +// protoc-gen-nexus-rpc-yaml is a protoc plugin that generates nexus/temporal-proto-models-nexusrpc.yaml +// from proto service methods annotated with option (nexusannotations.v1.operation).tags = "exposed". package main import ( diff --git a/nexus/temporal-proto-models-nexusrpc.yaml b/nexus/temporal-proto-models-nexusrpc.yaml index a9f010b20..e0761fd15 100644 --- a/nexus/temporal-proto-models-nexusrpc.yaml +++ b/nexus/temporal-proto-models-nexusrpc.yaml @@ -17,18 +17,3 @@ services: $pythonRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse $rubyRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse $typescriptRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' - WaitForExternalWorkflow: - input: - $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest - $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest - $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest - $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest - $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest - $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' - output: - $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse - $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse - $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse - $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse - $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse - $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 42e22ce01..12d163654 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -150,6 +150,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "weakConsistency", + "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -716,6 +723,102 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -809,6 +912,101 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -3290,6 +3488,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "includeSystemWorkers", + "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -3974,51 +4179,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { - "post": { - "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", - "operationId": "WaitForExternalWorkflow2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "execution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", @@ -4515,15 +4675,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById4", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -4536,21 +4697,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4560,7 +4721,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -4569,15 +4730,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", - "operationId": "PauseWorkflowExecution2", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -4590,14 +4752,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow to pause.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4607,7 +4776,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -4616,16 +4785,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", - "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", - "operationId": "SignalWithStartWorkflowExecution2", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -4638,19 +4806,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "activityId", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -4660,7 +4830,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -4669,9 +4839,218 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to pause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "post": { + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", + "operationId": "SignalWithStartWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", "operationId": "UnpauseWorkflowExecution2", "responses": { "200": { @@ -5058,6 +5437,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "weakConsistency", + "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -5799,7 +6185,194 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity we're heartbeating", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "post": { + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -5819,7 +6392,7 @@ }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -5829,7 +6402,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -5838,15 +6411,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", + "/namespaces/{namespace}/activities/{activityId}/terminate": { + "post": { + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -5870,11 +6444,12 @@ "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } } ], "tags": [ @@ -5882,15 +6457,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/activities/{activityId}/unpause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -5903,14 +6479,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5920,7 +6496,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -5929,16 +6505,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { + "/namespaces/{namespace}/activities/{activityId}/update-options": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -5951,12 +6526,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5966,7 +6543,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -8386,6 +8963,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "includeSystemWorkers", + "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -9070,15 +9654,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { - "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", - "operationId": "WaitForExternalWorkflow", + "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", + "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", + "operationId": "RequestCancelWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" + "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" } }, "default": { @@ -9096,7 +9681,7 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -9106,7 +9691,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" } } ], @@ -9115,16 +9700,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { "post": { - "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", - "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", - "operationId": "RequestCancelWorkflowExecution", + "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", + "operationId": "ResetWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" + "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" } }, "default": { @@ -9152,7 +9736,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" } } ], @@ -9161,15 +9745,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { "post": { - "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", - "operationId": "ResetWorkflowExecution", + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" } }, "default": { @@ -9192,12 +9777,19 @@ "required": true, "type": "string" }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" } } ], @@ -9206,16 +9798,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution", + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" } }, "default": { @@ -9239,8 +9830,47 @@ "type": "string" }, { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "post": { + "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", + "operationId": "UpdateWorkflowExecutionOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace name of the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -9250,7 +9880,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" } } ], @@ -9259,15 +9889,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "summary": "Invokes the specified Update function on user Workflow code.", + "operationId": "UpdateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" } }, "default": { @@ -9280,6 +9910,7 @@ "parameters": [ { "name": "namespace", + "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" @@ -9290,12 +9921,119 @@ "required": true, "type": "string" }, + { + "name": "request.input.name", + "description": "The name of the Update handler to invoke on the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}": { + "post": { + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "post": { + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to complete", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -9304,15 +10042,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -9325,13 +10063,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", "in": "path", "required": true, "type": "string" @@ -9341,7 +10087,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -9350,15 +10096,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -9371,20 +10117,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "request.input.name", - "description": "The name of the Update handler to invoke on the target Workflow.", + "name": "activityId", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -9394,7 +10141,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -9403,16 +10150,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -9425,12 +10172,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9440,7 +10196,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -9449,15 +10205,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById3", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -9470,21 +10227,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to complete", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9494,7 +10251,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -9503,15 +10260,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById3", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -9538,7 +10295,7 @@ }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -9548,7 +10305,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -9557,15 +10314,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById3", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -9578,21 +10336,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9602,7 +10360,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -9611,15 +10369,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById3", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -9639,14 +10397,14 @@ }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9656,7 +10414,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -10492,6 +11250,36 @@ "reason": { "type": "string", "description": "Reason to pause the activity." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe pause requests." + } + }, + "description": "Deprecated. Use `PauseActivityExecutionRequest`." + }, + "WorkflowServicePauseActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe pause requests." } } }, @@ -10729,10 +11517,43 @@ }, "restoreOriginalOptions": { "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." + }, + "WorkflowServiceResetActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." + }, + "keepPaused": { + "type": "boolean", + "title": "If activity is paused, it will remain paused after reset" + }, + "jitter": { + "type": "string", + "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" + }, + "restoreOriginalOptions": { + "type": "boolean", + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -11691,6 +12512,40 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } + }, + "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." + }, + "WorkflowServiceUnpauseActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetAttempts": { + "type": "boolean", + "description": "Providing this flag will also reset the number of attempts." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Providing this flag will also reset the heartbeat details." + }, + "reason": { + "type": "string", + "description": "Reason to unpause the activity." + }, + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } } }, "WorkflowServiceUnpauseWorkflowExecutionBody": { @@ -11714,6 +12569,35 @@ } } }, + "WorkflowServiceUpdateActivityExecutionOptionsBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "title": "The identity of the client who initiated this request" + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options. Partial updates are accepted and controlled by update_mask" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `activity_options` will be applied" + }, + "restoreOriginal": { + "type": "boolean", + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } + }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -11747,10 +12631,10 @@ }, "restoreOriginal": { "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions\nDeprecated. Use `UpdateActivityExecutionOptionsRequest`." }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", @@ -12036,25 +12920,6 @@ }, "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." }, - "WorkflowServiceWaitForExternalWorkflowBody": { - "type": "object", - "properties": { - "execution": { - "type": "object", - "properties": { - "runId": { - "type": "string" - } - }, - "description": "The workflow execution to wait for.", - "title": "The workflow execution to wait for." - }, - "requestId": { - "type": "string", - "description": "Used to de-dupe requests. Typically should be UUID." - } - } - }, "apiActivityV1CallbackInfo": { "type": "object", "properties": { @@ -15585,6 +16450,14 @@ "pollerAutoscaling": { "type": "boolean", "title": "True if the namespace supports poller autoscaling" + }, + "workerCommands": { + "type": "boolean", + "description": "True if the namespace supports worker commands (server-to-worker communication via control queues)." + }, + "standaloneNexusOperation": { + "type": "boolean", + "description": "True if the namespace supports standalone Nexus operations." } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." @@ -16293,9 +17166,13 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityResponse": { + "v1PauseActivityExecutionResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `PauseActivityExecutionResponse`." + }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." @@ -17128,9 +18005,13 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityResponse": { + "v1ResetActivityExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object", + "description": "Deprecated. Use `ResetActivityExecutionRequest`." + }, "v1ResetOptions": { "type": "object", "properties": { @@ -18074,6 +18955,14 @@ "priority": { "$ref": "#/definitions/v1Priority", "title": "Priority metadata" + }, + "timeSkippingConfig": { + "$ref": "#/definitions/v1TimeSkippingConfig", + "description": "The propagated time-skipping configuration for the child workflow." + }, + "initialSkippedDuration": { + "type": "string", + "description": "Propagate the duration skipped to the child workflow." } } }, @@ -18462,11 +19351,7 @@ "properties": { "enabled": { "type": "boolean", - "description": "Enables or disables time skipping for this workflow execution.\nBy default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \nat the time they are started.\nChanges made after a transitively related workflow has started are not propagated." - }, - "disablePropagation": { - "type": "boolean", - "description": "If set, the enabled field is not propagated to transitively related workflows." + "description": "Enables or disables time skipping for this workflow execution." }, "maxSkippedDuration": { "type": "string", @@ -18475,14 +19360,9 @@ "maxElapsedDuration": { "type": "string", "description": "Maximum elapsed time since time skipping was enabled.\nThis includes both skipped time and real time elapsing." - }, - "maxTargetTime": { - "type": "string", - "format": "date-time", - "description": "Absolute virtual timestamp at which time skipping is disabled.\nTime skipping will not advance beyond this point." } }, - "description": "Configuration for time skipping during a workflow execution.\nWhen enabled, virtual time advances automatically whenever there is no in-flight work.\nIn-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\nand possibly other features added in the future.\nUser timers are not classified as in-flight work and will be skipped over.\nWhen time advances, it skips to the earlier of the next user timer or the configured bound, if either exists." + "description": "Configuration for time skipping during a workflow execution.\nWhen enabled, virtual time advances automatically whenever there is no in-flight work.\nIn-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\nand possibly other features added in the future.\nUser timers are not classified as in-flight work and will be skipped over.\nWhen time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.\n\nPropagation behavior of time skipping:\nThe enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n(1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n(2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n(3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." }, "v1TimeoutFailureInfo": { "type": "object", @@ -18608,14 +19488,18 @@ } } }, - "v1UnpauseActivityResponse": { + "v1UnpauseActivityExecutionResponse": { "type": "object" }, + "v1UnpauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." + }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, - "v1UpdateActivityOptionsResponse": { + "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { "activityOptions": { @@ -18624,6 +19508,16 @@ } } }, + "v1UpdateActivityOptionsResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options after an update" + } + }, + "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ @@ -18919,9 +19813,6 @@ }, "description": "Used to override the versioning behavior (and pinned deployment version, if applicable) of a\nspecific workflow execution. If set, this override takes precedence over worker-sent values.\nSee `WorkflowExecutionInfo.VersioningInfo` for more information.\n\nTo remove the override, call `UpdateWorkflowExecutionOptions` with a null\n`VersioningOverride`, and use the `update_mask` to indicate that it should be mutated.\n\nPinned behavior overrides are automatically inherited by child workflows, workflow retries, continue-as-new\nworkflows, and cron workflows." }, - "v1WaitForExternalWorkflowResponse": { - "type": "object" - }, "v1WaitPolicy": { "type": "object", "properties": { @@ -19769,7 +20660,7 @@ }, "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", - "description": "Time-skipping configuration for this workflow execution.\nIf not set, the time-skipping conf will not get updated upon request, \ni.e. the existing time-skipping conf will be preserved." + "description": "Time-skipping configuration for this workflow execution.\nIf not set, the time-skipping configuration is not updated by this request;\nthe existing configuration is preserved." } } }, @@ -20039,6 +20930,10 @@ "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", "description": "Initial time-skipping configuration for this workflow execution, recorded at start time.\nThis may have been set explicitly via the start workflow request, or propagated from a\nparent/previous execution.\n\nThe configuration may be updated after start via UpdateWorkflowExecutionOptions, which\nwill be reflected in the WorkflowExecutionOptionsUpdatedEvent." + }, + "initialSkippedDuration": { + "type": "string", + "description": "The time skipped by the previous execution that started this workflow.\nIt can happen in cases of child workflows and continue-as-new workflows." } }, "title": "Always the first event in workflow history" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index a52c301c6..14a6a130c 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -109,6 +109,15 @@ paths: in: query schema: type: string + - name: weakConsistency + in: query + description: |- + If true, the server may serve the response from an eventually-consistent + source instead of reading through to persistence. Defaults to false, + which preserves read-after-write consistency. SDKs should set this when + fetching namespace capabilities on worker/client startup. + schema: + type: boolean responses: "200": description: OK @@ -661,6 +670,107 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -744,6 +854,92 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -2965,6 +3161,13 @@ paths: * Status schema: type: string + - name: includeSystemWorkers + in: query + description: |- + When true, the response will include system workers that are created implicitly + by the server and not by the user. By default, system workers are excluded. + schema: + type: boolean responses: "200": description: OK @@ -3551,48 +3754,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: - post: - tags: - - WorkflowService - description: |- - WaitForExternalWorkflow asynchronously waits for an external workflow to complete - - (-- api-linter: core::0127::http-annotation=disabled - aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) - operationId: WaitForExternalWorkflow - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: execution.workflow_id - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WaitForExternalWorkflowRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/WaitForExternalWorkflowResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}: post: tags: @@ -3781,33 +3942,45 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: The ID of the activity to target. required: true schema: type: string @@ -3815,7 +3988,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -3823,37 +3996,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - Note: This is an experimental API and the behavior may change in a future release. - PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in - - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history - - No new workflow tasks or activity tasks are dispatched. - - Any workflow task currently executing on the worker will be allowed to complete. - - Any activity task currently executing will be paused. - - All server-side events will continue to be processed by the server. - - Queries & Updates on a paused workflow will be rejected. - operationId: PauseWorkflowExecution + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow to pause. + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: ID of the workflow execution to be paused. Required. + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. required: true schema: type: string @@ -3861,7 +4044,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -3869,20 +4052,217 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if - it isn't yet started. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to confirm is cancelled + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to pause. + required: true + schema: + type: string + - name: workflowId + in: path + description: ID of the workflow execution to be paused. Required. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: + post: + tags: + - WorkflowService + description: |- + SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if + it isn't yet started. If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history and a workflow task is generated. @@ -4508,6 +4888,15 @@ paths: in: query schema: type: string + - name: weakConsistency + in: query + description: |- + If true, the server may serve the response from an eventually-consistent + source instead of reading through to persistence. Defaults to false, + which preserves read-after-write consistency. SDKs should set this when + fetching namespace capabilities on worker/client startup. + schema: + type: boolean responses: "200": description: OK @@ -5284,6 +5673,107 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -5367,6 +5857,92 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activity-complete: post: tags: @@ -7530,6 +8106,13 @@ paths: * Status schema: type: string + - name: includeSystemWorkers + in: query + description: |- + When true, the response will include system workers that are created implicitly + by the server and not by the user. By default, system workers are excluded. + schema: + type: boolean responses: "200": description: OK @@ -8116,26 +8699,172 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + /namespaces/{namespace}/workflows/{workflowId}: post: tags: - WorkflowService description: |- - WaitForExternalWorkflow asynchronously waits for an external workflow to complete + StartWorkflowExecution starts a new workflow execution. + + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + post: + tags: + - WorkflowService + description: |- + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCompletedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to complete + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskFailed`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - (-- api-linter: core::0127::http-annotation=disabled - aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) - operationId: WaitForExternalWorkflow + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskFailedById parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to fail + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - - name: execution.workflow_id + - name: activityId in: path + description: Id of the activity we're heartbeating required: true schema: type: string @@ -8143,7 +8872,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -8151,32 +8880,52 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - StartWorkflowExecution starts a new workflow execution. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. required: true schema: type: string @@ -8184,7 +8933,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -8192,40 +8941,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCompletedById + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to complete + description: The ID of the activity to target. required: true schema: type: string @@ -8233,7 +8989,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -8241,24 +8997,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by + See `RespondActivityTaskCanceled`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -8274,7 +9030,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity to fail + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -8282,7 +9038,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -8290,40 +9046,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity we're heartbeating + description: The ID of the activity to target. required: true schema: type: string @@ -8331,7 +9092,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' required: true responses: "200": @@ -8339,24 +9100,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions parameters: - name: namespace in: path @@ -8366,13 +9124,15 @@ paths: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: The ID of the activity to target. required: true schema: type: string @@ -8380,7 +9140,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' required: true responses: "200": @@ -8388,7 +9148,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' default: description: Default error response content: @@ -12161,6 +12921,12 @@ components: pollerAutoscaling: type: boolean description: True if the namespace supports poller autoscaling + workerCommands: + type: boolean + description: True if the namespace supports worker commands (server-to-worker communication via control queues). + standaloneNexusOperation: + type: boolean + description: True if the namespace supports standalone Nexus operations. description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object @@ -12813,6 +13579,38 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + reason: + type: string + description: Reason to pause the activity. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + requestId: + type: string + description: Used to de-dupe pause requests. + PauseActivityExecutionResponse: + type: object + properties: {} PauseActivityRequest: type: object properties: @@ -12837,9 +13635,14 @@ components: reason: type: string description: Reason to pause the activity. + requestId: + type: string + description: Used to de-dupe pause requests. + description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} + description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -13969,6 +14772,52 @@ components: Indicate if the request is still buffered. If so, the event ID is not known and its value will be an invalid event ID. description: RequestIdInfo contains details of a request ID. + ResetActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetHeartbeat: + type: boolean + description: |- + Indicates that activity should reset heartbeat details. + This flag will be applied only to the new instance of the activity. + keepPaused: + type: boolean + description: If activity is paused, it will remain paused after reset + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + (unless it is paused and keep_paused is set) + restoreOriginalOptions: + type: boolean + description: |- + If set, the activity options will be restored to the defaults. + Default options are then options activity was created with. + They are part of the first schedule event. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + ResetActivityExecutionResponse: + type: object + properties: {} ResetActivityRequest: type: object properties: @@ -14010,11 +14859,14 @@ components: description: |- If set, the activity options will be restored to the defaults. Default options are then options activity was created with. - They are part of the first SCHEDULE event. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' + They are part of the first schedule event. + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities + Deprecated. Use `ResetActivityExecutionRequest`. ResetActivityResponse: type: object properties: {} + description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -15641,6 +16493,14 @@ components: allOf: - $ref: '#/components/schemas/Priority' description: Priority metadata + timeSkippingConfig: + allOf: + - $ref: '#/components/schemas/TimeSkippingConfig' + description: The propagated time-skipping configuration for the child workflow. + initialSkippedDuration: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Propagate the duration skipped to the child workflow. StartNexusOperationExecutionRequest: type: object properties: @@ -16327,10 +17187,7 @@ components: properties: enabled: type: boolean - description: "Enables or disables time skipping for this workflow execution.\n By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) \n at the time they are started.\n Changes made after a transitively related workflow has started are not propagated." - disablePropagation: - type: boolean - description: If set, the enabled field is not propagated to transitively related workflows. + description: Enables or disables time skipping for this workflow execution. maxSkippedDuration: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string @@ -16341,19 +17198,7 @@ components: description: |- Maximum elapsed time since time skipping was enabled. This includes both skipped time and real time elapsing. - maxTargetTime: - type: string - description: |- - Absolute virtual timestamp at which time skipping is disabled. - Time skipping will not advance beyond this point. - format: date-time - description: |- - Configuration for time skipping during a workflow execution. - When enabled, virtual time advances automatically whenever there is no in-flight work. - In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, - and possibly other features added in the future. - User timers are not classified as in-flight work and will be skipped over. - When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists. + description: "Configuration for time skipping during a workflow execution.\n When enabled, virtual time advances automatically whenever there is no in-flight work.\n In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations,\n and possibly other features added in the future.\n User timers are not classified as in-flight work and will be skipped over.\n When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists.\n \n Propagation behavior of time skipping:\n The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows:\n (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are\n inherited from the current execution. The configured bound is shared between the inherited skipped\n duration and any additional duration skipped by the new run.\n (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the\n current workflow started; the accumulated skipped duration of the current run is not propagated.\n (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays\n all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that\n point, the resulting run ends up with the same final time-skipping configuration as the previous run." TimeoutFailureInfo: type: object properties: @@ -16470,6 +17315,45 @@ components: applied: type: boolean description: True is the rule was applied, based on the rule conditions (predicate/visibility_query). + UnpauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetAttempts: + type: boolean + description: Providing this flag will also reset the number of attempts. + resetHeartbeat: + type: boolean + description: Providing this flag will also reset the heartbeat details. + reason: + type: string + description: Reason to unpause the activity. + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: If set, the activity will start at a random time within the specified jitter duration. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UnpauseActivityExecutionResponse: + type: object + properties: {} UnpauseActivityRequest: type: object properties: @@ -16502,9 +17386,11 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. + description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} + description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -16530,6 +17416,52 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UpdateActivityExecutionOptionsRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options. Partial updates are accepted and controlled by update_mask + updateMask: + type: string + description: Controls which fields from `activity_options` will be applied + format: field-mask + restoreOriginal: + type: boolean + description: |- + If set, the activity options will be restored to the default. + Default options are then options activity was created with. + They are part of the first schedule event. + This flag cannot be combined with any other option; if you supply + restore_original together with other options, the request will be rejected. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UpdateActivityExecutionOptionsResponse: + type: object + properties: + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: @@ -16565,10 +17497,12 @@ components: description: |- If set, the activity options will be restored to the default. Default options are then options activity was created with. - They are part of the first SCHEDULE event. + They are part of the first schedule event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions + Deprecated. Use `UpdateActivityExecutionOptionsRequest`. UpdateActivityOptionsResponse: type: object properties: @@ -16576,6 +17510,7 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update + description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: @@ -17170,21 +18105,6 @@ components: If omitted and the target workflow is not pinned, the override request will be rejected with a PreconditionFailed error. - WaitForExternalWorkflowRequest: - type: object - properties: - namespace: - type: string - execution: - allOf: - - $ref: '#/components/schemas/WorkflowExecution' - description: The workflow execution to wait for. - requestId: - type: string - description: Used to de-dupe requests. Typically should be UUID. - WaitForExternalWorkflowResponse: - type: object - properties: {} WaitPolicy: type: object properties: @@ -18318,7 +19238,10 @@ components: timeSkippingConfig: allOf: - $ref: '#/components/schemas/TimeSkippingConfig' - description: "Time-skipping configuration for this workflow execution.\n If not set, the time-skipping conf will not get updated upon request, \n i.e. the existing time-skipping conf will be preserved." + description: |- + Time-skipping configuration for this workflow execution. + If not set, the time-skipping configuration is not updated by this request; + the existing configuration is preserved. WorkflowExecutionOptionsUpdatedEventAttributes: type: object properties: @@ -18662,6 +19585,12 @@ components: The configuration may be updated after start via UpdateWorkflowExecutionOptions, which will be reflected in the WorkflowExecutionOptionsUpdatedEvent. + initialSkippedDuration: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + The time skipped by the previous execution that started this workflow. + It can happen in cases of child workflows and continue-as-new workflows. description: Always the first event in workflow history WorkflowExecutionTerminatedEventAttributes: type: object diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index e873412bf..e57ec8d60 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -204,6 +204,10 @@ message WorkflowExecutionStartedEventAttributes { // The configuration may be updated after start via UpdateWorkflowExecutionOptions, which // will be reflected in the WorkflowExecutionOptionsUpdatedEvent. temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 41; + + // The time skipped by the previous execution that started this workflow. + // It can happen in cases of child workflows and continue-as-new workflows. + google.protobuf.Duration initial_skipped_duration = 42; } // Wrapper for a target deployment version that the SDK declined to upgrade to. @@ -770,6 +774,12 @@ message StartChildWorkflowExecutionInitiatedEventAttributes { bool inherit_build_id = 19 [deprecated = true]; // Priority metadata temporal.api.common.v1.Priority priority = 20; + + // The propagated time-skipping configuration for the child workflow. + temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 21; + + // Propagate the duration skipped to the child workflow. + google.protobuf.Duration initial_skipped_duration = 30; } message StartChildWorkflowExecutionFailedEventAttributes { diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index cded0e372..56d0193a5 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -50,6 +50,10 @@ message NamespaceInfo { bool worker_poll_complete_on_shutdown = 8; // True if the namespace supports poller autoscaling bool poller_autoscaling = 9; + // True if the namespace supports worker commands (server-to-worker communication via control queues). + bool worker_commands = 10; + // True if the namespace supports standalone Nexus operations. + bool standalone_nexus_operation = 11; } // Namespace configured limits diff --git a/temporal/api/sdk/v1/external_storage.proto b/temporal/api/sdk/v1/external_storage.proto new file mode 100644 index 000000000..5a08f9995 --- /dev/null +++ b/temporal/api/sdk/v1/external_storage.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package temporal.api.sdk.v1; + +option go_package = "go.temporal.io/api/sdk/v1;sdk"; +option java_package = "io.temporal.api.sdk.v1"; +option java_multiple_files = true; +option java_outer_classname = "ExternalStorageProto"; +option ruby_package = "Temporalio::Api::Sdk::V1"; +option csharp_namespace = "Temporalio.Api.Sdk.V1"; + +// ExternalStorageReference identifies a payload stored in an external storage system. +// It is used as a claim-check token, allowing the actual payload data to be retrieved +// from the named driver using the provided claim data. +message ExternalStorageReference { + // The name of the storage driver responsible for retrieving the payload. + string driver_name = 1; + // Driver-specific key-value pairs that identify and provide access to the stored payload. + map claim_data = 2; +} diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index c21d84953..51b39b76a 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -580,8 +580,8 @@ message WorkflowExecutionOptions { temporal.api.common.v1.Priority priority = 2; // Time-skipping configuration for this workflow execution. - // If not set, the time-skipping conf will not get updated upon request, - // i.e. the existing time-skipping conf will be preserved. + // If not set, the time-skipping configuration is not updated by this request; + // the existing configuration is preserved. TimeSkippingConfig time_skipping_config = 3; } @@ -591,31 +591,32 @@ message WorkflowExecutionOptions { // and possibly other features added in the future. // User timers are not classified as in-flight work and will be skipped over. // When time advances, it skips to the earlier of the next user timer or the configured bound, if either exists. +// +// Propagation behavior of time skipping: +// The enabled flag, bound fields, and accumulated skipped duration are propagated to related executions as follows: +// (1) Child workflows and continue-as-new: both the configuration and the accumulated skipped duration are +// inherited from the current execution. The configured bound is shared between the inherited skipped +// duration and any additional duration skipped by the new run. +// (2) Retry and cron: the configuration and accumulated skipped duration are inherited as recorded when the +// current workflow started; the accumulated skipped duration of the current run is not propagated. +// (3) Reset: the new run retains the time-skipping configuration of the current execution. Because reset replays +// all events up to the reset point and re-applies any UpdateWorkflowExecutionOptions changes made after that +// point, the resulting run ends up with the same final time-skipping configuration as the previous run. message TimeSkippingConfig { + reserved 2, 6; + reserved "disable_propagation", "max_target_time"; // Enables or disables time skipping for this workflow execution. - // By default, this field is propagated to transitively related workflows (child workflows/start-as-new/reset) - // at the time they are started. - // Changes made after a transitively related workflow has started are not propagated. bool enabled = 1; - // If set, the enabled field is not propagated to transitively related workflows. - bool disable_propagation = 2; - - // Optional bound that limits how long time skipping remains active. - // Once the bound is reached, time skipping is automatically disabled. - // It can later be re-enabled via UpdateWorkflowExecutionOptions. - // - // This is particularly useful in testing scenarios where workflows - // are expected to receive signals, updates, or other events while - // timers are in progress. + // Optional bound that limits the gap between the virtual time of this execution and wall-clock time. + // Once the bound is reached, time skipping is automatically disabled, + // but can be re-enabled by setting `enabled` to true via UpdateWorkflowExecutionOptions. + // This bound cannot be set to a value smaller than the execution's currently skipped duration. // - // This bound is not propagated to transitively related workflows. - // When bound is also needed for transitively related workflows, - // it is recommended to set disable_propagation to true - // and configure TimeSkippingConfig explicitly for transitively related workflows. + // This is useful in testing scenarios where a workflow is expected to receive + // signals, updates, or other external events while timers are in progress. oneof bound { - // Maximum total virtual time that can be skipped. google.protobuf.Duration max_skipped_duration = 4; @@ -623,10 +624,6 @@ message TimeSkippingConfig { // This includes both skipped time and real time elapsing. // (-- api-linter: core::0142::time-field-names=disabled --) google.protobuf.Duration max_elapsed_duration = 5; - - // Absolute virtual timestamp at which time skipping is disabled. - // Time skipping will not advance beyond this point. - google.protobuf.Timestamp max_target_time = 6; } } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index c09021d0e..97e17786b 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3403,7 +3403,7 @@ message WaitForExternalWorkflowResponse { repeated temporal.api.common.v1.Link links = 2; - oneof status { + oneof completion_status { temporal.api.common.v1.Payload result = 3; temporal.api.failure.v1.Failure failure = 4; } From 768ee17fde67ee43500a8098c2c137c4dc6aba9d Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 15 May 2026 15:45:57 -0600 Subject: [PATCH 3/4] generate proto --- .../temporal-json-schema-models-nexusrpc.yaml | 491 ------ nexus/temporal-proto-models-nexusrpc.yaml | 15 + openapi/openapiv2.json | 1316 +++-------------- openapi/openapiv3.yaml | 1231 ++------------- .../workflowservice/v1/request_response.proto | 12 +- 5 files changed, 402 insertions(+), 2663 deletions(-) delete mode 100644 nexus/temporal-json-schema-models-nexusrpc.yaml diff --git a/nexus/temporal-json-schema-models-nexusrpc.yaml b/nexus/temporal-json-schema-models-nexusrpc.yaml deleted file mode 100644 index 6ab424d04..000000000 --- a/nexus/temporal-json-schema-models-nexusrpc.yaml +++ /dev/null @@ -1,491 +0,0 @@ -nexusrpc: 1.0.0 -types: - Deployment: - type: object - properties: - seriesName: - type: string - buildId: - type: string - Header: - type: object - properties: - fields: - type: object - additionalProperties: - $ref: '#/types/Payload' - Link: - type: object - properties: - workflowEvent: - $ref: '#/types/Link_WorkflowEvent' - batchJob: - $ref: '#/types/Link_BatchJob' - activity: - $ref: '#/types/Link_Activity' - nexusOperation: - $ref: '#/types/Link_NexusOperation' - Link_Activity: - type: object - properties: - namespace: - type: string - activityId: - type: string - runId: - type: string - Link_BatchJob: - type: object - properties: - jobId: - type: string - Link_NexusOperation: - type: object - properties: - namespace: - type: string - operationId: - type: string - runId: - type: string - Link_WorkflowEvent: - type: object - properties: - namespace: - type: string - workflowId: - type: string - runId: - type: string - eventRef: - $ref: '#/types/WorkflowEvent_EventReference' - requestIdRef: - $ref: '#/types/WorkflowEvent_RequestIdReference' - Memo: - type: object - properties: - fields: - type: object - additionalProperties: - $ref: '#/types/Payload' - Payload: - type: object - properties: - metadata: - type: object - additionalProperties: - type: string - format: byte - data: - type: string - format: byte - externalPayloads: - type: array - items: - $ref: '#/types/Payload_ExternalPayloadDetails' - Payload_ExternalPayloadDetails: - type: object - properties: - sizeBytes: - type: string - Payloads: - type: object - properties: - payloads: - type: array - items: - $ref: '#/types/Payload' - Priority: - type: object - properties: - priorityKey: - type: integer - format: int32 - fairnessKey: - type: string - fairnessWeight: - type: number - format: float - RetryPolicy: - type: object - properties: - initialInterval: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - backoffCoefficient: - type: number - format: double - maximumInterval: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - maximumAttempts: - type: integer - format: int32 - nonRetryableErrorTypes: - type: array - items: - type: string - SearchAttributes: - type: object - properties: - indexedFields: - type: object - additionalProperties: - $ref: '#/types/Payload' - SignalWithStartWorkflowExecutionRequest: - $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.SignalWithStartWorkflowExecutionRequest - $goProtoRef: go.temporal.io/api/workflowservice/v1.SignalWithStartWorkflowExecutionRequest - $javaProtoRef: io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest - $pythonProtoRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionRequest - $rubyProtoRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionRequest - $typescriptProtoRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionRequest' - type: object - properties: - namespace: - type: string - workflowId: - type: string - workflowType: - $ref: '#/types/WorkflowType' - taskQueue: - $ref: '#/types/TaskQueue' - input: - $ref: '#/types/Payloads' - workflowExecutionTimeout: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - workflowRunTimeout: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - workflowTaskTimeout: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - identity: - type: string - requestId: - type: string - workflowIdReusePolicy: - enum: - - WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED - - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE - - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY - - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE - - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING - type: string - format: enum - workflowIdConflictPolicy: - enum: - - WORKFLOW_ID_CONFLICT_POLICY_UNSPECIFIED - - WORKFLOW_ID_CONFLICT_POLICY_FAIL - - WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING - - WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING - type: string - format: enum - signalName: - type: string - signalInput: - $ref: '#/types/Payloads' - control: - type: string - retryPolicy: - $ref: '#/types/RetryPolicy' - cronSchedule: - type: string - memo: - $ref: '#/types/Memo' - searchAttributes: - $ref: '#/types/SearchAttributes' - header: - $ref: '#/types/Header' - workflowStartDelay: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - userMetadata: - $ref: '#/types/UserMetadata' - links: - type: array - items: - $ref: '#/types/Link' - versioningOverride: - $ref: '#/types/VersioningOverride' - priority: - $ref: '#/types/Priority' - timeSkippingConfig: - $ref: '#/types/TimeSkippingConfig' - SignalWithStartWorkflowExecutionResponse: - $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.SignalWithStartWorkflowExecutionResponse - $goProtoRef: go.temporal.io/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse - $javaProtoRef: io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse - $pythonProtoRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse - $rubyProtoRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse - $typescriptProtoRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' - type: object - properties: - runId: - type: string - started: - type: boolean - signalLink: - $ref: '#/types/Link' - TaskQueue: - type: object - properties: - name: - type: string - kind: - enum: - - TASK_QUEUE_KIND_UNSPECIFIED - - TASK_QUEUE_KIND_NORMAL - - TASK_QUEUE_KIND_STICKY - - TASK_QUEUE_KIND_WORKER_COMMANDS - type: string - format: enum - normalName: - type: string - TimeSkippingConfig: - type: object - properties: - enabled: - type: boolean - disablePropagation: - type: boolean - maxSkippedDuration: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - maxElapsedDuration: - type: string - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - maxTargetTime: - type: string - format: date-time - UserMetadata: - type: object - properties: - summary: - $ref: '#/types/Payload' - details: - $ref: '#/types/Payload' - VersioningOverride: - type: object - properties: - pinned: - $ref: '#/types/VersioningOverride_PinnedOverride' - autoUpgrade: - type: boolean - behavior: - enum: - - VERSIONING_BEHAVIOR_UNSPECIFIED - - VERSIONING_BEHAVIOR_PINNED - - VERSIONING_BEHAVIOR_AUTO_UPGRADE - type: string - format: enum - deployment: - $ref: '#/types/Deployment' - pinnedVersion: - type: string - VersioningOverride_PinnedOverride: - type: object - properties: - behavior: - enum: - - PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED - - PINNED_OVERRIDE_BEHAVIOR_PINNED - type: string - format: enum - version: - $ref: '#/types/WorkerDeploymentVersion' - WaitForExternalWorkflowRequest: - $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest - $goProtoRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest - $javaProtoRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest - $pythonProtoRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest - $rubyProtoRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest - $typescriptProtoRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' - type: object - properties: - namespace: - type: string - execution: - $ref: '#/types/WorkflowExecution' - requestId: - type: string - WaitForExternalWorkflowResponse: - $dotnetProtoRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse - $goProtoRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse - $javaProtoRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse - $pythonProtoRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse - $rubyProtoRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse - $typescriptProtoRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' - type: object - WorkerDeploymentVersion: - type: object - properties: - buildId: - type: string - deploymentName: - type: string - WorkflowEvent_EventReference: - type: object - properties: - eventId: - type: string - eventType: - enum: - - EVENT_TYPE_UNSPECIFIED - - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED - - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED - - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT - - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED - - EVENT_TYPE_WORKFLOW_TASK_STARTED - - EVENT_TYPE_WORKFLOW_TASK_COMPLETED - - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT - - EVENT_TYPE_WORKFLOW_TASK_FAILED - - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED - - EVENT_TYPE_ACTIVITY_TASK_STARTED - - EVENT_TYPE_ACTIVITY_TASK_COMPLETED - - EVENT_TYPE_ACTIVITY_TASK_FAILED - - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT - - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED - - EVENT_TYPE_ACTIVITY_TASK_CANCELED - - EVENT_TYPE_TIMER_STARTED - - EVENT_TYPE_TIMER_FIRED - - EVENT_TYPE_TIMER_CANCELED - - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED - - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED - - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED - - EVENT_TYPE_MARKER_RECORDED - - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED - - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED - - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW - - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED - - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED - - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED - - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY - - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY - - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED - - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED - - EVENT_TYPE_NEXUS_OPERATION_STARTED - - EVENT_TYPE_NEXUS_OPERATION_COMPLETED - - EVENT_TYPE_NEXUS_OPERATION_FAILED - - EVENT_TYPE_NEXUS_OPERATION_CANCELED - - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED - - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED - - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED - type: string - format: enum - WorkflowEvent_RequestIdReference: - type: object - properties: - requestId: - type: string - eventType: - enum: - - EVENT_TYPE_UNSPECIFIED - - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED - - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED - - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT - - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED - - EVENT_TYPE_WORKFLOW_TASK_STARTED - - EVENT_TYPE_WORKFLOW_TASK_COMPLETED - - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT - - EVENT_TYPE_WORKFLOW_TASK_FAILED - - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED - - EVENT_TYPE_ACTIVITY_TASK_STARTED - - EVENT_TYPE_ACTIVITY_TASK_COMPLETED - - EVENT_TYPE_ACTIVITY_TASK_FAILED - - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT - - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED - - EVENT_TYPE_ACTIVITY_TASK_CANCELED - - EVENT_TYPE_TIMER_STARTED - - EVENT_TYPE_TIMER_FIRED - - EVENT_TYPE_TIMER_CANCELED - - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED - - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED - - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED - - EVENT_TYPE_MARKER_RECORDED - - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED - - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED - - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW - - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT - - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED - - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED - - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED - - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED - - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED - - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED - - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY - - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY - - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED - - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED - - EVENT_TYPE_NEXUS_OPERATION_STARTED - - EVENT_TYPE_NEXUS_OPERATION_COMPLETED - - EVENT_TYPE_NEXUS_OPERATION_FAILED - - EVENT_TYPE_NEXUS_OPERATION_CANCELED - - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED - - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED - - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED - - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED - type: string - format: enum - WorkflowExecution: - type: object - properties: - workflowId: - type: string - runId: - type: string - WorkflowType: - type: object - properties: - name: - type: string -services: - WorkflowService: - operations: - SignalWithStartWorkflowExecution: - input: - $ref: '#/types/SignalWithStartWorkflowExecutionRequest' - output: - $ref: '#/types/SignalWithStartWorkflowExecutionResponse' - WaitForExternalWorkflow: - input: - $ref: '#/types/WaitForExternalWorkflowRequest' - output: - $ref: '#/types/WaitForExternalWorkflowResponse' diff --git a/nexus/temporal-proto-models-nexusrpc.yaml b/nexus/temporal-proto-models-nexusrpc.yaml index e0761fd15..a9f010b20 100644 --- a/nexus/temporal-proto-models-nexusrpc.yaml +++ b/nexus/temporal-proto-models-nexusrpc.yaml @@ -17,3 +17,18 @@ services: $pythonRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse $rubyRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse $typescriptRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' + WaitForExternalWorkflow: + input: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' + output: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 12d163654..7d1d302a7 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -150,13 +150,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "weakConsistency", - "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -723,102 +716,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { - "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { - "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -912,101 +809,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { - "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { - "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -3488,13 +3290,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "includeSystemWorkers", - "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -4179,6 +3974,51 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { + "post": { + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", @@ -4675,16 +4515,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution4", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -4697,21 +4536,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -4721,7 +4560,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -4730,16 +4569,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution4", + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" } }, "default": { @@ -4752,21 +4590,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow to pause.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", + "description": "ID of the workflow execution to be paused. Required.", "in": "path", "required": true, "type": "string" @@ -4776,7 +4607,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" } } ], @@ -4785,15 +4616,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById4", + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", + "operationId": "SignalWithStartWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" } }, "default": { @@ -4806,21 +4638,19 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -4830,7 +4660,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" } } ], @@ -4839,216 +4669,7 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { - "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution4", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { - "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions4", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { - "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", - "operationId": "PauseWorkflowExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow to pause.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { - "post": { - "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", - "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", - "operationId": "SignalWithStartWorkflowExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { "post": { "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", "operationId": "UnpauseWorkflowExecution2", @@ -5437,13 +5058,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "weakConsistency", - "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -6179,200 +5793,13 @@ }, "/namespaces/{namespace}/activities/{activityId}/heartbeat": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Id of the activity we're heartbeating", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/pause": { - "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/reset": { - "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { - "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -6392,7 +5819,7 @@ }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -6402,7 +5829,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -6411,16 +5838,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { - "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1PollActivityExecutionResponse" } }, "default": { @@ -6444,12 +5870,11 @@ "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" - } + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6457,16 +5882,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/unpause": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -6479,14 +5903,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -6496,7 +5920,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -6505,15 +5929,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/activities/{activityId}/terminate": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions", + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -6526,14 +5951,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6543,7 +5966,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -8963,13 +8386,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "includeSystemWorkers", - "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -9654,107 +9070,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { - "post": { - "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", - "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", - "operationId": "RequestCancelWorkflowExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowExecution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { - "post": { - "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", - "operationId": "ResetWorkflowExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowExecution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { + "/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution", + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" } }, "default": { @@ -9772,14 +9096,7 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" @@ -9789,7 +9106,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" } } ], @@ -9798,15 +9115,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", + "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", + "operationId": "RequestCancelWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" } }, "default": { @@ -9834,7 +9152,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" } } ], @@ -9843,15 +9161,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", + "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance. \"Exclusive\" means the identified completed event itself is not replayed\nin the reset history; the preceding `WORKFLOW_TASK_STARTED` event remains and will be marked as failed\nimmediately, and a new workflow task will be scheduled to retry it.", + "operationId": "ResetWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" } }, "default": { @@ -9864,7 +9182,6 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" @@ -9880,7 +9197,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" } } ], @@ -9889,15 +9206,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" } }, "default": { @@ -9910,7 +9228,6 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" @@ -9922,54 +9239,8 @@ "type": "string" }, { - "name": "request.input.name", - "description": "The name of the Update handler to invoke on the target Workflow.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" - } - } - ], - "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowId}": { - "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -9979,7 +9250,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" } } ], @@ -9988,15 +9259,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById3", + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" } }, "default": { @@ -10006,24 +9277,15 @@ } } }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, + "parameters": [ { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "name": "namespace", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to complete", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -10033,7 +9295,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" } } ], @@ -10042,15 +9304,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById3", + "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", + "operationId": "UpdateWorkflowExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" } }, "default": { @@ -10063,21 +9325,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to fail", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -10087,7 +9341,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" } } ], @@ -10096,15 +9350,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById3", + "summary": "Invokes the specified Update function on user Workflow code.", + "operationId": "UpdateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" } }, "default": { @@ -10117,21 +9371,20 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "The namespace name of the target Workflow.", "in": "path", "required": true, "type": "string" }, { - "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity we're heartbeating", + "name": "request.input.name", + "description": "The name of the Update handler to invoke on the target Workflow.", "in": "path", "required": true, "type": "string" @@ -10141,7 +9394,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" } } ], @@ -10150,16 +9403,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/namespaces/{namespace}/workflows/{workflowId}": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution3", + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -10172,21 +9425,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -10196,7 +9440,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -10205,16 +9449,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution3", + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -10227,21 +9470,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to complete", "in": "path", "required": true, "type": "string" @@ -10251,7 +9494,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -10260,15 +9503,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById3", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -10295,7 +9538,7 @@ }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "Id of the activity to fail", "in": "path", "required": true, "type": "string" @@ -10305,7 +9548,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -10314,16 +9557,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution3", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -10336,21 +9578,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -10360,7 +9602,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -10369,15 +9611,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions3", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -10397,14 +9639,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target.", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -10414,7 +9656,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -11250,36 +10492,6 @@ "reason": { "type": "string", "description": "Reason to pause the activity." - }, - "requestId": { - "type": "string", - "description": "Used to de-dupe pause requests." - } - }, - "description": "Deprecated. Use `PauseActivityExecutionRequest`." - }, - "WorkflowServicePauseActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "reason": { - "type": "string", - "description": "Reason to pause the activity." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - }, - "requestId": { - "type": "string", - "description": "Used to de-dupe pause requests." } } }, @@ -11517,43 +10729,10 @@ }, "restoreOriginalOptions": { "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." } }, - "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." - }, - "WorkflowServiceResetActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "resetHeartbeat": { - "type": "boolean", - "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." - }, - "keepPaused": { - "type": "boolean", - "title": "If activity is paused, it will remain paused after reset" - }, - "jitter": { - "type": "string", - "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" - }, - "restoreOriginalOptions": { - "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } - } + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -12512,40 +11691,6 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } - }, - "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." - }, - "WorkflowServiceUnpauseActivityExecutionBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "description": "The identity of the client who initiated this request." - }, - "resetAttempts": { - "type": "boolean", - "description": "Providing this flag will also reset the number of attempts." - }, - "resetHeartbeat": { - "type": "boolean", - "description": "Providing this flag will also reset the heartbeat details." - }, - "reason": { - "type": "string", - "description": "Reason to unpause the activity." - }, - "jitter": { - "type": "string", - "description": "If set, the activity will start at a random time within the specified jitter duration." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } } }, "WorkflowServiceUnpauseWorkflowExecutionBody": { @@ -12569,35 +11714,6 @@ } } }, - "WorkflowServiceUpdateActivityExecutionOptionsBody": { - "type": "object", - "properties": { - "runId": { - "type": "string", - "description": "Run ID of the workflow or standalone activity." - }, - "identity": { - "type": "string", - "title": "The identity of the client who initiated this request" - }, - "activityOptions": { - "$ref": "#/definitions/v1ActivityOptions", - "title": "Activity options. Partial updates are accepted and controlled by update_mask" - }, - "updateMask": { - "type": "string", - "title": "Controls which fields from `activity_options` will be applied" - }, - "restoreOriginal": { - "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." - }, - "resourceId": { - "type": "string", - "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." - } - } - }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -12631,10 +11747,10 @@ }, "restoreOriginal": { "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } }, - "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions\nDeprecated. Use `UpdateActivityExecutionOptionsRequest`." + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", @@ -12920,6 +12036,24 @@ }, "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." }, + "WorkflowServiceWaitForExternalWorkflowBody": { + "type": "object", + "properties": { + "execution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "The workflow execution to wait for.", + "title": "The workflow execution to wait for." + }, + "identity": { + "type": "string" + } + } + }, "apiActivityV1CallbackInfo": { "type": "object", "properties": { @@ -17166,12 +16300,8 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityExecutionResponse": { - "type": "object" - }, "v1PauseActivityResponse": { - "type": "object", - "description": "Deprecated. Use `PauseActivityExecutionResponse`." + "type": "object" }, "v1PauseWorkflowExecutionResponse": { "type": "object", @@ -18005,12 +17135,8 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityExecutionResponse": { - "type": "object" - }, "v1ResetActivityResponse": { - "type": "object", - "description": "Deprecated. Use `ResetActivityExecutionRequest`." + "type": "object" }, "v1ResetOptions": { "type": "object", @@ -19488,26 +18614,13 @@ } } }, - "v1UnpauseActivityExecutionResponse": { - "type": "object" - }, "v1UnpauseActivityResponse": { - "type": "object", - "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." + "type": "object" }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, - "v1UpdateActivityExecutionOptionsResponse": { - "type": "object", - "properties": { - "activityOptions": { - "$ref": "#/definitions/v1ActivityOptions", - "title": "Activity options after an update" - } - } - }, "v1UpdateActivityOptionsResponse": { "type": "object", "properties": { @@ -19515,8 +18628,7 @@ "$ref": "#/definitions/v1ActivityOptions", "title": "Activity options after an update" } - }, - "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." + } }, "v1UpdateAdmittedEventOrigin": { "type": "string", @@ -19813,6 +18925,20 @@ }, "description": "Used to override the versioning behavior (and pinned deployment version, if applicable) of a\nspecific workflow execution. If set, this override takes precedence over worker-sent values.\nSee `WorkflowExecutionInfo.VersioningInfo` for more information.\n\nTo remove the override, call `UpdateWorkflowExecutionOptions` with a null\n`VersioningOverride`, and use the `update_mask` to indicate that it should be mutated.\n\nPinned behavior overrides are automatically inherited by child workflows, workflow retries, continue-as-new\nworkflows, and cron workflows." }, + "v1WaitForExternalWorkflowResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v1WorkflowExecutionStatus" + }, + "result": { + "$ref": "#/definitions/v1Payload" + }, + "failure": { + "$ref": "#/definitions/v1Failure" + } + } + }, "v1WaitPolicy": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 14a6a130c..af89932e6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -109,15 +109,6 @@ paths: in: query schema: type: string - - name: weakConsistency - in: query - description: |- - If true, the server may serve the response from an eventually-consistent - source instead of reading through to persistence. Defaults to false, - which preserves read-after-write consistency. SDKs should set this when - fetching namespace capabilities on worker/client startup. - schema: - type: boolean responses: "200": description: OK @@ -670,107 +661,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/reset: - post: - tags: - - WorkflowService - description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -854,92 +744,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -3161,13 +2965,6 @@ paths: * Status schema: type: string - - name: includeSystemWorkers - in: query - description: |- - When true, the response will include system workers that are created implicitly - by the server and not by the user. By default, system workers are excluded. - schema: - type: boolean responses: "200": description: OK @@ -3754,6 +3551,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + post: + tags: + - WorkflowService + description: |- + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}: post: tags: @@ -3942,45 +3781,33 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -3988,7 +3815,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -3996,47 +3823,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: post: tags: - WorkflowService description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow to pause. required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. + description: ID of the workflow execution to be paused. Required. required: true schema: type: string @@ -4044,7 +3861,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' required: true responses: "200": @@ -4052,217 +3869,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to confirm is cancelled - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: workflowId - in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: - post: - tags: - - WorkflowService - description: |- - Note: This is an experimental API and the behavior may change in a future release. - PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in - - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history - - No new workflow tasks or activity tasks are dispatched. - - Any workflow task currently executing on the worker will be allowed to complete. - - Any activity task currently executing will be paused. - - All server-side events will continue to be processed by the server. - - Queries & Updates on a paused workflow will be rejected. - operationId: PauseWorkflowExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow to pause. - required: true - schema: - type: string - - name: workflowId - in: path - description: ID of the workflow execution to be paused. Required. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseWorkflowExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseWorkflowExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: - post: - tags: - - WorkflowService - description: |- - SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if - it isn't yet started. + SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if + it isn't yet started. If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history and a workflow task is generated. @@ -4888,15 +4508,6 @@ paths: in: query schema: type: string - - name: weakConsistency - in: query - description: |- - If true, the server may serve the response from an eventually-consistent - source instead of reading through to persistence. Defaults to false, - which preserves read-after-write consistency. SDKs should set this when - fetching namespace capabilities on worker/client startup. - schema: - type: boolean responses: "200": description: OK @@ -5673,107 +5284,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/reset: - post: - tags: - - WorkflowService - description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) - - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -5857,92 +5367,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/update-options: - post: - tags: - - WorkflowService - description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/activity-complete: post: tags: @@ -8106,13 +7530,6 @@ paths: * Status schema: type: string - - name: includeSystemWorkers - in: query - description: |- - When true, the response will include system workers that are created implicitly - by the server and not by the user. By default, system workers are excluded. - schema: - type: boolean responses: "200": description: OK @@ -8699,172 +8116,26 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}: + /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: post: tags: - WorkflowService description: |- - StartWorkflowExecution starts a new workflow execution. - - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: - post: - tags: - - WorkflowService - description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCompletedById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to complete - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: - post: - tags: - - WorkflowService - description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId - in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity - required: true - schema: - type: string - - name: activityId - in: path - description: Id of the activity to fail - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: - post: - tags: - - WorkflowService - description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity - required: true - schema: - type: string - - name: workflowId + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - - name: activityId + - name: execution.workflow_id in: path - description: Id of the activity we're heartbeating required: true schema: type: string @@ -8872,7 +8143,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' required: true responses: "200": @@ -8880,52 +8151,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + /namespaces/{namespace}/workflows/{workflowId}: post: tags: - WorkflowService description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + StartWorkflowExecution starts a new workflow execution. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. - required: true - schema: - type: string - - name: activityId - in: path - description: The ID of the activity to target. required: true schema: type: string @@ -8933,7 +8184,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/StartWorkflowExecutionRequest' required: true responses: "200": @@ -8941,47 +8192,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/StartWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: post: tags: - WorkflowService description: |- - ResetActivityExecution resets the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - Resetting an activity means: - * number of attempts will be reset to 0. - * activity timeouts will be reset. - * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: - it will be scheduled immediately (* see 'jitter' flag) + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - operationId: ResetActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCompletedById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to complete required: true schema: type: string @@ -8989,7 +8233,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' required: true responses: "200": @@ -8997,24 +8241,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by + See `RecordActivityTaskFailed`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + operationId: RespondActivityTaskFailedById parameters: - name: namespace in: path @@ -9030,7 +8274,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: Id of the activity to fail required: true schema: type: string @@ -9038,7 +8282,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -9046,45 +8290,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity we're heartbeating required: true schema: type: string @@ -9092,7 +8331,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -9100,21 +8339,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. - This API can be used to target a workflow activity or a standalone activity. - operationId: UpdateActivityExecutionOptions + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -9124,15 +8366,13 @@ paths: type: string - name: workflowId in: path - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - name: activityId in: path - description: The ID of the activity to target. + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -9140,7 +8380,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -9148,7 +8388,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: @@ -13579,38 +12819,6 @@ components: PatchScheduleResponse: type: object properties: {} - PauseActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - reason: - type: string - description: Reason to pause the activity. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - requestId: - type: string - description: Used to de-dupe pause requests. - PauseActivityExecutionResponse: - type: object - properties: {} PauseActivityRequest: type: object properties: @@ -13635,14 +12843,9 @@ components: reason: type: string description: Reason to pause the activity. - requestId: - type: string - description: Used to de-dupe pause requests. - description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} - description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -14772,52 +13975,6 @@ components: Indicate if the request is still buffered. If so, the event ID is not known and its value will be an invalid event ID. description: RequestIdInfo contains details of a request ID. - ResetActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - resetHeartbeat: - type: boolean - description: |- - Indicates that activity should reset heartbeat details. - This flag will be applied only to the new instance of the activity. - keepPaused: - type: boolean - description: If activity is paused, it will remain paused after reset - jitter: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: |- - If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. - (unless it is paused and keep_paused is set) - restoreOriginalOptions: - type: boolean - description: |- - If set, the activity options will be restored to the defaults. - Default options are then options activity was created with. - They are part of the first schedule event. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - ResetActivityExecutionResponse: - type: object - properties: {} ResetActivityRequest: type: object properties: @@ -14859,14 +14016,11 @@ components: description: |- If set, the activity options will be restored to the defaults. Default options are then options activity was created with. - They are part of the first schedule event. - description: |- - NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities - Deprecated. Use `ResetActivityExecutionRequest`. + They are part of the first SCHEDULE event. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' ResetActivityResponse: type: object properties: {} - description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -17315,45 +16469,6 @@ components: applied: type: boolean description: True is the rule was applied, based on the rule conditions (predicate/visibility_query). - UnpauseActivityExecutionRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity. - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request. - resetAttempts: - type: boolean - description: Providing this flag will also reset the number of attempts. - resetHeartbeat: - type: boolean - description: Providing this flag will also reset the heartbeat details. - reason: - type: string - description: Reason to unpause the activity. - jitter: - pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ - type: string - description: If set, the activity will start at a random time within the specified jitter duration. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - UnpauseActivityExecutionResponse: - type: object - properties: {} UnpauseActivityRequest: type: object properties: @@ -17386,11 +16501,9 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. - description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} - description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -17416,52 +16529,6 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. - UpdateActivityExecutionOptionsRequest: - type: object - properties: - namespace: - type: string - description: Namespace of the workflow which scheduled this activity - workflowId: - type: string - description: |- - If provided, targets a workflow activity for the given workflow ID. - If empty, targets a standalone activity. - activityId: - type: string - description: The ID of the activity to target. - runId: - type: string - description: Run ID of the workflow or standalone activity. - identity: - type: string - description: The identity of the client who initiated this request - activityOptions: - allOf: - - $ref: '#/components/schemas/ActivityOptions' - description: Activity options. Partial updates are accepted and controlled by update_mask - updateMask: - type: string - description: Controls which fields from `activity_options` will be applied - format: field-mask - restoreOriginal: - type: boolean - description: |- - If set, the activity options will be restored to the default. - Default options are then options activity was created with. - They are part of the first schedule event. - This flag cannot be combined with any other option; if you supply - restore_original together with other options, the request will be rejected. - resourceId: - type: string - description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. - UpdateActivityExecutionOptionsResponse: - type: object - properties: - activityOptions: - allOf: - - $ref: '#/components/schemas/ActivityOptions' - description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: @@ -17497,12 +16564,10 @@ components: description: |- If set, the activity options will be restored to the default. Default options are then options activity was created with. - They are part of the first schedule event. + They are part of the first SCHEDULE event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: |- - NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions - Deprecated. Use `UpdateActivityExecutionOptionsRequest`. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' UpdateActivityOptionsResponse: type: object properties: @@ -17510,7 +16575,6 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update - description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: @@ -18105,6 +17169,37 @@ components: If omitted and the target workflow is not pinned, the override request will be rejected with a PreconditionFailed error. + WaitForExternalWorkflowRequest: + type: object + properties: + namespace: + type: string + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: The workflow execution to wait for. + identity: + type: string + WaitForExternalWorkflowResponse: + type: object + properties: + status: + enum: + - WORKFLOW_EXECUTION_STATUS_UNSPECIFIED + - WORKFLOW_EXECUTION_STATUS_RUNNING + - WORKFLOW_EXECUTION_STATUS_COMPLETED + - WORKFLOW_EXECUTION_STATUS_FAILED + - WORKFLOW_EXECUTION_STATUS_CANCELED + - WORKFLOW_EXECUTION_STATUS_TERMINATED + - WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW + - WORKFLOW_EXECUTION_STATUS_TIMED_OUT + - WORKFLOW_EXECUTION_STATUS_PAUSED + type: string + format: enum + result: + $ref: '#/components/schemas/Payload' + failure: + $ref: '#/components/schemas/Failure' WaitPolicy: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 97e17786b..4d16e065f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3391,20 +3391,14 @@ message WaitForExternalWorkflowRequest { string namespace = 1; // The workflow execution to wait for. temporal.api.common.v1.WorkflowExecution execution = 2; - // Used to de-dupe requests. Typically should be UUID. - string request_id = 3; - string identity = 4; - - repeated temporal.api.common.v1.Link links = 5; + string identity = 3; } message WaitForExternalWorkflowResponse { temporal.api.enums.v1.WorkflowExecutionStatus status = 1; - repeated temporal.api.common.v1.Link links = 2; - oneof completion_status { - temporal.api.common.v1.Payload result = 3; - temporal.api.failure.v1.Failure failure = 4; + temporal.api.common.v1.Payload result = 2; + temporal.api.failure.v1.Failure failure = 3; } } \ No newline at end of file From 58811160a49748f67b452a29e597ab467490f04b Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 15 May 2026 15:48:31 -0600 Subject: [PATCH 4/4] fixing lost changes --- openapi/openapiv2.json | 1312 ++++++++++++++-- openapi/openapiv3.yaml | 1328 +++++++++++++++-- .../workflowservice/v1/request_response.proto | 164 +- temporal/api/workflowservice/v1/service.proto | 140 ++ 4 files changed, 2629 insertions(+), 315 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 7d1d302a7..9a7e9c285 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -150,6 +150,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "weakConsistency", + "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -716,6 +723,102 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -809,6 +912,101 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -3290,6 +3488,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "includeSystemWorkers", + "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -4515,15 +4720,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById4", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -4536,21 +4742,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4560,7 +4766,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -4569,15 +4775,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", - "operationId": "PauseWorkflowExecution2", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -4590,14 +4797,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow to pause.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4607,7 +4821,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -4616,16 +4830,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", - "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", - "operationId": "SignalWithStartWorkflowExecution2", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -4638,19 +4851,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "activityId", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -4660,7 +4875,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -4669,15 +4884,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", - "operationId": "UnpauseWorkflowExecution2", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -4690,14 +4906,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow to unpause.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4707,7 +4930,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -4716,15 +4939,15 @@ ] } }, - "/api/v1/nexus/endpoints": { - "get": { - "summary": "List all Nexus endpoints for the cluster, sorted by ID in ascending order. Set page_token in the request to the\nnext_page_token field of the previous response to get the next page of results. An empty next_page_token\nindicates that there are no more results. During pagination, a newly added service with an ID lexicographically\nearlier than the previous page's last endpoint's ID may be missed.", - "operationId": "ListNexusEndpoints2", + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListNexusEndpointsResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -4736,23 +4959,224 @@ }, "parameters": [ { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "description": "To get the next page, pass in `ListNexusEndpointsResponse.next_page_token` from the previous page's\nresponse, the token will be empty if there's no other page.\nNote: the last page may be empty if the total number of endpoints registered is a multiple of the page size.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" }, { - "name": "name", - "description": "Name of the incoming endpoint to filter on - optional. Specifying this will result in zero or one results.", + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to pause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "post": { + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", + "operationId": "SignalWithStartWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", + "operationId": "UnpauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to unpause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/nexus/endpoints": { + "get": { + "summary": "List all Nexus endpoints for the cluster, sorted by ID in ascending order. Set page_token in the request to the\nnext_page_token field of the previous response to get the next page of results. An empty next_page_token\nindicates that there are no more results. During pagination, a newly added service with an ID lexicographically\nearlier than the previous page's last endpoint's ID may be missed.", + "operationId": "ListNexusEndpoints2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListNexusEndpointsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "pageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "To get the next page, pass in `ListNexusEndpointsResponse.next_page_token` from the previous page's\nresponse, the token will be empty if there's no other page.\nNote: the last page may be empty if the total number of endpoints registered is a multiple of the page size.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "name", + "description": "Name of the incoming endpoint to filter on - optional. Specifying this will result in zero or one results.", "in": "query", "required": false, "type": "string" @@ -5058,6 +5482,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "weakConsistency", + "description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -5746,13 +6177,200 @@ }, "/namespaces/{namespace}/activities/{activityId}/fail": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "post": { + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity we're heartbeating", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -5765,14 +6383,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5782,7 +6400,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -5791,15 +6409,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -5819,7 +6437,7 @@ }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -5829,7 +6447,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -5838,15 +6456,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", + "/namespaces/{namespace}/activities/{activityId}/terminate": { + "post": { + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -5870,11 +6489,12 @@ "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } } ], "tags": [ @@ -5882,15 +6502,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/activities/{activityId}/unpause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -5903,14 +6524,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5920,7 +6541,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -5929,16 +6550,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { + "/namespaces/{namespace}/activities/{activityId}/update-options": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -5951,12 +6571,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5966,7 +6588,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -8386,6 +9008,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "includeSystemWorkers", + "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -9215,7 +9844,204 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "post": { + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "post": { + "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", + "operationId": "UpdateWorkflowExecutionOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace name of the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "post": { + "summary": "Invokes the specified Update function on user Workflow code.", + "operationId": "UpdateWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace name of the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "request.input.name", + "description": "The name of the Update handler to invoke on the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}": { + "post": { + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -9233,14 +10059,7 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "workflowId", "in": "path", "required": true, "type": "string" @@ -9250,7 +10069,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -9259,15 +10078,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -9280,12 +10099,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to complete", "in": "path", "required": true, "type": "string" @@ -9295,7 +10123,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -9304,15 +10132,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -9325,13 +10153,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", "in": "path", "required": true, "type": "string" @@ -9341,7 +10177,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -9350,15 +10186,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -9371,20 +10207,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", "in": "path", "required": true, "type": "string" }, { - "name": "request.input.name", - "description": "The name of the Update handler to invoke on the target Workflow.", + "name": "activityId", + "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -9394,7 +10231,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -9403,16 +10240,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -9425,12 +10262,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9440,7 +10286,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -9449,15 +10295,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById3", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -9470,21 +10317,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to complete", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9494,7 +10341,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -9503,15 +10350,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById3", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -9538,7 +10385,7 @@ }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -9548,7 +10395,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -9557,15 +10404,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById3", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -9578,21 +10426,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9602,7 +10450,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -9611,15 +10459,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById3", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -9639,14 +10487,14 @@ }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9656,7 +10504,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -10492,6 +11340,36 @@ "reason": { "type": "string", "description": "Reason to pause the activity." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe pause requests." + } + }, + "description": "Deprecated. Use `PauseActivityExecutionRequest`." + }, + "WorkflowServicePauseActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe pause requests." } } }, @@ -10729,10 +11607,43 @@ }, "restoreOriginalOptions": { "type": "boolean", - "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." + }, + "WorkflowServiceResetActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." + }, + "keepPaused": { + "type": "boolean", + "title": "If activity is paused, it will remain paused after reset" + }, + "jitter": { + "type": "string", + "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" + }, + "restoreOriginalOptions": { + "type": "boolean", + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first schedule event." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -11691,6 +12602,40 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } + }, + "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." + }, + "WorkflowServiceUnpauseActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetAttempts": { + "type": "boolean", + "description": "Providing this flag will also reset the number of attempts." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Providing this flag will also reset the heartbeat details." + }, + "reason": { + "type": "string", + "description": "Reason to unpause the activity." + }, + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } } }, "WorkflowServiceUnpauseWorkflowExecutionBody": { @@ -11714,6 +12659,35 @@ } } }, + "WorkflowServiceUpdateActivityExecutionOptionsBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "title": "The identity of the client who initiated this request" + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options. Partial updates are accepted and controlled by update_mask" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `activity_options` will be applied" + }, + "restoreOriginal": { + "type": "boolean", + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } + }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -11747,10 +12721,10 @@ }, "restoreOriginal": { "type": "boolean", - "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first schedule event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions\nDeprecated. Use `UpdateActivityExecutionOptionsRequest`." }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", @@ -16300,9 +17274,13 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityResponse": { + "v1PauseActivityExecutionResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `PauseActivityExecutionResponse`." + }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." @@ -17135,9 +18113,13 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityResponse": { + "v1ResetActivityExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object", + "description": "Deprecated. Use `ResetActivityExecutionRequest`." + }, "v1ResetOptions": { "type": "object", "properties": { @@ -18614,14 +19596,18 @@ } } }, - "v1UnpauseActivityResponse": { + "v1UnpauseActivityExecutionResponse": { "type": "object" }, + "v1UnpauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." + }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, - "v1UpdateActivityOptionsResponse": { + "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { "activityOptions": { @@ -18630,6 +19616,16 @@ } } }, + "v1UpdateActivityOptionsResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options after an update" + } + }, + "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index af89932e6..e6394e342 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -109,6 +109,15 @@ paths: in: query schema: type: string + - name: weakConsistency + in: query + description: |- + If true, the server may serve the response from an eventually-consistent + source instead of reading through to persistence. Defaults to false, + which preserves read-after-write consistency. SDKs should set this when + fetching namespace capabilities on worker/client startup. + schema: + type: boolean responses: "200": description: OK @@ -661,6 +670,107 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -744,6 +854,92 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -2965,6 +3161,13 @@ paths: * Status schema: type: string + - name: includeSystemWorkers + in: query + description: |- + When true, the response will include system workers that are created implicitly + by the server and not by the user. By default, system workers are excluded. + schema: + type: boolean responses: "200": description: OK @@ -3781,33 +3984,45 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: The ID of the activity to target. required: true schema: type: string @@ -3815,7 +4030,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -3823,37 +4038,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - Note: This is an experimental API and the behavior may change in a future release. - PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in - - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history - - No new workflow tasks or activity tasks are dispatched. - - Any workflow task currently executing on the worker will be allowed to complete. - - Any activity task currently executing will be paused. - - All server-side events will continue to be processed by the server. - - Queries & Updates on a paused workflow will be rejected. - operationId: PauseWorkflowExecution + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow to pause. + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: ID of the workflow execution to be paused. Required. + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. required: true schema: type: string @@ -3861,7 +4086,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -3869,45 +4094,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if - it isn't yet started. - - If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history - and a workflow task is generated. - - If the workflow is not running or not found, then the workflow is created with - `WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a - workflow task is generated. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "With" is used to indicate combined operation. --) - operationId: SignalWithStartWorkflowExecution + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: workflowId in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity required: true schema: type: string - - name: signalName + - name: activityId in: path - description: The workflow author-defined name of the signal to send to the workflow + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -3915,7 +4135,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignalWithStartWorkflowExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -3923,28 +4143,230 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignalWithStartWorkflowExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - Note: This is an experimental API and the behavior may change in a future release. - UnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request. - Unpausing a workflow execution results in - - The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history - - Workflow tasks and activity tasks are resumed. - operationId: UnpauseWorkflowExecution + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow to unpause. + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to pause. + required: true + schema: + type: string + - name: workflowId + in: path + description: ID of the workflow execution to be paused. Required. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: + post: + tags: + - WorkflowService + description: |- + SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if + it isn't yet started. + + If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history + and a workflow task is generated. + + If the workflow is not running or not found, then the workflow is created with + `WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a + workflow task is generated. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "With" is used to indicate combined operation. --) + operationId: SignalWithStartWorkflowExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: signalName + in: path + description: The workflow author-defined name of the signal to send to the workflow + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SignalWithStartWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SignalWithStartWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + UnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request. + Unpausing a workflow execution results in + - The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history + - Workflow tasks and activity tasks are resumed. + operationId: UnpauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to unpause. required: true schema: type: string @@ -4508,6 +4930,15 @@ paths: in: query schema: type: string + - name: weakConsistency + in: query + description: |- + If true, the server may serve the response from an eventually-consistent + source instead of reading through to persistence. Defaults to false, + which preserves read-after-write consistency. SDKs should set this when + fetching namespace capabilities on worker/client startup. + schema: + type: boolean responses: "200": description: OK @@ -5169,19 +5600,200 @@ paths: See `RecordActivityTaskFailed`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskFailedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to fail + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/heartbeat: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity we're heartbeating + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/outcome: + get: + tags: + - WorkflowService + description: |- + PollActivityExecution long-polls for an activity execution to complete and returns the + outcome (result or failure). + operationId: PollActivityExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + - name: runId + in: query + description: Activity run ID. If empty the request targets the latest run. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to fail + description: The ID of the activity to target. required: true schema: type: string @@ -5189,7 +5801,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -5197,24 +5809,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/heartbeat: + /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + See `RespondActivityTaskCanceled`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -5224,7 +5836,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity we're heartbeating + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -5232,7 +5844,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -5240,21 +5852,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/outcome: - get: + /namespaces/{namespace}/activities/{activityId}/terminate: + post: tags: - WorkflowService description: |- - PollActivityExecution long-polls for an activity execution to complete and returns the - outcome (result or failure). - operationId: PollActivityExecution + TerminateActivityExecution terminates an existing activity execution immediately. + + Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a + running attempt. + operationId: TerminateActivityExecution parameters: - name: namespace in: path @@ -5266,45 +5880,49 @@ paths: required: true schema: type: string - - name: runId - in: query - description: Activity run ID. If empty the request targets the latest run. - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/PollActivityExecutionResponse' + $ref: '#/components/schemas/TerminateActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: The ID of the activity to target. required: true schema: type: string @@ -5312,7 +5930,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' required: true responses: "200": @@ -5320,31 +5938,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/terminate: + /namespaces/{namespace}/activities/{activityId}/update-options: post: tags: - WorkflowService description: |- - TerminateActivityExecution terminates an existing activity execution immediately. - - Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a - running attempt. - operationId: TerminateActivityExecution + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: activityId in: path + description: The ID of the activity to target. required: true schema: type: string @@ -5352,7 +5970,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionRequest' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' required: true responses: "200": @@ -5360,7 +5978,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionResponse' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' default: description: Default error response content: @@ -7530,6 +8148,13 @@ paths: * Status schema: type: string + - name: includeSystemWorkers + in: query + description: |- + When true, the response will include system workers that are created implicitly + by the server and not by the user. By default, system workers are excluded. + schema: + type: boolean responses: "200": description: OK @@ -8092,8 +8717,189 @@ paths: required: true schema: type: string - - name: execution.workflow_id + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWorkflowRuleRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWorkflowRuleResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + post: + tags: + - WorkflowService + description: |- + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}: + post: + tags: + - WorkflowService + description: |- + StartWorkflowExecution starts a new workflow execution. + + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + post: + tags: + - WorkflowService + description: |- + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCompletedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to complete + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskFailed`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskFailedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId in: path + description: Id of the activity to fail required: true schema: type: string @@ -8101,7 +8907,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TriggerWorkflowRuleRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -8109,33 +8915,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TriggerWorkflowRuleResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - WaitForExternalWorkflow asynchronously waits for an external workflow to complete + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. - (-- api-linter: core::0127::http-annotation=disabled - aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) - operationId: WaitForExternalWorkflow + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - - name: execution.workflow_id + - name: workflowId in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity we're heartbeating required: true schema: type: string @@ -8143,7 +8956,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -8151,32 +8964,52 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - StartWorkflowExecution starts a new workflow execution. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: The ID of the activity to target. required: true schema: type: string @@ -8184,7 +9017,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -8192,40 +9025,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCompletedById + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag) + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to complete + description: The ID of the activity to target. required: true schema: type: string @@ -8233,7 +9073,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -8241,24 +9081,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by + See `RespondActivityTaskCanceled`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -8274,7 +9114,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity to fail + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -8282,7 +9122,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -8290,40 +9130,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity we're heartbeating + description: The ID of the activity to target. required: true schema: type: string @@ -8331,7 +9176,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' required: true responses: "200": @@ -8339,24 +9184,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions parameters: - name: namespace in: path @@ -8366,13 +9208,15 @@ paths: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: The ID of the activity to target. required: true schema: type: string @@ -8380,7 +9224,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' required: true responses: "200": @@ -8388,7 +9232,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' default: description: Default error response content: @@ -12819,6 +13663,38 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + reason: + type: string + description: Reason to pause the activity. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + requestId: + type: string + description: Used to de-dupe pause requests. + PauseActivityExecutionResponse: + type: object + properties: {} PauseActivityRequest: type: object properties: @@ -12843,9 +13719,14 @@ components: reason: type: string description: Reason to pause the activity. + requestId: + type: string + description: Used to de-dupe pause requests. + description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} + description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -13975,6 +14856,52 @@ components: Indicate if the request is still buffered. If so, the event ID is not known and its value will be an invalid event ID. description: RequestIdInfo contains details of a request ID. + ResetActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetHeartbeat: + type: boolean + description: |- + Indicates that activity should reset heartbeat details. + This flag will be applied only to the new instance of the activity. + keepPaused: + type: boolean + description: If activity is paused, it will remain paused after reset + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + (unless it is paused and keep_paused is set) + restoreOriginalOptions: + type: boolean + description: |- + If set, the activity options will be restored to the defaults. + Default options are then options activity was created with. + They are part of the first schedule event. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + ResetActivityExecutionResponse: + type: object + properties: {} ResetActivityRequest: type: object properties: @@ -14016,11 +14943,14 @@ components: description: |- If set, the activity options will be restored to the defaults. Default options are then options activity was created with. - They are part of the first SCHEDULE event. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' + They are part of the first schedule event. + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities + Deprecated. Use `ResetActivityExecutionRequest`. ResetActivityResponse: type: object properties: {} + description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -16469,6 +17399,45 @@ components: applied: type: boolean description: True is the rule was applied, based on the rule conditions (predicate/visibility_query). + UnpauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetAttempts: + type: boolean + description: Providing this flag will also reset the number of attempts. + resetHeartbeat: + type: boolean + description: Providing this flag will also reset the heartbeat details. + reason: + type: string + description: Reason to unpause the activity. + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: If set, the activity will start at a random time within the specified jitter duration. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UnpauseActivityExecutionResponse: + type: object + properties: {} UnpauseActivityRequest: type: object properties: @@ -16501,9 +17470,11 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. + description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} + description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -16529,6 +17500,52 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UpdateActivityExecutionOptionsRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, targets a standalone activity. + activityId: + type: string + description: The ID of the activity to target. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options. Partial updates are accepted and controlled by update_mask + updateMask: + type: string + description: Controls which fields from `activity_options` will be applied + format: field-mask + restoreOriginal: + type: boolean + description: |- + If set, the activity options will be restored to the default. + Default options are then options activity was created with. + They are part of the first schedule event. + This flag cannot be combined with any other option; if you supply + restore_original together with other options, the request will be rejected. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UpdateActivityExecutionOptionsResponse: + type: object + properties: + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: @@ -16564,10 +17581,12 @@ components: description: |- If set, the activity options will be restored to the default. Default options are then options activity was created with. - They are part of the first SCHEDULE event. + They are part of the first schedule event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions + Deprecated. Use `UpdateActivityExecutionOptionsRequest`. UpdateActivityOptionsResponse: type: object properties: @@ -16575,6 +17594,7 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update + description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 4d16e065f..5f6fa6ddb 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -86,6 +86,11 @@ message ListNamespacesResponse { message DescribeNamespaceRequest { string namespace = 1; string id = 2; + // If true, the server may serve the response from an eventually-consistent + // source instead of reading through to persistence. Defaults to false, + // which preserves read-after-write consistency. SDKs should set this when + // fetching namespace capabilities on worker/client startup. + bool weak_consistency = 3; } message DescribeNamespaceResponse { @@ -199,6 +204,7 @@ message StartWorkflowExecutionRequest { temporal.api.common.v1.Priority priority = 27; // Deployment Options of the worker who will process the eager task. Passed when `request_eager_execution=true`. temporal.api.deployment.v1.WorkerDeploymentOptions eager_worker_deployment_options = 28; + // Time-skipping configuration. If not set, time skipping is disabled. temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 29; } @@ -2065,6 +2071,7 @@ message ExecuteMultiOperationResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions +// Deprecated. Use `UpdateActivityExecutionOptionsRequest`. message UpdateActivityOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; @@ -2092,17 +2099,56 @@ message UpdateActivityOptionsRequest { // If set, the activity options will be restored to the default. // Default options are then options activity was created with. - // They are part of the first SCHEDULE event. + // They are part of the first schedule event. + // This flag cannot be combined with any other option; if you supply + // restore_original together with other options, the request will be rejected. + bool restore_original = 8; +} + +message UpdateActivityExecutionOptionsRequest { + // Namespace of the workflow which scheduled this activity + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, targets a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request + string identity = 5; + + // Activity options. Partial updates are accepted and controlled by update_mask + temporal.api.activity.v1.ActivityOptions activity_options = 6; + + // Controls which fields from `activity_options` will be applied + google.protobuf.FieldMask update_mask = 7; + + // If set, the activity options will be restored to the default. + // Default options are then options activity was created with. + // They are part of the first schedule event. // This flag cannot be combined with any other option; if you supply // restore_original together with other options, the request will be rejected. bool restore_original = 8; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 9; } +// Deprecated. Use `UpdateActivityExecutionOptionsResponse`. message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } +message UpdateActivityExecutionOptionsResponse { + // Activity options after an update + temporal.api.activity.v1.ActivityOptions activity_options = 1; +} + +// Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2123,11 +2169,45 @@ message PauseActivityRequest { // Reason to pause the activity. string reason = 6; + + // Used to de-dupe pause requests. + string request_id = 7; + } +message PauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, targets a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Reason to pause the activity. + string reason = 6; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 7; + + // Used to de-dupe pause requests. + string request_id = 8; +} + +// Deprecated. Use `PauseActivityExecutionResponse`. message PauseActivityResponse { } +message PauseActivityExecutionResponse { +} + +// Deprecated. Use `UnpauseActivityExecutionRequest`. message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2157,10 +2237,46 @@ message UnpauseActivityRequest { google.protobuf.Duration jitter = 9; } +message UnpauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, targets a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Providing this flag will also reset the number of attempts. + bool reset_attempts = 6; + + // Providing this flag will also reset the heartbeat details. + bool reset_heartbeat = 7; + + // Reason to unpause the activity. + string reason = 8; + + // If set, the activity will start at a random time within the specified jitter duration. + google.protobuf.Duration jitter = 9; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; +} + +// Deprecated. Use `UnpauseActivityExecutionResponse`. message UnpauseActivityResponse { } +message UnpauseActivityExecutionResponse { +} + // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2193,14 +2309,52 @@ message ResetActivityRequest { // If set, the activity options will be restored to the defaults. // Default options are then options activity was created with. - // They are part of the first SCHEDULE event. + // They are part of the first schedule event. + bool restore_original_options = 9; +} + +message ResetActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, targets a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Indicates that activity should reset heartbeat details. + // This flag will be applied only to the new instance of the activity. + bool reset_heartbeat = 6; + + // If activity is paused, it will remain paused after reset + bool keep_paused = 7; + + // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + // (unless it is paused and keep_paused is set) + google.protobuf.Duration jitter = 8; + + // If set, the activity options will be restored to the defaults. + // Default options are then options activity was created with. + // They are part of the first schedule event. bool restore_original_options = 9; + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; } +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityResponse { } +message ResetActivityExecutionResponse { +} + // Keep the parameters in sync with: // - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions. // - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions. @@ -2781,6 +2935,10 @@ message ListWorkersRequest { //* StartTime //* Status string query = 4; + + // When true, the response will include system workers that are created implicitly + // by the server and not by the user. By default, system workers are excluded. + bool include_system_workers = 5; } message ListWorkersResponse { @@ -3401,4 +3559,4 @@ message WaitForExternalWorkflowResponse { temporal.api.common.v1.Payload result = 2; temporal.api.failure.v1.Failure failure = 3; } -} \ No newline at end of file +} diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 96b192bdb..3b30eaf42 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1530,6 +1530,10 @@ service WorkflowService { body: "*" } }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; } // WorkerHeartbeat receive heartbeat request from the worker. @@ -1865,6 +1869,141 @@ service WorkflowService { // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteActivityExecution (DeleteActivityExecutionRequest) returns (DeleteActivityExecutionResponse) {} + // PauseActivityExecution pauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity + // + // Pausing an activity means: + // - If the activity is currently waiting for a retry or is running and subsequently fails, + // it will not be rescheduled until it is unpaused. + // - If the activity is already paused, calling this method will have no effect. + // - If the activity is running and finishes successfully, the activity will be completed. + // - If the activity is running and finishes with failure: + // * if there is no retry left - the activity will be completed. + // * if there are more retries left - the activity will be paused. + // For long-running activities: + // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/pause" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // ResetActivityExecution resets the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // Resetting an activity means: + // * number of attempts will be reset to 0. + // * activity timeouts will be reset. + // * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + // it will be scheduled immediately (* see 'jitter' flag) + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type. + rpc ResetActivityExecution (ResetActivityExecutionRequest) returns (ResetActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // If activity is not paused, this call will have no effect. + // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + // Once the activity is unpaused, all timeout timers will be regenerated. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/unpause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/unpause" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + // This API can be used to target a workflow activity or a standalone activity. + rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + // TerminateNexusOperationExecution terminates an existing Nexus operation immediately. // // Termination happens immediately and the operation handler cannot react to it. A terminated operation will have @@ -1887,6 +2026,7 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: Nexus operation deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteNexusOperationExecution (DeleteNexusOperationExecutionRequest) returns (DeleteNexusOperationExecutionResponse) {} + // WaitForExternalWorkflow asynchronously waits for an external workflow to complete // // (-- api-linter: core::0127::http-annotation=disabled