From 33955d2c1ad594b87a65f72437662fed8cfa713a Mon Sep 17 00:00:00 2001 From: Nate Mortensen Date: Tue, 5 Aug 2025 17:00:49 -0700 Subject: [PATCH] Add support for Ephemeral TaskLists Update Sessions to use Ephemeral TaskLists behind a feature flag. This ensures that the per-host TaskList is automatically removed once it is no longer used. This should only be enabled once the server fully supports Ephemeral TaskLists as it will otherwise return errors for the unknown TaskListKind. --- .gen/go/shared/shared.go | 946 +++++++++++++++++++- idls | 2 +- internal/activity_task_handler.go | 2 +- internal/client.go | 1 + internal/compatibility/enum_test.go | 1 + internal/compatibility/proto/enum.go | 2 + internal/compatibility/thrift/enum.go | 2 + internal/internal_activity.go | 1 + internal/internal_event_handlers.go | 9 +- internal/internal_event_handlers_test.go | 1 + internal/internal_task_handlers.go | 3 + internal/internal_task_handlers_test.go | 134 +-- internal/internal_task_pollers.go | 10 +- internal/internal_utils.go | 3 +- internal/internal_worker.go | 32 +- internal/internal_worker_base.go | 1 + internal/internal_worker_interfaces_test.go | 5 +- internal/internal_worker_test.go | 4 +- internal/internal_workers_test.go | 108 ++- internal/internal_workflow_testsuite.go | 7 +- internal/workflow.go | 4 + internal/workflow_replayer.go | 5 +- internal/workflow_replayer_test.go | 18 +- internal/workflow_shadower_worker.go | 13 +- internal/workflow_shadower_worker_test.go | 4 +- test/integration_test.go | 16 + test/workflow_test.go | 24 + 27 files changed, 1243 insertions(+), 115 deletions(-) diff --git a/.gen/go/shared/shared.go b/.gen/go/shared/shared.go index aaff55f98..1c73e9909 100644 --- a/.gen/go/shared/shared.go +++ b/.gen/go/shared/shared.go @@ -24822,6 +24822,186 @@ func (v *DomainConfiguration) IsSetAsyncWorkflowConfiguration() bool { return v != nil && v.AsyncWorkflowConfiguration != nil } +type DomainIDPredicateAttributes struct { + DomainIDs []string `json:"domainIDs,omitempty"` + IsExclusive *bool `json:"isExclusive,omitempty"` +} + +// ToWire translates a DomainIDPredicateAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *DomainIDPredicateAttributes) ToWire() (wire.Value, error) { + var ( + fields [2]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.DomainIDs != nil { + w, err = wire.NewValueList(_List_String_ValueList(v.DomainIDs)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.IsExclusive != nil { + w, err = wire.NewValueBool(*(v.IsExclusive)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a DomainIDPredicateAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a DomainIDPredicateAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v DomainIDPredicateAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *DomainIDPredicateAttributes) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TList { + v.DomainIDs, err = _List_String_Read(field.Value.GetList()) + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TBool { + var x bool + x, err = field.Value.GetBool(), error(nil) + v.IsExclusive = &x + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a DomainIDPredicateAttributes +// struct. +func (v *DomainIDPredicateAttributes) String() string { + if v == nil { + return "" + } + + var fields [2]string + i := 0 + if v.DomainIDs != nil { + fields[i] = fmt.Sprintf("DomainIDs: %v", v.DomainIDs) + i++ + } + if v.IsExclusive != nil { + fields[i] = fmt.Sprintf("IsExclusive: %v", *(v.IsExclusive)) + i++ + } + + return fmt.Sprintf("DomainIDPredicateAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this DomainIDPredicateAttributes match the +// provided DomainIDPredicateAttributes. +// +// This function performs a deep comparison. +func (v *DomainIDPredicateAttributes) Equals(rhs *DomainIDPredicateAttributes) bool { + if v == nil { + return rhs == nil + } else if rhs == nil { + return false + } + if !((v.DomainIDs == nil && rhs.DomainIDs == nil) || (v.DomainIDs != nil && rhs.DomainIDs != nil && _List_String_Equals(v.DomainIDs, rhs.DomainIDs))) { + return false + } + if !_Bool_EqualsPtr(v.IsExclusive, rhs.IsExclusive) { + return false + } + + return true +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of DomainIDPredicateAttributes. +func (v *DomainIDPredicateAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { + if v == nil { + return nil + } + if v.DomainIDs != nil { + err = multierr.Append(err, enc.AddArray("domainIDs", (_List_String_Zapper)(v.DomainIDs))) + } + if v.IsExclusive != nil { + enc.AddBool("isExclusive", *v.IsExclusive) + } + return err +} + +// GetDomainIDs returns the value of DomainIDs if it is set or its +// zero value if it is unset. +func (v *DomainIDPredicateAttributes) GetDomainIDs() (o []string) { + if v != nil && v.DomainIDs != nil { + return v.DomainIDs + } + + return +} + +// IsSetDomainIDs returns true if DomainIDs is not nil. +func (v *DomainIDPredicateAttributes) IsSetDomainIDs() bool { + return v != nil && v.DomainIDs != nil +} + +// GetIsExclusive returns the value of IsExclusive if it is set or its +// zero value if it is unset. +func (v *DomainIDPredicateAttributes) GetIsExclusive() (o bool) { + if v != nil && v.IsExclusive != nil { + return *v.IsExclusive + } + + return +} + +// IsSetIsExclusive returns true if IsExclusive is not nil. +func (v *DomainIDPredicateAttributes) IsSetIsExclusive() bool { + return v != nil && v.IsExclusive != nil +} + type DomainInfo struct { Name *string `json:"name,omitempty"` Status *DomainStatus `json:"status,omitempty"` @@ -25974,6 +26154,96 @@ func (v *DomainStatus) UnmarshalJSON(text []byte) error { } } +type EmptyPredicateAttributes struct { +} + +// ToWire translates a EmptyPredicateAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *EmptyPredicateAttributes) ToWire() (wire.Value, error) { + var ( + fields [0]wire.Field + i int = 0 + ) + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a EmptyPredicateAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a EmptyPredicateAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v EmptyPredicateAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *EmptyPredicateAttributes) FromWire(w wire.Value) error { + + for _, field := range w.GetStruct().Fields { + switch field.ID { + } + } + + return nil +} + +// String returns a readable string representation of a EmptyPredicateAttributes +// struct. +func (v *EmptyPredicateAttributes) String() string { + if v == nil { + return "" + } + + var fields [0]string + i := 0 + + return fmt.Sprintf("EmptyPredicateAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this EmptyPredicateAttributes match the +// provided EmptyPredicateAttributes. +// +// This function performs a deep comparison. +func (v *EmptyPredicateAttributes) Equals(rhs *EmptyPredicateAttributes) bool { + if v == nil { + return rhs == nil + } else if rhs == nil { + return false + } + + return true +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of EmptyPredicateAttributes. +func (v *EmptyPredicateAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { + if v == nil { + return nil + } + return err +} + type EncodingType int32 const ( @@ -43510,6 +43780,488 @@ func (v *PollerInfo) IsSetRatePerSecond() bool { return v != nil && v.RatePerSecond != nil } +type Predicate struct { + PredicateType *PredicateType `json:"predicateType,omitempty"` + UniversalPredicateAttributes *UniversalPredicateAttributes `json:"universalPredicateAttributes,omitempty"` + EmptyPredicateAttributes *EmptyPredicateAttributes `json:"emptyPredicateAttributes,omitempty"` + DomainIDPredicateAttributes *DomainIDPredicateAttributes `json:"domainIDPredicateAttributes,omitempty"` +} + +// ToWire translates a Predicate struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *Predicate) ToWire() (wire.Value, error) { + var ( + fields [4]wire.Field + i int = 0 + w wire.Value + err error + ) + + if v.PredicateType != nil { + w, err = v.PredicateType.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 10, Value: w} + i++ + } + if v.UniversalPredicateAttributes != nil { + w, err = v.UniversalPredicateAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } + if v.EmptyPredicateAttributes != nil { + w, err = v.EmptyPredicateAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 30, Value: w} + i++ + } + if v.DomainIDPredicateAttributes != nil { + w, err = v.DomainIDPredicateAttributes.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 40, Value: w} + i++ + } + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +func _PredicateType_Read(w wire.Value) (PredicateType, error) { + var v PredicateType + err := v.FromWire(w) + return v, err +} + +func _UniversalPredicateAttributes_Read(w wire.Value) (*UniversalPredicateAttributes, error) { + var v UniversalPredicateAttributes + err := v.FromWire(w) + return &v, err +} + +func _EmptyPredicateAttributes_Read(w wire.Value) (*EmptyPredicateAttributes, error) { + var v EmptyPredicateAttributes + err := v.FromWire(w) + return &v, err +} + +func _DomainIDPredicateAttributes_Read(w wire.Value) (*DomainIDPredicateAttributes, error) { + var v DomainIDPredicateAttributes + err := v.FromWire(w) + return &v, err +} + +// FromWire deserializes a Predicate struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a Predicate struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v Predicate +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *Predicate) FromWire(w wire.Value) error { + var err error + + for _, field := range w.GetStruct().Fields { + switch field.ID { + case 10: + if field.Value.Type() == wire.TI32 { + var x PredicateType + x, err = _PredicateType_Read(field.Value) + v.PredicateType = &x + if err != nil { + return err + } + + } + case 20: + if field.Value.Type() == wire.TStruct { + v.UniversalPredicateAttributes, err = _UniversalPredicateAttributes_Read(field.Value) + if err != nil { + return err + } + + } + case 30: + if field.Value.Type() == wire.TStruct { + v.EmptyPredicateAttributes, err = _EmptyPredicateAttributes_Read(field.Value) + if err != nil { + return err + } + + } + case 40: + if field.Value.Type() == wire.TStruct { + v.DomainIDPredicateAttributes, err = _DomainIDPredicateAttributes_Read(field.Value) + if err != nil { + return err + } + + } + } + } + + return nil +} + +// String returns a readable string representation of a Predicate +// struct. +func (v *Predicate) String() string { + if v == nil { + return "" + } + + var fields [4]string + i := 0 + if v.PredicateType != nil { + fields[i] = fmt.Sprintf("PredicateType: %v", *(v.PredicateType)) + i++ + } + if v.UniversalPredicateAttributes != nil { + fields[i] = fmt.Sprintf("UniversalPredicateAttributes: %v", v.UniversalPredicateAttributes) + i++ + } + if v.EmptyPredicateAttributes != nil { + fields[i] = fmt.Sprintf("EmptyPredicateAttributes: %v", v.EmptyPredicateAttributes) + i++ + } + if v.DomainIDPredicateAttributes != nil { + fields[i] = fmt.Sprintf("DomainIDPredicateAttributes: %v", v.DomainIDPredicateAttributes) + i++ + } + + return fmt.Sprintf("Predicate{%v}", strings.Join(fields[:i], ", ")) +} + +func _PredicateType_EqualsPtr(lhs, rhs *PredicateType) bool { + if lhs != nil && rhs != nil { + + x := *lhs + y := *rhs + return x.Equals(y) + } + return lhs == nil && rhs == nil +} + +// Equals returns true if all the fields of this Predicate match the +// provided Predicate. +// +// This function performs a deep comparison. +func (v *Predicate) Equals(rhs *Predicate) bool { + if v == nil { + return rhs == nil + } else if rhs == nil { + return false + } + if !_PredicateType_EqualsPtr(v.PredicateType, rhs.PredicateType) { + return false + } + if !((v.UniversalPredicateAttributes == nil && rhs.UniversalPredicateAttributes == nil) || (v.UniversalPredicateAttributes != nil && rhs.UniversalPredicateAttributes != nil && v.UniversalPredicateAttributes.Equals(rhs.UniversalPredicateAttributes))) { + return false + } + if !((v.EmptyPredicateAttributes == nil && rhs.EmptyPredicateAttributes == nil) || (v.EmptyPredicateAttributes != nil && rhs.EmptyPredicateAttributes != nil && v.EmptyPredicateAttributes.Equals(rhs.EmptyPredicateAttributes))) { + return false + } + if !((v.DomainIDPredicateAttributes == nil && rhs.DomainIDPredicateAttributes == nil) || (v.DomainIDPredicateAttributes != nil && rhs.DomainIDPredicateAttributes != nil && v.DomainIDPredicateAttributes.Equals(rhs.DomainIDPredicateAttributes))) { + return false + } + + return true +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of Predicate. +func (v *Predicate) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { + if v == nil { + return nil + } + if v.PredicateType != nil { + err = multierr.Append(err, enc.AddObject("predicateType", *v.PredicateType)) + } + if v.UniversalPredicateAttributes != nil { + err = multierr.Append(err, enc.AddObject("universalPredicateAttributes", v.UniversalPredicateAttributes)) + } + if v.EmptyPredicateAttributes != nil { + err = multierr.Append(err, enc.AddObject("emptyPredicateAttributes", v.EmptyPredicateAttributes)) + } + if v.DomainIDPredicateAttributes != nil { + err = multierr.Append(err, enc.AddObject("domainIDPredicateAttributes", v.DomainIDPredicateAttributes)) + } + return err +} + +// GetPredicateType returns the value of PredicateType if it is set or its +// zero value if it is unset. +func (v *Predicate) GetPredicateType() (o PredicateType) { + if v != nil && v.PredicateType != nil { + return *v.PredicateType + } + + return +} + +// IsSetPredicateType returns true if PredicateType is not nil. +func (v *Predicate) IsSetPredicateType() bool { + return v != nil && v.PredicateType != nil +} + +// GetUniversalPredicateAttributes returns the value of UniversalPredicateAttributes if it is set or its +// zero value if it is unset. +func (v *Predicate) GetUniversalPredicateAttributes() (o *UniversalPredicateAttributes) { + if v != nil && v.UniversalPredicateAttributes != nil { + return v.UniversalPredicateAttributes + } + + return +} + +// IsSetUniversalPredicateAttributes returns true if UniversalPredicateAttributes is not nil. +func (v *Predicate) IsSetUniversalPredicateAttributes() bool { + return v != nil && v.UniversalPredicateAttributes != nil +} + +// GetEmptyPredicateAttributes returns the value of EmptyPredicateAttributes if it is set or its +// zero value if it is unset. +func (v *Predicate) GetEmptyPredicateAttributes() (o *EmptyPredicateAttributes) { + if v != nil && v.EmptyPredicateAttributes != nil { + return v.EmptyPredicateAttributes + } + + return +} + +// IsSetEmptyPredicateAttributes returns true if EmptyPredicateAttributes is not nil. +func (v *Predicate) IsSetEmptyPredicateAttributes() bool { + return v != nil && v.EmptyPredicateAttributes != nil +} + +// GetDomainIDPredicateAttributes returns the value of DomainIDPredicateAttributes if it is set or its +// zero value if it is unset. +func (v *Predicate) GetDomainIDPredicateAttributes() (o *DomainIDPredicateAttributes) { + if v != nil && v.DomainIDPredicateAttributes != nil { + return v.DomainIDPredicateAttributes + } + + return +} + +// IsSetDomainIDPredicateAttributes returns true if DomainIDPredicateAttributes is not nil. +func (v *Predicate) IsSetDomainIDPredicateAttributes() bool { + return v != nil && v.DomainIDPredicateAttributes != nil +} + +type PredicateType int32 + +const ( + PredicateTypeUniversal PredicateType = 0 + PredicateTypeEmpty PredicateType = 1 + PredicateTypeDomainID PredicateType = 2 +) + +// PredicateType_Values returns all recognized values of PredicateType. +func PredicateType_Values() []PredicateType { + return []PredicateType{ + PredicateTypeUniversal, + PredicateTypeEmpty, + PredicateTypeDomainID, + } +} + +// UnmarshalText tries to decode PredicateType from a byte slice +// containing its name. +// +// var v PredicateType +// err := v.UnmarshalText([]byte("Universal")) +func (v *PredicateType) UnmarshalText(value []byte) error { + switch s := string(value); s { + case "Universal": + *v = PredicateTypeUniversal + return nil + case "Empty": + *v = PredicateTypeEmpty + return nil + case "DomainID": + *v = PredicateTypeDomainID + return nil + default: + val, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return fmt.Errorf("unknown enum value %q for %q: %v", s, "PredicateType", err) + } + *v = PredicateType(val) + return nil + } +} + +// MarshalText encodes PredicateType to text. +// +// If the enum value is recognized, its name is returned. Otherwise, +// its integer value is returned. +// +// This implements the TextMarshaler interface. +func (v PredicateType) MarshalText() ([]byte, error) { + switch int32(v) { + case 0: + return []byte("Universal"), nil + case 1: + return []byte("Empty"), nil + case 2: + return []byte("DomainID"), nil + } + return []byte(strconv.FormatInt(int64(v), 10)), nil +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of PredicateType. +// Enums are logged as objects, where the value is logged with key "value", and +// if this value's name is known, the name is logged with key "name". +func (v PredicateType) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddInt32("value", int32(v)) + switch int32(v) { + case 0: + enc.AddString("name", "Universal") + case 1: + enc.AddString("name", "Empty") + case 2: + enc.AddString("name", "DomainID") + } + return nil +} + +// Ptr returns a pointer to this enum value. +func (v PredicateType) Ptr() *PredicateType { + return &v +} + +// ToWire translates PredicateType into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// Enums are represented as 32-bit integers over the wire. +func (v PredicateType) ToWire() (wire.Value, error) { + return wire.NewValueI32(int32(v)), nil +} + +// FromWire deserializes PredicateType from its Thrift-level +// representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return PredicateType(0), err +// } +// +// var v PredicateType +// if err := v.FromWire(x); err != nil { +// return PredicateType(0), err +// } +// return v, nil +func (v *PredicateType) FromWire(w wire.Value) error { + *v = (PredicateType)(w.GetI32()) + return nil +} + +// String returns a readable string representation of PredicateType. +func (v PredicateType) String() string { + w := int32(v) + switch w { + case 0: + return "Universal" + case 1: + return "Empty" + case 2: + return "DomainID" + } + return fmt.Sprintf("PredicateType(%d)", w) +} + +// Equals returns true if this PredicateType value matches the provided +// value. +func (v PredicateType) Equals(rhs PredicateType) bool { + return v == rhs +} + +// MarshalJSON serializes PredicateType into JSON. +// +// If the enum value is recognized, its name is returned. Otherwise, +// its integer value is returned. +// +// This implements json.Marshaler. +func (v PredicateType) MarshalJSON() ([]byte, error) { + switch int32(v) { + case 0: + return ([]byte)("\"Universal\""), nil + case 1: + return ([]byte)("\"Empty\""), nil + case 2: + return ([]byte)("\"DomainID\""), nil + } + return ([]byte)(strconv.FormatInt(int64(v), 10)), nil +} + +// UnmarshalJSON attempts to decode PredicateType from its JSON +// representation. +// +// This implementation supports both, numeric and string inputs. If a +// string is provided, it must be a known enum name. +// +// This implements json.Unmarshaler. +func (v *PredicateType) UnmarshalJSON(text []byte) error { + d := json.NewDecoder(bytes.NewReader(text)) + d.UseNumber() + t, err := d.Token() + if err != nil { + return err + } + + switch w := t.(type) { + case json.Number: + x, err := w.Int64() + if err != nil { + return err + } + if x > math.MaxInt32 { + return fmt.Errorf("enum overflow from JSON %q for %q", text, "PredicateType") + } + if x < math.MinInt32 { + return fmt.Errorf("enum underflow from JSON %q for %q", text, "PredicateType") + } + *v = (PredicateType)(x) + return nil + case string: + return v.UnmarshalText([]byte(w)) + default: + return fmt.Errorf("invalid JSON value %q (%T) to unmarshal into %q", t, t, "PredicateType") + } +} + type QueryConsistencyLevel int32 const ( @@ -65885,6 +66637,7 @@ type TaskListStatus struct { TaskIDBlock *TaskIDBlock `json:"taskIDBlock,omitempty"` IsolationGroupMetrics map[string]*IsolationGroupMetrics `json:"isolationGroupMetrics,omitempty"` NewTasksPerSecond *float64 `json:"newTasksPerSecond,omitempty"` + Empty *bool `json:"empty,omitempty"` } type _Map_String_IsolationGroupMetrics_MapItemList map[string]*IsolationGroupMetrics @@ -65942,7 +66695,7 @@ func (_Map_String_IsolationGroupMetrics_MapItemList) Close() {} // } func (v *TaskListStatus) ToWire() (wire.Value, error) { var ( - fields [7]wire.Field + fields [8]wire.Field i int = 0 w wire.Value err error @@ -66004,6 +66757,14 @@ func (v *TaskListStatus) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 60, Value: w} i++ } + if v.Empty != nil { + w, err = wire.NewValueBool(*(v.Empty)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 70, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -66135,6 +66896,16 @@ func (v *TaskListStatus) FromWire(w wire.Value) error { return err } + } + case 70: + if field.Value.Type() == wire.TBool { + var x bool + x, err = field.Value.GetBool(), error(nil) + v.Empty = &x + if err != nil { + return err + } + } } } @@ -66149,7 +66920,7 @@ func (v *TaskListStatus) String() string { return "" } - var fields [7]string + var fields [8]string i := 0 if v.BacklogCountHint != nil { fields[i] = fmt.Sprintf("BacklogCountHint: %v", *(v.BacklogCountHint)) @@ -66179,6 +66950,10 @@ func (v *TaskListStatus) String() string { fields[i] = fmt.Sprintf("NewTasksPerSecond: %v", *(v.NewTasksPerSecond)) i++ } + if v.Empty != nil { + fields[i] = fmt.Sprintf("Empty: %v", *(v.Empty)) + i++ + } return fmt.Sprintf("TaskListStatus{%v}", strings.Join(fields[:i], ", ")) } @@ -66231,6 +67006,9 @@ func (v *TaskListStatus) Equals(rhs *TaskListStatus) bool { if !_Double_EqualsPtr(v.NewTasksPerSecond, rhs.NewTasksPerSecond) { return false } + if !_Bool_EqualsPtr(v.Empty, rhs.Empty) { + return false + } return true } @@ -66273,6 +67051,9 @@ func (v *TaskListStatus) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) if v.NewTasksPerSecond != nil { enc.AddFloat64("newTasksPerSecond", *v.NewTasksPerSecond) } + if v.Empty != nil { + enc.AddBool("empty", *v.Empty) + } return err } @@ -66381,6 +67162,21 @@ func (v *TaskListStatus) IsSetNewTasksPerSecond() bool { return v != nil && v.NewTasksPerSecond != nil } +// GetEmpty returns the value of Empty if it is set or its +// zero value if it is unset. +func (v *TaskListStatus) GetEmpty() (o bool) { + if v != nil && v.Empty != nil { + return *v.Empty + } + + return +} + +// IsSetEmpty returns true if Empty is not nil. +func (v *TaskListStatus) IsSetEmpty() bool { + return v != nil && v.Empty != nil +} + type TaskListType int32 const ( @@ -68137,6 +68933,96 @@ func (v *TransientDecisionInfo) IsSetStartedEvent() bool { return v != nil && v.StartedEvent != nil } +type UniversalPredicateAttributes struct { +} + +// ToWire translates a UniversalPredicateAttributes struct into a Thrift-level intermediate +// representation. This intermediate representation may be serialized +// into bytes using a ThriftRW protocol implementation. +// +// An error is returned if the struct or any of its fields failed to +// validate. +// +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } +func (v *UniversalPredicateAttributes) ToWire() (wire.Value, error) { + var ( + fields [0]wire.Field + i int = 0 + ) + + return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil +} + +// FromWire deserializes a UniversalPredicateAttributes struct from its Thrift-level +// representation. The Thrift-level representation may be obtained +// from a ThriftRW protocol implementation. +// +// An error is returned if we were unable to build a UniversalPredicateAttributes struct +// from the provided intermediate representation. +// +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } +// +// var v UniversalPredicateAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil +func (v *UniversalPredicateAttributes) FromWire(w wire.Value) error { + + for _, field := range w.GetStruct().Fields { + switch field.ID { + } + } + + return nil +} + +// String returns a readable string representation of a UniversalPredicateAttributes +// struct. +func (v *UniversalPredicateAttributes) String() string { + if v == nil { + return "" + } + + var fields [0]string + i := 0 + + return fmt.Sprintf("UniversalPredicateAttributes{%v}", strings.Join(fields[:i], ", ")) +} + +// Equals returns true if all the fields of this UniversalPredicateAttributes match the +// provided UniversalPredicateAttributes. +// +// This function performs a deep comparison. +func (v *UniversalPredicateAttributes) Equals(rhs *UniversalPredicateAttributes) bool { + if v == nil { + return rhs == nil + } else if rhs == nil { + return false + } + + return true +} + +// MarshalLogObject implements zapcore.ObjectMarshaler, enabling +// fast logging of UniversalPredicateAttributes. +func (v *UniversalPredicateAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { + if v == nil { + return nil + } + return err +} + type UpdateDomainInfo struct { Description *string `json:"description,omitempty"` OwnerEmail *string `json:"ownerEmail,omitempty"` @@ -70302,6 +71188,7 @@ func (v *VirtualQueueState) IsSetVirtualSliceStates() bool { type VirtualSliceState struct { TaskRange *TaskRange `json:"taskRange,omitempty"` + Predicate *Predicate `json:"predicate,omitempty"` } // ToWire translates a VirtualSliceState struct into a Thrift-level intermediate @@ -70321,7 +71208,7 @@ type VirtualSliceState struct { // } func (v *VirtualSliceState) ToWire() (wire.Value, error) { var ( - fields [1]wire.Field + fields [2]wire.Field i int = 0 w wire.Value err error @@ -70335,6 +71222,14 @@ func (v *VirtualSliceState) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 10, Value: w} i++ } + if v.Predicate != nil { + w, err = v.Predicate.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 20, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -70345,6 +71240,12 @@ func _TaskRange_Read(w wire.Value) (*TaskRange, error) { return &v, err } +func _Predicate_Read(w wire.Value) (*Predicate, error) { + var v Predicate + err := v.FromWire(w) + return &v, err +} + // FromWire deserializes a VirtualSliceState struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. @@ -70374,6 +71275,14 @@ func (v *VirtualSliceState) FromWire(w wire.Value) error { return err } + } + case 20: + if field.Value.Type() == wire.TStruct { + v.Predicate, err = _Predicate_Read(field.Value) + if err != nil { + return err + } + } } } @@ -70388,12 +71297,16 @@ func (v *VirtualSliceState) String() string { return "" } - var fields [1]string + var fields [2]string i := 0 if v.TaskRange != nil { fields[i] = fmt.Sprintf("TaskRange: %v", v.TaskRange) i++ } + if v.Predicate != nil { + fields[i] = fmt.Sprintf("Predicate: %v", v.Predicate) + i++ + } return fmt.Sprintf("VirtualSliceState{%v}", strings.Join(fields[:i], ", ")) } @@ -70411,6 +71324,9 @@ func (v *VirtualSliceState) Equals(rhs *VirtualSliceState) bool { if !((v.TaskRange == nil && rhs.TaskRange == nil) || (v.TaskRange != nil && rhs.TaskRange != nil && v.TaskRange.Equals(rhs.TaskRange))) { return false } + if !((v.Predicate == nil && rhs.Predicate == nil) || (v.Predicate != nil && rhs.Predicate != nil && v.Predicate.Equals(rhs.Predicate))) { + return false + } return true } @@ -70424,6 +71340,9 @@ func (v *VirtualSliceState) MarshalLogObject(enc zapcore.ObjectEncoder) (err err if v.TaskRange != nil { err = multierr.Append(err, enc.AddObject("taskRange", v.TaskRange)) } + if v.Predicate != nil { + err = multierr.Append(err, enc.AddObject("predicate", v.Predicate)) + } return err } @@ -70442,6 +71361,21 @@ func (v *VirtualSliceState) IsSetTaskRange() bool { return v != nil && v.TaskRange != nil } +// GetPredicate returns the value of Predicate if it is set or its +// zero value if it is unset. +func (v *VirtualSliceState) GetPredicate() (o *Predicate) { + if v != nil && v.Predicate != nil { + return v.Predicate + } + + return +} + +// IsSetPredicate returns true if Predicate is not nil. +func (v *VirtualSliceState) IsSetPredicate() bool { + return v != nil && v.Predicate != nil +} + type WorkerVersionInfo struct { Impl *string `json:"impl,omitempty"` FeatureVersion *string `json:"featureVersion,omitempty"` @@ -77367,8 +78301,8 @@ var ThriftModule = &thriftreflect.ThriftModule{ Name: "shared", Package: "go.uber.org/cadence/.gen/go/shared", FilePath: "shared.thrift", - SHA1: "6fef7aa6070aa7ef099f69b53f2741a379aafcb8", + SHA1: "1af42fe82b4a68e489310d22d647e09fc33ee48c", Raw: rawIDL, } -const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception InternalDataInconsistencyError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception WorkflowExecutionAlreadyCompletedError {\n 1: required string message\n}\n\nexception EntityNotExistsError {\n 1: required string message\n 2: optional string currentCluster\n 3: optional string activeCluster\n // activeClusters is a list of active clusters for active-active domain\n 4: required list activeClusters\n}\n\nexception ServiceBusyError {\n 1: required string message\n 2: optional string reason\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nexception DomainNotActiveError {\n 1: required string message\n 2: required string domainName\n 3: required string currentCluster\n 4: required string activeCluster\n // activeClusters is a list of active clusters for active-active domain\n 5: required list activeClusters\n}\n\nexception LimitExceededError {\n 1: required string message\n}\n\nexception AccessDeniedError {\n 1: required string message\n}\n\nexception RetryTaskV2Error {\n 1: required string message\n 2: optional string domainId\n 3: optional string workflowId\n 4: optional string runId\n 5: optional i64 (js.type = \"Long\") startEventId\n 6: optional i64 (js.type = \"Long\") startEventVersion\n 7: optional i64 (js.type = \"Long\") endEventId\n 8: optional i64 (js.type = \"Long\") endEventVersion\n}\n\nexception ClientVersionNotSupportedError {\n 1: required string featureVersion\n 2: required string clientImpl\n 3: required string supportedVersions\n}\n\nexception FeatureNotEnabledError {\n 1: required string featureFlag\n}\n\nexception CurrentBranchChangedError {\n 10: required string message\n 20: required binary currentBranchToken\n}\n\nexception RemoteSyncMatchedError {\n 10: required string message\n}\n\nexception StickyWorkerUnavailableError {\n 1: required string message\n}\n\nexception TaskListNotOwnedByHostError {\n 1: required string ownedByIdentity\n 2: required string myIdentity\n 3: required string tasklistName\n}\n\nenum WorkflowIdReusePolicy {\n /*\n * allow start a workflow execution using the same workflow ID,\n * when workflow not running, and the last execution close state is in\n * [terminated, cancelled, timeouted, failed].\n */\n AllowDuplicateFailedOnly,\n /*\n * allow start a workflow execution using the same workflow ID,\n * when workflow not running.\n */\n AllowDuplicate,\n /*\n * do not allow start a workflow execution using the same workflow ID at all\n */\n RejectDuplicate,\n /*\n * if a workflow is running using the same workflow ID, terminate it and start a new one\n */\n TerminateIfRunning,\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum ParentClosePolicy {\n\tABANDON,\n\tREQUEST_CANCEL,\n\tTERMINATE,\n}\n\n\n// whenever this list of decision is changed\n// do change the mutableStateBuilder.go\n// function shouldBufferEvent\n// to make sure wo do the correct event ordering\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n SignalExternalWorkflowExecution,\n UpsertWorkflowSearchAttributes,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n SignalExternalWorkflowExecutionInitiated,\n SignalExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionSignaled,\n UpsertWorkflowSearchAttributes,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE,\n BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_START_CHILD_EXECUTION_ATTRIBUTES,\n FORCE_CLOSE_DECISION,\n FAILOVER_CLOSE_DECISION,\n BAD_SIGNAL_INPUT_SIZE,\n RESET_WORKFLOW,\n BAD_BINARY,\n SCHEDULE_ACTIVITY_DUPLICATE_ID,\n BAD_SEARCH_ATTRIBUTES,\n}\n\nenum DecisionTaskTimedOutCause {\n TIMEOUT,\n RESET,\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum SignalExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\n// TODO: when migrating to gRPC, add a running / none status,\n// currently, customer is using null / nil as an indication\n// that workflow is still running\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nenum QueryResultType {\n ANSWERED,\n FAILED,\n}\n\nenum PendingActivityState {\n SCHEDULED,\n STARTED,\n CANCEL_REQUESTED,\n}\n\nenum PendingDecisionState {\n SCHEDULED,\n STARTED,\n}\n\nenum HistoryEventFilterType {\n ALL_EVENT,\n CLOSE_EVENT,\n}\n\nenum TaskListKind {\n NORMAL,\n STICKY,\n EPHEMERAL,\n}\n\nenum ArchivalStatus {\n DISABLED,\n ENABLED,\n}\n\nenum CronOverlapPolicy {\n SKIPPED,\n BUFFERONE,\n}\n\nenum IndexedValueType {\n STRING,\n KEYWORD,\n INT,\n DOUBLE,\n BOOL,\n DATETIME,\n}\n\nstruct Header {\n 10: optional map fields\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n 20: optional TaskListKind kind\n}\n\nenum EncodingType {\n ThriftRW,\n JSON,\n}\n\nenum QueryRejectCondition {\n // NOT_OPEN indicates that query should be rejected if workflow is not open\n NOT_OPEN\n // NOT_COMPLETED_CLEANLY indicates that query should be rejected if workflow did not complete cleanly\n NOT_COMPLETED_CLEANLY\n}\n\nenum QueryConsistencyLevel {\n // EVENTUAL indicates that query should be eventually consistent\n EVENTUAL\n // STRONG indicates that any events that came before query should be reflected in workflow state before running query\n STRONG\n}\n\nstruct DataBlob {\n 10: optional EncodingType EncodingType\n 20: optional binary Data\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct Memo {\n 10: optional map fields\n}\n\nstruct SearchAttributes {\n 10: optional map indexedFields\n}\n\nstruct WorkerVersionInfo {\n 10: optional string impl\n 20: optional string featureVersion\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n 70: optional string parentDomainId\n 71: optional string parentDomainName\n 72: optional i64 parentInitatedId\n 80: optional WorkflowExecution parentExecution\n 90: optional i64 (js.type = \"Long\") executionTime\n 100: optional Memo memo\n 101: optional SearchAttributes searchAttributes\n 110: optional ResetPoints autoResetPoints\n 120: optional string taskList\n 121: optional TaskList taskListInfo\n 130: optional bool isCron\n 140: optional i64 (js.type = \"Long\") updateTime\n 150: optional map partitionConfig\n 160: optional CronOverlapPolicy cronOverlapPolicy\n 170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n// 40: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 70: optional RetryPolicy retryPolicy\n 80: optional Header header\n 90: optional bool requestLocalDispatch\n}\n\nstruct ActivityLocalDispatchInfo{\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") scheduledTimestamp\n 30: optional i64 (js.type = \"Long\") startedTimestamp\n 40: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n 50: optional binary taskToken\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n 50: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional string signalName\n 40: optional binary input\n 50: optional binary control\n 60: optional bool childWorkflowOnly\n}\n\nstruct UpsertWorkflowSearchAttributesDecisionAttributes {\n 10: optional SearchAttributes searchAttributes\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional Header header\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional i32 backoffStartIntervalInSeconds\n 70: optional RetryPolicy retryPolicy\n 80: optional ContinueAsNewInitiator initiator\n 90: optional string failureReason\n 100: optional binary failureDetails\n 110: optional binary lastCompletionResult\n 120: optional string cronSchedule\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n 160: optional i32 jitterStartSeconds\n 170: optional CronOverlapPolicy cronOverlapPolicy\n 180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n// 80: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 81: optional ParentClosePolicy parentClosePolicy\n 90: optional binary control\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 110: optional RetryPolicy retryPolicy\n 120: optional string cronSchedule\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n 160: optional CronOverlapPolicy cronOverlapPolicy\n 170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n 110: optional SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes\n 120: optional UpsertWorkflowSearchAttributesDecisionAttributes upsertWorkflowSearchAttributesDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 12: optional string parentWorkflowDomain\n 14: optional WorkflowExecution parentWorkflowExecution\n 16: optional i64 (js.type = \"Long\") parentInitiatedEventId\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n// 52: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 54: optional string continuedExecutionRunId\n 55: optional ContinueAsNewInitiator initiator\n 56: optional string continuedFailureReason\n 57: optional binary continuedFailureDetails\n 58: optional binary lastCompletionResult\n 59: optional string originalExecutionRunId // This is the runID when the WorkflowExecutionStarted event is written\n 60: optional string identity\n 61: optional string firstExecutionRunId // This is the very first runID along the chain of ContinueAsNew and Reset.\n 62: optional i64 (js.type = \"Long\") firstScheduledTimeNano\n 70: optional RetryPolicy retryPolicy\n 80: optional i32 attempt\n 90: optional i64 (js.type = \"Long\") expirationTimestamp\n 100: optional string cronSchedule\n 110: optional i32 firstDecisionTaskBackoffSeconds\n 120: optional Memo memo\n 121: optional SearchAttributes searchAttributes\n 130: optional ResetPoints prevAutoResetPoints\n 140: optional Header header\n 150: optional map partitionConfig\n 160: optional string requestId\n 170: optional CronOverlapPolicy cronOverlapPolicy\n 180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct ResetPoints{\n 10: optional list points\n}\n\n struct ResetPointInfo{\n 10: optional string binaryChecksum\n 20: optional string runId\n 30: optional i64 firstDecisionCompletedId\n 40: optional i64 (js.type = \"Long\") createdTimeNano\n 50: optional i64 (js.type = \"Long\") expiringTimeNano //the time that the run is deleted due to retention\n 60: optional bool resettable // false if the resset point has pending childWFs/reqCancels/signalExternals.\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nenum ContinueAsNewInitiator {\n Decider,\n RetryPolicy,\n CronSchedule,\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 80: optional i32 backoffStartIntervalInSeconds\n 90: optional ContinueAsNewInitiator initiator\n 100: optional string failureReason\n 110: optional binary failureDetails\n 120: optional binary lastCompletionResult\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n 50: optional string binaryChecksum\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n // for reset workflow\n 40: optional string baseRunId\n 50: optional string newRunId\n 60: optional i64 (js.type = \"Long\") forkEventVersion\n 70: optional string reason\n 80: optional DecisionTaskTimedOutCause cause\n 90: optional string requestId\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n 50: optional string reason\n // for reset workflow\n 60: optional string baseRunId\n 70: optional string newRunId\n 80: optional i64 (js.type = \"Long\") forkEventVersion\n 90: optional string binaryChecksum\n 100: optional string requestId\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 110: optional RetryPolicy retryPolicy\n 120: optional Header header\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n 40: optional i32 attempt\n 50: optional string lastFailureReason\n 60: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n // For retry activity, it may have a failure before timeout. It's important to keep those information for debug.\n // Client can also provide the info for making next decision\n 40: optional string lastFailureReason\n 50: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n 50: optional string requestId\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional Header header\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n 50: optional bool childWorkflowOnly\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct SignalExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional string signalName\n 50: optional binary input\n 60: optional binary control\n 70: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionFailedEventAttributes {\n 10: optional SignalExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionSignaledEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct UpsertWorkflowSearchAttributesEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional SearchAttributes searchAttributes\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n// 80: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 81: optional ParentClosePolicy parentClosePolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 110: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 120: optional RetryPolicy retryPolicy\n 130: optional string cronSchedule\n 140: optional Header header\n 150: optional Memo memo\n 160: optional SearchAttributes searchAttributes\n 170: optional i32 delayStartSeconds\n 180: optional i32 jitterStartSeconds\n 190: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 200: optional CronOverlapPolicy cronOverlapPolicy\n 210: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional Header header\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 35: optional i64 (js.type = \"Long\") version\n 36: optional i64 (js.type = \"Long\") taskId\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n 420: optional SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes\n 430: optional SignalExternalWorkflowExecutionFailedEventAttributes signalExternalWorkflowExecutionFailedEventAttributes\n 440: optional ExternalWorkflowExecutionSignaledEventAttributes externalWorkflowExecutionSignaledEventAttributes\n 450: optional UpsertWorkflowSearchAttributesEventAttributes upsertWorkflowSearchAttributesEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n // A key-value map for any customized purpose\n 50: optional map data\n 60: optional string uuid\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n 60: optional IsolationGroupConfiguration isolationgroups\n 70: optional BadBinaries badBinaries\n 80: optional ArchivalStatus historyArchivalStatus\n 90: optional string historyArchivalURI\n 100: optional ArchivalStatus visibilityArchivalStatus\n 110: optional string visibilityArchivalURI\n 120: optional AsyncWorkflowConfiguration AsyncWorkflowConfiguration\n}\n\nstruct FailoverInfo {\n 10: optional i64 (js.type = \"Long\") failoverVersion\n 20: optional i64 (js.type = \"Long\") failoverStartTimestamp\n 30: optional i64 (js.type = \"Long\") failoverExpireTimestamp\n 40: optional i32 completedShardCount\n 50: optional list pendingShards\n}\n\nstruct BadBinaries{\n 10: optional map binaries\n}\n\nstruct BadBinaryInfo{\n 10: optional string reason\n 20: optional string operator\n 30: optional i64 (js.type = \"Long\") createdTimeNano\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n // A key-value map for any customized purpose\n 30: optional map data\n}\n\nstruct ClusterReplicationConfiguration {\n 10: optional string clusterName\n}\n\nstruct DomainReplicationConfiguration {\n // activeClusterName is the name of the active cluster for active-passive domain\n 10: optional string activeClusterName\n\n // clusters is list of all active and passive clusters of domain\n 20: optional list clusters\n\n // activeClusters contains active cluster(s) information for active-active domain\n 30: optional ActiveClusters activeClusters\n}\n\nstruct ActiveClusters {\n // activeClustersByRegion is a map of region name to active cluster info for active-active domain\n 10: optional map activeClustersByRegion\n}\n\n// ActiveClusterInfo contains the configuration of active-active domain's active cluster & failover version for a specific region\nstruct ActiveClusterInfo {\n 10: optional string activeClusterName\n 20: optional i64 (js.type = \"Long\") failoverVersion\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric = true\n 60: optional list clusters\n 70: optional string activeClusterName\n // activeClusters is a map of region name to active cluster name for active-active domain\n 75: optional map activeClustersByRegion\n // A key-value map for any customized purpose\n 80: optional map data\n 90: optional string securityToken\n 120: optional bool isGlobalDomain\n 130: optional ArchivalStatus historyArchivalStatus\n 140: optional string historyArchivalURI\n 150: optional ArchivalStatus visibilityArchivalStatus\n 160: optional string visibilityArchivalURI\n}\n\nstruct ListDomainsRequest {\n 10: optional i32 pageSize\n 20: optional binary nextPageToken\n}\n\nstruct ListDomainsResponse {\n 10: optional list domains\n 20: optional binary nextPageToken\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n 20: optional string uuid\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n 30: optional DomainReplicationConfiguration replicationConfiguration\n 40: optional i64 (js.type = \"Long\") failoverVersion\n 50: optional bool isGlobalDomain\n 60: optional FailoverInfo failoverInfo\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n 40: optional DomainReplicationConfiguration replicationConfiguration\n 50: optional string securityToken\n 60: optional string deleteBadBinary\n 70: optional i32 failoverTimeoutInSeconds\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n 30: optional DomainReplicationConfiguration replicationConfiguration\n 40: optional i64 (js.type = \"Long\") failoverVersion\n 50: optional bool isGlobalDomain\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct DeleteDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n// 110: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 120: optional RetryPolicy retryPolicy\n 130: optional string cronSchedule\n 140: optional Memo memo\n 141: optional SearchAttributes searchAttributes\n 150: optional Header header\n 160: optional i32 delayStartSeconds\n 170: optional i32 jitterStartSeconds\n 180: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 190: optional CronOverlapPolicy cronOverlapPolicy\n 200: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct StartWorkflowExecutionAsyncRequest {\n 10: optional StartWorkflowExecutionRequest request\n}\n\nstruct StartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct DiagnoseWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n}\n\nstruct DiagnoseWorkflowExecutionResponse {\n 10: optional string domain\n 20: optional WorkflowExecution diagnosticWorkflowExecution\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional string binaryChecksum\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 51: optional i64 (js.type = 'Long') attempt\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n 90: optional TaskList WorkflowExecutionTaskList\n 100: optional i64 (js.type = \"Long\") scheduledTimestamp\n 110: optional i64 (js.type = \"Long\") startedTimestamp\n 120: optional map queries\n 130: optional i64 (js.type = 'Long') nextEventId\n 140: optional i64 (js.type = 'Long') totalHistoryBytes\n 150: optional AutoConfigHint autoConfigHint\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n 60: optional bool returnNewDecisionTask\n 70: optional bool forceCreateNewDecisionTask\n 80: optional string binaryChecksum\n 90: optional map queryResults\n}\n\nstruct RespondDecisionTaskCompletedResponse {\n 10: optional PollForDecisionTaskResponse decisionTask\n 20: optional map activitiesToDispatchLocally\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n 50: optional string binaryChecksum\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n 120: optional i32 attempt\n 130: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n 140: optional binary heartbeatDetails\n 150: optional WorkflowType workflowType\n 160: optional string workflowDomain\n 170: optional Header header\n 180: optional AutoConfigHint autoConfigHint\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n 50: optional string cause\n 60: optional string firstExecutionRunID\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n 60: optional HistoryEventFilterType HistoryEventFilterType\n 70: optional bool skipArchival\n 80: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 11: optional list rawHistory\n 20: optional binary nextPageToken\n 30: optional bool archived\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n 60: optional string requestId\n 70: optional binary control\n}\n\nstruct SignalWithStartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 110: optional string signalName\n 120: optional binary signalInput\n 130: optional binary control\n 140: optional RetryPolicy retryPolicy\n 150: optional string cronSchedule\n 160: optional Memo memo\n 161: optional SearchAttributes searchAttributes\n 170: optional Header header\n 180: optional i32 delayStartSeconds\n 190: optional i32 jitterStartSeconds\n 200: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 210: optional CronOverlapPolicy cronOverlapPolicy\n 220: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncRequest {\n 10: optional SignalWithStartWorkflowExecutionRequest request\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional string identity\n}\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n 60: optional string firstExecutionRunID\n}\n\nstruct ResetWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional i64 (js.type = \"Long\") decisionFinishEventId\n 50: optional string requestId\n 60: optional bool skipSignalReapply\n}\n\nstruct ResetWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 pageSize\n 30: optional binary nextPageToken\n 40: optional string query\n}\n\nstruct ListWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListArchivedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 pageSize\n 30: optional binary nextPageToken\n 40: optional string query\n}\n\nstruct ListArchivedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct CountWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional string query\n}\n\nstruct CountWorkflowExecutionsResponse {\n 10: optional i64 count\n}\n\nstruct GetSearchAttributesResponse {\n 10: optional map keys\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n // QueryRejectCondition can used to reject the query if workflow state does not satisify condition\n 40: optional QueryRejectCondition queryRejectCondition\n 50: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct QueryRejected {\n 10: optional WorkflowExecutionCloseStatus closeStatus\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n 20: optional QueryRejected queryRejected\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct ResetStickyTaskListRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct ResetStickyTaskListResponse {\n // The reason to keep this response is to allow returning\n // information in the future.\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n 50: optional WorkerVersionInfo workerVersionInfo\n}\n\nstruct WorkflowQueryResult {\n 10: optional QueryResultType resultType\n 20: optional binary answer\n 30: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct PendingActivityInfo {\n 10: optional string activityID\n 20: optional ActivityType activityType\n 30: optional PendingActivityState state\n 40: optional binary heartbeatDetails\n 50: optional i64 (js.type = \"Long\") lastHeartbeatTimestamp\n 60: optional i64 (js.type = \"Long\") lastStartedTimestamp\n 70: optional i32 attempt\n 80: optional i32 maximumAttempts\n 90: optional i64 (js.type = \"Long\") scheduledTimestamp\n 100: optional i64 (js.type = \"Long\") expirationTimestamp\n 110: optional string lastFailureReason\n 120: optional string lastWorkerIdentity\n 130: optional binary lastFailureDetails\n 140: optional string startedWorkerIdentity\n 150: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingDecisionInfo {\n 10: optional PendingDecisionState state\n 20: optional i64 (js.type = \"Long\") scheduledTimestamp\n 30: optional i64 (js.type = \"Long\") startedTimestamp\n 40: optional i64 attempt\n 50: optional i64 (js.type = \"Long\") originalScheduledTimestamp\n 60: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingChildExecutionInfo {\n 1: optional string domain\n 10: optional string workflowID\n 20: optional string runID\n 30: optional string workflowTypName\n 40: optional i64 (js.type = \"Long\") initiatedID\n 50: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n 30: optional list pendingActivities\n 40: optional list pendingChildren\n 50: optional PendingDecisionInfo pendingDecision\n}\n\nstruct DescribeTaskListRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional TaskListType taskListType\n 40: optional bool includeTaskListStatus\n}\n\nstruct DescribeTaskListResponse {\n 10: optional list pollers\n 20: optional TaskListStatus taskListStatus\n // The TaskList being described\n 30: optional TaskList taskList\n}\n\nstruct GetTaskListsByDomainRequest {\n 10: optional string domainName\n}\n\nstruct GetTaskListsByDomainResponse {\n 10: optional map decisionTaskListMap\n 20: optional map activityTaskListMap\n}\n\nstruct ListTaskListPartitionsRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n}\n\nstruct TaskListPartitionMetadata {\n 10: optional string key\n 20: optional string ownerHostName\n}\n\nstruct ListTaskListPartitionsResponse {\n 10: optional list activityTaskListPartitions\n 20: optional list decisionTaskListPartitions\n}\n\nstruct IsolationGroupMetrics {\n 10: optional double newTasksPerSecond\n 20: optional i64 (js.type = \"Long\") pollerCount\n}\n\nstruct TaskListStatus {\n 10: optional i64 (js.type = \"Long\") backlogCountHint\n 20: optional i64 (js.type = \"Long\") readLevel\n 30: optional i64 (js.type = \"Long\") ackLevel\n 35: optional double ratePerSecond\n 40: optional TaskIDBlock taskIDBlock\n 50: optional map isolationGroupMetrics\n 60: optional double newTasksPerSecond\n}\n\nstruct TaskIDBlock {\n 10: optional i64 (js.type = \"Long\") startID\n 20: optional i64 (js.type = \"Long\") endID\n}\n\n//At least one of the parameters needs to be provided\nstruct DescribeHistoryHostRequest {\n 10: optional string hostAddress //ip:port\n 20: optional i32 shardIdForHost\n 30: optional WorkflowExecution executionForHost\n}\n\nstruct RemoveTaskRequest {\n 10: optional i32 shardID\n 20: optional i32 type\n 30: optional i64 (js.type = \"Long\") taskID\n 40: optional i64 (js.type = \"Long\") visibilityTimestamp\n 50: optional string clusterName\n}\n\nstruct CloseShardRequest {\n 10: optional i32 shardID\n}\n\nstruct ResetQueueRequest {\n 10: optional i32 shardID\n 20: optional string clusterName\n 30: optional i32 type\n}\n\nstruct DescribeQueueRequest {\n 10: optional i32 shardID\n 20: optional string clusterName\n 30: optional i32 type\n}\n\nstruct DescribeQueueResponse {\n 10: optional list processingQueueStates\n}\n\nstruct DescribeShardDistributionRequest {\n 10: optional i32 pageSize\n 20: optional i32 pageID\n}\n\nstruct DescribeShardDistributionResponse {\n 10: optional i32 numberOfShards\n\n // ShardID to Address (ip:port) map\n 20: optional map shards\n}\n\nstruct DescribeHistoryHostResponse{\n 10: optional i32 numberOfShards\n 20: optional list shardIDs\n 30: optional DomainCacheInfo domainCache\n 40: optional string shardControllerStatus\n 50: optional string address\n}\n\nstruct DomainCacheInfo{\n 10: optional i64 numOfItemsInCacheByID\n 20: optional i64 numOfItemsInCacheByName\n}\n\nenum TaskListType {\n /*\n * Decision type of tasklist\n */\n Decision,\n /*\n * Activity type of tasklist\n */\n Activity,\n}\n\nstruct PollerInfo {\n // Unix Nano\n 10: optional i64 (js.type = \"Long\") lastAccessTime\n 20: optional string identity\n 30: optional double ratePerSecond\n}\n\nstruct RetryPolicy {\n // Interval of the first retry. If coefficient is 1.0 then it is used for all retries.\n 10: optional i32 initialIntervalInSeconds\n\n // Coefficient used to calculate the next retry interval.\n // The next retry interval is previous interval multiplied by the coefficient.\n // Must be 1 or larger.\n 20: optional double backoffCoefficient\n\n // Maximum interval between retries. Exponential backoff leads to interval increase.\n // This value is the cap of the increase. Default is 100x of initial interval.\n 30: optional i32 maximumIntervalInSeconds\n\n // Maximum number of attempts. When exceeded the retries stop even if not expired yet.\n // Must be 1 or bigger. Default is unlimited.\n 40: optional i32 maximumAttempts\n\n // Non-Retriable errors. Will stop retrying if error matches this list.\n 50: optional list nonRetriableErrorReasons\n\n // Expiration time for the whole retry process.\n 60: optional i32 expirationIntervalInSeconds\n}\n\n// HistoryBranchRange represents a piece of range for a branch.\nstruct HistoryBranchRange{\n // branchID of original branch forked from\n 10: optional string branchID\n // beinning node for the range, inclusive\n 20: optional i64 beginNodeID\n // ending node for the range, exclusive\n 30: optional i64 endNodeID\n}\n\n// For history persistence to serialize/deserialize branch details\nstruct HistoryBranch{\n 10: optional string treeID\n 20: optional string branchID\n 30: optional list ancestors\n}\n\n// VersionHistoryItem contains signal eventID and the corresponding version\nstruct VersionHistoryItem{\n 10: optional i64 (js.type = \"Long\") eventID\n 20: optional i64 (js.type = \"Long\") version\n}\n\n// VersionHistory contains the version history of a branch\nstruct VersionHistory{\n 10: optional binary branchToken\n 20: optional list items\n}\n\n// VersionHistories contains all version histories from all branches\nstruct VersionHistories{\n 10: optional i32 currentVersionHistoryIndex\n 20: optional list histories\n}\n\n// ReapplyEventsRequest is the request for reapply events API\nstruct ReapplyEventsRequest{\n 10: optional string domainName\n 20: optional WorkflowExecution workflowExecution\n 30: optional DataBlob events\n}\n\n// SupportedClientVersions contains the support versions for client library\nstruct SupportedClientVersions{\n 10: optional string goSdk\n 20: optional string javaSdk\n}\n\n// ClusterInfo contains information about cadence cluster\nstruct ClusterInfo{\n 10: optional SupportedClientVersions supportedClientVersions\n}\n\nstruct RefreshWorkflowTasksRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct FeatureFlags {\n\t10: optional bool WorkflowExecutionAlreadyCompletedErrorEnabled\n}\n\nenum CrossClusterTaskType {\n StartChildExecution\n CancelExecution\n SignalExecution\n RecordChildWorkflowExecutionComplete\n ApplyParentClosePolicy\n}\n\nenum CrossClusterTaskFailedCause {\n DOMAIN_NOT_ACTIVE\n DOMAIN_NOT_EXISTS\n WORKFLOW_ALREADY_RUNNING\n WORKFLOW_NOT_EXISTS\n WORKFLOW_ALREADY_COMPLETED\n UNCATEGORIZED\n}\n\nenum GetTaskFailedCause {\n SERVICE_BUSY\n TIMEOUT\n SHARD_OWNERSHIP_LOST\n UNCATEGORIZED\n}\n\nstruct CrossClusterTaskInfo {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional CrossClusterTaskType taskType\n 50: optional i16 taskState\n 60: optional i64 (js.type = \"Long\") taskID\n 70: optional i64 (js.type = \"Long\") visibilityTimestamp\n}\n\nstruct CrossClusterStartChildExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string requestID\n 30: optional i64 (js.type = \"Long\") initiatedEventID\n 40: optional StartChildWorkflowExecutionInitiatedEventAttributes initiatedEventAttributes\n // targetRunID is for scheduling first decision task\n // targetWorkflowID is available in initiatedEventAttributes\n 50: optional string targetRunID\n 60: optional map partitionConfig\n}\n\nstruct CrossClusterStartChildExecutionResponseAttributes {\n 10: optional string runID\n}\n\nstruct CrossClusterCancelExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional string requestID\n 50: optional i64 (js.type = \"Long\") initiatedEventID\n 60: optional bool childWorkflowOnly\n}\n\nstruct CrossClusterCancelExecutionResponseAttributes {\n}\n\nstruct CrossClusterSignalExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional string requestID\n 50: optional i64 (js.type = \"Long\") initiatedEventID\n 60: optional bool childWorkflowOnly\n 70: optional string signalName\n 80: optional binary signalInput\n 90: optional binary control\n}\n\nstruct CrossClusterSignalExecutionResponseAttributes {\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional i64 (js.type = \"Long\") initiatedEventID\n 50: optional HistoryEvent completionEvent\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes {\n}\n\nstruct ApplyParentClosePolicyAttributes {\n 10: optional string childDomainID\n 20: optional string childWorkflowID\n 30: optional string childRunID\n 40: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct ApplyParentClosePolicyStatus {\n 10: optional bool completed\n 20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct ApplyParentClosePolicyRequest {\n 10: optional ApplyParentClosePolicyAttributes child\n 20: optional ApplyParentClosePolicyStatus status\n}\n\nstruct CrossClusterApplyParentClosePolicyRequestAttributes {\n 10: optional list children\n}\n\nstruct ApplyParentClosePolicyResult {\n 10: optional ApplyParentClosePolicyAttributes child\n 20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct CrossClusterApplyParentClosePolicyResponseAttributes {\n 10: optional list childrenStatus\n}\n\nstruct CrossClusterTaskRequest {\n 10: optional CrossClusterTaskInfo taskInfo\n 20: optional CrossClusterStartChildExecutionRequestAttributes startChildExecutionAttributes\n 30: optional CrossClusterCancelExecutionRequestAttributes cancelExecutionAttributes\n 40: optional CrossClusterSignalExecutionRequestAttributes signalExecutionAttributes\n 50: optional CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes recordChildWorkflowExecutionCompleteAttributes\n 60: optional CrossClusterApplyParentClosePolicyRequestAttributes applyParentClosePolicyAttributes\n}\n\nstruct CrossClusterTaskResponse {\n 10: optional i64 (js.type = \"Long\") taskID\n 20: optional CrossClusterTaskType taskType\n 30: optional i16 taskState\n 40: optional CrossClusterTaskFailedCause failedCause\n 50: optional CrossClusterStartChildExecutionResponseAttributes startChildExecutionAttributes\n 60: optional CrossClusterCancelExecutionResponseAttributes cancelExecutionAttributes\n 70: optional CrossClusterSignalExecutionResponseAttributes signalExecutionAttributes\n 80: optional CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes recordChildWorkflowExecutionCompleteAttributes\n 90: optional CrossClusterApplyParentClosePolicyResponseAttributes applyParentClosePolicyAttributes\n}\n\nstruct GetCrossClusterTasksRequest {\n 10: optional list shardIDs\n 20: optional string targetCluster\n}\n\nstruct GetCrossClusterTasksResponse {\n 10: optional map> tasksByShard\n 20: optional map failedCauseByShard\n}\n\nstruct RespondCrossClusterTasksCompletedRequest {\n 10: optional i32 shardID\n 20: optional string targetCluster\n 30: optional list taskResponses\n 40: optional bool fetchNewTasks\n}\n\nstruct RespondCrossClusterTasksCompletedResponse {\n 10: optional list tasks\n}\n\nenum IsolationGroupState {\n INVALID,\n HEALTHY,\n DRAINED,\n}\n\nstruct IsolationGroupPartition {\n 10: optional string name\n 20: optional IsolationGroupState state\n}\n\nstruct IsolationGroupConfiguration {\n 10: optional list isolationGroups\n}\n\nstruct AsyncWorkflowConfiguration {\n 10: optional bool enabled\n // PredefinedQueueName is the name of the predefined queue in cadence server config's asyncWorkflowQueues\n 20: optional string predefinedQueueName\n // queueType is the type of the queue if predefined_queue_name is not used\n 30: optional string queueType\n // queueConfig is the configuration for the queue if predefined_queue_name is not used\n 40: optional DataBlob queueConfig\n}\n\n/**\n* Any is a logical duplicate of google.protobuf.Any.\n*\n* The intent of the type is the same, but it is not intended to be directly\n* compatible with google.protobuf.Any or any Thrift equivalent - this blob is\n* RPC-type agnostic by design (as the underlying data may be transported over\n* proto or thrift), and the data-bytes may be in any encoding.\n*\n* This is intentionally different from DataBlob, which supports only a handful\n* of known encodings so it can be interpreted everywhere. Any supports literally\n* any contents, and needs to be considered opaque until it is given to something\n* that is expecting it.\n*\n* See ValueType to interpret the contents.\n**/\nstruct Any {\n // Type-string describing value's contents, and intentionally avoiding the\n // name \"type\" as it is often a special term.\n // This should usually be a hard-coded string of some kind.\n 10: optional string ValueType\n // Arbitrarily-encoded bytes, to be deserialized by a runtime implementation.\n // The contents are described by ValueType.\n 20: optional binary Value\n}\n\nstruct AutoConfigHint {\n 10: optional bool enableAutoConfig\n 20: optional i64 pollerWaitTimeInMs\n}\n\nstruct QueueState {\n 10: optional map virtualQueueStates\n 20: optional TaskKey exclusiveMaxReadLevel\n}\n\nstruct VirtualQueueState {\n 10: optional list virtualSliceStates\n}\n\nstruct VirtualSliceState {\n 10: optional TaskRange taskRange\n}\n\nstruct TaskRange {\n 10: optional TaskKey inclusiveMin\n 20: optional TaskKey exclusiveMax\n}\n\nstruct TaskKey {\n 10: optional i64 scheduledTimeNano\n 20: optional i64 taskID\n}\n\nstruct ActiveClusterSelectionPolicy {\n 10: optional ActiveClusterSelectionStrategy strategy\n\n // sticky_region is the region sticky if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_REGION_STICKY\n // This is the default strategy for active-active domains and region would be set to receiver cluster's region if not specified.\n 20: optional string stickyRegion\n\n // external_entity_type/external_entity_key is the type/key of the external entity if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_EXTERNAL_ENTITY\n // external entity type must be one of the supported types in active cluster manager. Custom ones can be added by implementing the corresponding interface.\n 30: optional string externalEntityType\n 40: optional string externalEntityKey\n}\n\nenum ActiveClusterSelectionStrategy {\n REGION_STICKY,\n EXTERNAL_ENTITY,\n}\n" +const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception InternalDataInconsistencyError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception WorkflowExecutionAlreadyCompletedError {\n 1: required string message\n}\n\nexception EntityNotExistsError {\n 1: required string message\n 2: optional string currentCluster\n 3: optional string activeCluster\n // activeClusters is a list of active clusters for active-active domain\n 4: required list activeClusters\n}\n\nexception ServiceBusyError {\n 1: required string message\n 2: optional string reason\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nexception DomainNotActiveError {\n 1: required string message\n 2: required string domainName\n 3: required string currentCluster\n 4: required string activeCluster\n // activeClusters is a list of active clusters for active-active domain\n 5: required list activeClusters\n}\n\nexception LimitExceededError {\n 1: required string message\n}\n\nexception AccessDeniedError {\n 1: required string message\n}\n\nexception RetryTaskV2Error {\n 1: required string message\n 2: optional string domainId\n 3: optional string workflowId\n 4: optional string runId\n 5: optional i64 (js.type = \"Long\") startEventId\n 6: optional i64 (js.type = \"Long\") startEventVersion\n 7: optional i64 (js.type = \"Long\") endEventId\n 8: optional i64 (js.type = \"Long\") endEventVersion\n}\n\nexception ClientVersionNotSupportedError {\n 1: required string featureVersion\n 2: required string clientImpl\n 3: required string supportedVersions\n}\n\nexception FeatureNotEnabledError {\n 1: required string featureFlag\n}\n\nexception CurrentBranchChangedError {\n 10: required string message\n 20: required binary currentBranchToken\n}\n\nexception RemoteSyncMatchedError {\n 10: required string message\n}\n\nexception StickyWorkerUnavailableError {\n 1: required string message\n}\n\nexception TaskListNotOwnedByHostError {\n 1: required string ownedByIdentity\n 2: required string myIdentity\n 3: required string tasklistName\n}\n\nenum WorkflowIdReusePolicy {\n /*\n * allow start a workflow execution using the same workflow ID,\n * when workflow not running, and the last execution close state is in\n * [terminated, cancelled, timeouted, failed].\n */\n AllowDuplicateFailedOnly,\n /*\n * allow start a workflow execution using the same workflow ID,\n * when workflow not running.\n */\n AllowDuplicate,\n /*\n * do not allow start a workflow execution using the same workflow ID at all\n */\n RejectDuplicate,\n /*\n * if a workflow is running using the same workflow ID, terminate it and start a new one\n */\n TerminateIfRunning,\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum ParentClosePolicy {\n\tABANDON,\n\tREQUEST_CANCEL,\n\tTERMINATE,\n}\n\n\n// whenever this list of decision is changed\n// do change the mutableStateBuilder.go\n// function shouldBufferEvent\n// to make sure wo do the correct event ordering\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n SignalExternalWorkflowExecution,\n UpsertWorkflowSearchAttributes,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n SignalExternalWorkflowExecutionInitiated,\n SignalExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionSignaled,\n UpsertWorkflowSearchAttributes,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE,\n BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_START_CHILD_EXECUTION_ATTRIBUTES,\n FORCE_CLOSE_DECISION,\n FAILOVER_CLOSE_DECISION,\n BAD_SIGNAL_INPUT_SIZE,\n RESET_WORKFLOW,\n BAD_BINARY,\n SCHEDULE_ACTIVITY_DUPLICATE_ID,\n BAD_SEARCH_ATTRIBUTES,\n}\n\nenum DecisionTaskTimedOutCause {\n TIMEOUT,\n RESET,\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum SignalExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\n// TODO: when migrating to gRPC, add a running / none status,\n// currently, customer is using null / nil as an indication\n// that workflow is still running\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nenum QueryResultType {\n ANSWERED,\n FAILED,\n}\n\nenum PendingActivityState {\n SCHEDULED,\n STARTED,\n CANCEL_REQUESTED,\n}\n\nenum PendingDecisionState {\n SCHEDULED,\n STARTED,\n}\n\nenum HistoryEventFilterType {\n ALL_EVENT,\n CLOSE_EVENT,\n}\n\nenum TaskListKind {\n NORMAL,\n STICKY,\n EPHEMERAL,\n}\n\nenum ArchivalStatus {\n DISABLED,\n ENABLED,\n}\n\nenum CronOverlapPolicy {\n SKIPPED,\n BUFFERONE,\n}\n\nenum IndexedValueType {\n STRING,\n KEYWORD,\n INT,\n DOUBLE,\n BOOL,\n DATETIME,\n}\n\nstruct Header {\n 10: optional map fields\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n 20: optional TaskListKind kind\n}\n\nenum EncodingType {\n ThriftRW,\n JSON,\n}\n\nenum QueryRejectCondition {\n // NOT_OPEN indicates that query should be rejected if workflow is not open\n NOT_OPEN\n // NOT_COMPLETED_CLEANLY indicates that query should be rejected if workflow did not complete cleanly\n NOT_COMPLETED_CLEANLY\n}\n\nenum QueryConsistencyLevel {\n // EVENTUAL indicates that query should be eventually consistent\n EVENTUAL\n // STRONG indicates that any events that came before query should be reflected in workflow state before running query\n STRONG\n}\n\nstruct DataBlob {\n 10: optional EncodingType EncodingType\n 20: optional binary Data\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct Memo {\n 10: optional map fields\n}\n\nstruct SearchAttributes {\n 10: optional map indexedFields\n}\n\nstruct WorkerVersionInfo {\n 10: optional string impl\n 20: optional string featureVersion\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n 70: optional string parentDomainId\n 71: optional string parentDomainName\n 72: optional i64 parentInitatedId\n 80: optional WorkflowExecution parentExecution\n 90: optional i64 (js.type = \"Long\") executionTime\n 100: optional Memo memo\n 101: optional SearchAttributes searchAttributes\n 110: optional ResetPoints autoResetPoints\n 120: optional string taskList\n 121: optional TaskList taskListInfo\n 130: optional bool isCron\n 140: optional i64 (js.type = \"Long\") updateTime\n 150: optional map partitionConfig\n 160: optional CronOverlapPolicy cronOverlapPolicy\n 170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n// 40: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 70: optional RetryPolicy retryPolicy\n 80: optional Header header\n 90: optional bool requestLocalDispatch\n}\n\nstruct ActivityLocalDispatchInfo{\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") scheduledTimestamp\n 30: optional i64 (js.type = \"Long\") startedTimestamp\n 40: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n 50: optional binary taskToken\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n 50: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional string signalName\n 40: optional binary input\n 50: optional binary control\n 60: optional bool childWorkflowOnly\n}\n\nstruct UpsertWorkflowSearchAttributesDecisionAttributes {\n 10: optional SearchAttributes searchAttributes\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional Header header\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional i32 backoffStartIntervalInSeconds\n 70: optional RetryPolicy retryPolicy\n 80: optional ContinueAsNewInitiator initiator\n 90: optional string failureReason\n 100: optional binary failureDetails\n 110: optional binary lastCompletionResult\n 120: optional string cronSchedule\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n 160: optional i32 jitterStartSeconds\n 170: optional CronOverlapPolicy cronOverlapPolicy\n 180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n// 80: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 81: optional ParentClosePolicy parentClosePolicy\n 90: optional binary control\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 110: optional RetryPolicy retryPolicy\n 120: optional string cronSchedule\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n 160: optional CronOverlapPolicy cronOverlapPolicy\n 170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n 110: optional SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes\n 120: optional UpsertWorkflowSearchAttributesDecisionAttributes upsertWorkflowSearchAttributesDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 12: optional string parentWorkflowDomain\n 14: optional WorkflowExecution parentWorkflowExecution\n 16: optional i64 (js.type = \"Long\") parentInitiatedEventId\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n// 52: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 54: optional string continuedExecutionRunId\n 55: optional ContinueAsNewInitiator initiator\n 56: optional string continuedFailureReason\n 57: optional binary continuedFailureDetails\n 58: optional binary lastCompletionResult\n 59: optional string originalExecutionRunId // This is the runID when the WorkflowExecutionStarted event is written\n 60: optional string identity\n 61: optional string firstExecutionRunId // This is the very first runID along the chain of ContinueAsNew and Reset.\n 62: optional i64 (js.type = \"Long\") firstScheduledTimeNano\n 70: optional RetryPolicy retryPolicy\n 80: optional i32 attempt\n 90: optional i64 (js.type = \"Long\") expirationTimestamp\n 100: optional string cronSchedule\n 110: optional i32 firstDecisionTaskBackoffSeconds\n 120: optional Memo memo\n 121: optional SearchAttributes searchAttributes\n 130: optional ResetPoints prevAutoResetPoints\n 140: optional Header header\n 150: optional map partitionConfig\n 160: optional string requestId\n 170: optional CronOverlapPolicy cronOverlapPolicy\n 180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct ResetPoints{\n 10: optional list points\n}\n\n struct ResetPointInfo{\n 10: optional string binaryChecksum\n 20: optional string runId\n 30: optional i64 firstDecisionCompletedId\n 40: optional i64 (js.type = \"Long\") createdTimeNano\n 50: optional i64 (js.type = \"Long\") expiringTimeNano //the time that the run is deleted due to retention\n 60: optional bool resettable // false if the resset point has pending childWFs/reqCancels/signalExternals.\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nenum ContinueAsNewInitiator {\n Decider,\n RetryPolicy,\n CronSchedule,\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 80: optional i32 backoffStartIntervalInSeconds\n 90: optional ContinueAsNewInitiator initiator\n 100: optional string failureReason\n 110: optional binary failureDetails\n 120: optional binary lastCompletionResult\n 130: optional Header header\n 140: optional Memo memo\n 150: optional SearchAttributes searchAttributes\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n 50: optional string binaryChecksum\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n // for reset workflow\n 40: optional string baseRunId\n 50: optional string newRunId\n 60: optional i64 (js.type = \"Long\") forkEventVersion\n 70: optional string reason\n 80: optional DecisionTaskTimedOutCause cause\n 90: optional string requestId\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n 50: optional string reason\n // for reset workflow\n 60: optional string baseRunId\n 70: optional string newRunId\n 80: optional i64 (js.type = \"Long\") forkEventVersion\n 90: optional string binaryChecksum\n 100: optional string requestId\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 110: optional RetryPolicy retryPolicy\n 120: optional Header header\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n 40: optional i32 attempt\n 50: optional string lastFailureReason\n 60: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n // For retry activity, it may have a failure before timeout. It's important to keep those information for debug.\n // Client can also provide the info for making next decision\n 40: optional string lastFailureReason\n 50: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n 50: optional string requestId\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional Header header\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n 50: optional bool childWorkflowOnly\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct SignalExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional string signalName\n 50: optional binary input\n 60: optional binary control\n 70: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionFailedEventAttributes {\n 10: optional SignalExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionSignaledEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct UpsertWorkflowSearchAttributesEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional SearchAttributes searchAttributes\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n// 80: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 81: optional ParentClosePolicy parentClosePolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 110: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 120: optional RetryPolicy retryPolicy\n 130: optional string cronSchedule\n 140: optional Header header\n 150: optional Memo memo\n 160: optional SearchAttributes searchAttributes\n 170: optional i32 delayStartSeconds\n 180: optional i32 jitterStartSeconds\n 190: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 200: optional CronOverlapPolicy cronOverlapPolicy\n 210: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional Header header\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 35: optional i64 (js.type = \"Long\") version\n 36: optional i64 (js.type = \"Long\") taskId\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n 420: optional SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes\n 430: optional SignalExternalWorkflowExecutionFailedEventAttributes signalExternalWorkflowExecutionFailedEventAttributes\n 440: optional ExternalWorkflowExecutionSignaledEventAttributes externalWorkflowExecutionSignaledEventAttributes\n 450: optional UpsertWorkflowSearchAttributesEventAttributes upsertWorkflowSearchAttributesEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n // A key-value map for any customized purpose\n 50: optional map data\n 60: optional string uuid\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n 60: optional IsolationGroupConfiguration isolationgroups\n 70: optional BadBinaries badBinaries\n 80: optional ArchivalStatus historyArchivalStatus\n 90: optional string historyArchivalURI\n 100: optional ArchivalStatus visibilityArchivalStatus\n 110: optional string visibilityArchivalURI\n 120: optional AsyncWorkflowConfiguration AsyncWorkflowConfiguration\n}\n\nstruct FailoverInfo {\n 10: optional i64 (js.type = \"Long\") failoverVersion\n 20: optional i64 (js.type = \"Long\") failoverStartTimestamp\n 30: optional i64 (js.type = \"Long\") failoverExpireTimestamp\n 40: optional i32 completedShardCount\n 50: optional list pendingShards\n}\n\nstruct BadBinaries{\n 10: optional map binaries\n}\n\nstruct BadBinaryInfo{\n 10: optional string reason\n 20: optional string operator\n 30: optional i64 (js.type = \"Long\") createdTimeNano\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n // A key-value map for any customized purpose\n 30: optional map data\n}\n\nstruct ClusterReplicationConfiguration {\n 10: optional string clusterName\n}\n\nstruct DomainReplicationConfiguration {\n // activeClusterName is the name of the active cluster for active-passive domain\n 10: optional string activeClusterName\n\n // clusters is list of all active and passive clusters of domain\n 20: optional list clusters\n\n // activeClusters contains active cluster(s) information for active-active domain\n 30: optional ActiveClusters activeClusters\n}\n\nstruct ActiveClusters {\n // activeClustersByRegion is a map of region name to active cluster info for active-active domain\n 10: optional map activeClustersByRegion\n}\n\n// ActiveClusterInfo contains the configuration of active-active domain's active cluster & failover version for a specific region\nstruct ActiveClusterInfo {\n 10: optional string activeClusterName\n 20: optional i64 (js.type = \"Long\") failoverVersion\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric = true\n 60: optional list clusters\n 70: optional string activeClusterName\n // activeClusters is a map of region name to active cluster name for active-active domain\n 75: optional map activeClustersByRegion\n // A key-value map for any customized purpose\n 80: optional map data\n 90: optional string securityToken\n 120: optional bool isGlobalDomain\n 130: optional ArchivalStatus historyArchivalStatus\n 140: optional string historyArchivalURI\n 150: optional ArchivalStatus visibilityArchivalStatus\n 160: optional string visibilityArchivalURI\n}\n\nstruct ListDomainsRequest {\n 10: optional i32 pageSize\n 20: optional binary nextPageToken\n}\n\nstruct ListDomainsResponse {\n 10: optional list domains\n 20: optional binary nextPageToken\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n 20: optional string uuid\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n 30: optional DomainReplicationConfiguration replicationConfiguration\n 40: optional i64 (js.type = \"Long\") failoverVersion\n 50: optional bool isGlobalDomain\n 60: optional FailoverInfo failoverInfo\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n 40: optional DomainReplicationConfiguration replicationConfiguration\n 50: optional string securityToken\n 60: optional string deleteBadBinary\n 70: optional i32 failoverTimeoutInSeconds\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n 30: optional DomainReplicationConfiguration replicationConfiguration\n 40: optional i64 (js.type = \"Long\") failoverVersion\n 50: optional bool isGlobalDomain\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct DeleteDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n// 110: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n 120: optional RetryPolicy retryPolicy\n 130: optional string cronSchedule\n 140: optional Memo memo\n 141: optional SearchAttributes searchAttributes\n 150: optional Header header\n 160: optional i32 delayStartSeconds\n 170: optional i32 jitterStartSeconds\n 180: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 190: optional CronOverlapPolicy cronOverlapPolicy\n 200: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct StartWorkflowExecutionAsyncRequest {\n 10: optional StartWorkflowExecutionRequest request\n}\n\nstruct StartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct DiagnoseWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n}\n\nstruct DiagnoseWorkflowExecutionResponse {\n 10: optional string domain\n 20: optional WorkflowExecution diagnosticWorkflowExecution\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional string binaryChecksum\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 51: optional i64 (js.type = 'Long') attempt\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n 90: optional TaskList WorkflowExecutionTaskList\n 100: optional i64 (js.type = \"Long\") scheduledTimestamp\n 110: optional i64 (js.type = \"Long\") startedTimestamp\n 120: optional map queries\n 130: optional i64 (js.type = 'Long') nextEventId\n 140: optional i64 (js.type = 'Long') totalHistoryBytes\n 150: optional AutoConfigHint autoConfigHint\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n 60: optional bool returnNewDecisionTask\n 70: optional bool forceCreateNewDecisionTask\n 80: optional string binaryChecksum\n 90: optional map queryResults\n}\n\nstruct RespondDecisionTaskCompletedResponse {\n 10: optional PollForDecisionTaskResponse decisionTask\n 20: optional map activitiesToDispatchLocally\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n 50: optional string binaryChecksum\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n 120: optional i32 attempt\n 130: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n 140: optional binary heartbeatDetails\n 150: optional WorkflowType workflowType\n 160: optional string workflowDomain\n 170: optional Header header\n 180: optional AutoConfigHint autoConfigHint\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domain\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n 50: optional string cause\n 60: optional string firstExecutionRunID\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n 60: optional HistoryEventFilterType HistoryEventFilterType\n 70: optional bool skipArchival\n 80: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 11: optional list rawHistory\n 20: optional binary nextPageToken\n 30: optional bool archived\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n 60: optional string requestId\n 70: optional binary control\n}\n\nstruct SignalWithStartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n 100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n 110: optional string signalName\n 120: optional binary signalInput\n 130: optional binary control\n 140: optional RetryPolicy retryPolicy\n 150: optional string cronSchedule\n 160: optional Memo memo\n 161: optional SearchAttributes searchAttributes\n 170: optional Header header\n 180: optional i32 delayStartSeconds\n 190: optional i32 jitterStartSeconds\n 200: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n 210: optional CronOverlapPolicy cronOverlapPolicy\n 220: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncRequest {\n 10: optional SignalWithStartWorkflowExecutionRequest request\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional string identity\n}\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n 60: optional string firstExecutionRunID\n}\n\nstruct ResetWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional i64 (js.type = \"Long\") decisionFinishEventId\n 50: optional string requestId\n 60: optional bool skipSignalReapply\n}\n\nstruct ResetWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 pageSize\n 30: optional binary nextPageToken\n 40: optional string query\n}\n\nstruct ListWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListArchivedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 pageSize\n 30: optional binary nextPageToken\n 40: optional string query\n}\n\nstruct ListArchivedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct CountWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional string query\n}\n\nstruct CountWorkflowExecutionsResponse {\n 10: optional i64 count\n}\n\nstruct GetSearchAttributesResponse {\n 10: optional map keys\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n // QueryRejectCondition can used to reject the query if workflow state does not satisify condition\n 40: optional QueryRejectCondition queryRejectCondition\n 50: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct QueryRejected {\n 10: optional WorkflowExecutionCloseStatus closeStatus\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n 20: optional QueryRejected queryRejected\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct ResetStickyTaskListRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct ResetStickyTaskListResponse {\n // The reason to keep this response is to allow returning\n // information in the future.\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n 50: optional WorkerVersionInfo workerVersionInfo\n}\n\nstruct WorkflowQueryResult {\n 10: optional QueryResultType resultType\n 20: optional binary answer\n 30: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct PendingActivityInfo {\n 10: optional string activityID\n 20: optional ActivityType activityType\n 30: optional PendingActivityState state\n 40: optional binary heartbeatDetails\n 50: optional i64 (js.type = \"Long\") lastHeartbeatTimestamp\n 60: optional i64 (js.type = \"Long\") lastStartedTimestamp\n 70: optional i32 attempt\n 80: optional i32 maximumAttempts\n 90: optional i64 (js.type = \"Long\") scheduledTimestamp\n 100: optional i64 (js.type = \"Long\") expirationTimestamp\n 110: optional string lastFailureReason\n 120: optional string lastWorkerIdentity\n 130: optional binary lastFailureDetails\n 140: optional string startedWorkerIdentity\n 150: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingDecisionInfo {\n 10: optional PendingDecisionState state\n 20: optional i64 (js.type = \"Long\") scheduledTimestamp\n 30: optional i64 (js.type = \"Long\") startedTimestamp\n 40: optional i64 attempt\n 50: optional i64 (js.type = \"Long\") originalScheduledTimestamp\n 60: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingChildExecutionInfo {\n 1: optional string domain\n 10: optional string workflowID\n 20: optional string runID\n 30: optional string workflowTypName\n 40: optional i64 (js.type = \"Long\") initiatedID\n 50: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n 30: optional list pendingActivities\n 40: optional list pendingChildren\n 50: optional PendingDecisionInfo pendingDecision\n}\n\nstruct DescribeTaskListRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional TaskListType taskListType\n 40: optional bool includeTaskListStatus\n}\n\nstruct DescribeTaskListResponse {\n 10: optional list pollers\n 20: optional TaskListStatus taskListStatus\n // The TaskList being described\n 30: optional TaskList taskList\n}\n\nstruct GetTaskListsByDomainRequest {\n 10: optional string domainName\n}\n\nstruct GetTaskListsByDomainResponse {\n 10: optional map decisionTaskListMap\n 20: optional map activityTaskListMap\n}\n\nstruct ListTaskListPartitionsRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n}\n\nstruct TaskListPartitionMetadata {\n 10: optional string key\n 20: optional string ownerHostName\n}\n\nstruct ListTaskListPartitionsResponse {\n 10: optional list activityTaskListPartitions\n 20: optional list decisionTaskListPartitions\n}\n\nstruct IsolationGroupMetrics {\n 10: optional double newTasksPerSecond\n 20: optional i64 (js.type = \"Long\") pollerCount\n}\n\nstruct TaskListStatus {\n 10: optional i64 (js.type = \"Long\") backlogCountHint\n 20: optional i64 (js.type = \"Long\") readLevel\n 30: optional i64 (js.type = \"Long\") ackLevel\n 35: optional double ratePerSecond\n 40: optional TaskIDBlock taskIDBlock\n 50: optional map isolationGroupMetrics\n 60: optional double newTasksPerSecond\n 70: optional bool empty\n}\n\nstruct TaskIDBlock {\n 10: optional i64 (js.type = \"Long\") startID\n 20: optional i64 (js.type = \"Long\") endID\n}\n\n//At least one of the parameters needs to be provided\nstruct DescribeHistoryHostRequest {\n 10: optional string hostAddress //ip:port\n 20: optional i32 shardIdForHost\n 30: optional WorkflowExecution executionForHost\n}\n\nstruct RemoveTaskRequest {\n 10: optional i32 shardID\n 20: optional i32 type\n 30: optional i64 (js.type = \"Long\") taskID\n 40: optional i64 (js.type = \"Long\") visibilityTimestamp\n 50: optional string clusterName\n}\n\nstruct CloseShardRequest {\n 10: optional i32 shardID\n}\n\nstruct ResetQueueRequest {\n 10: optional i32 shardID\n 20: optional string clusterName\n 30: optional i32 type\n}\n\nstruct DescribeQueueRequest {\n 10: optional i32 shardID\n 20: optional string clusterName\n 30: optional i32 type\n}\n\nstruct DescribeQueueResponse {\n 10: optional list processingQueueStates\n}\n\nstruct DescribeShardDistributionRequest {\n 10: optional i32 pageSize\n 20: optional i32 pageID\n}\n\nstruct DescribeShardDistributionResponse {\n 10: optional i32 numberOfShards\n\n // ShardID to Address (ip:port) map\n 20: optional map shards\n}\n\nstruct DescribeHistoryHostResponse{\n 10: optional i32 numberOfShards\n 20: optional list shardIDs\n 30: optional DomainCacheInfo domainCache\n 40: optional string shardControllerStatus\n 50: optional string address\n}\n\nstruct DomainCacheInfo{\n 10: optional i64 numOfItemsInCacheByID\n 20: optional i64 numOfItemsInCacheByName\n}\n\nenum TaskListType {\n /*\n * Decision type of tasklist\n */\n Decision,\n /*\n * Activity type of tasklist\n */\n Activity,\n}\n\nstruct PollerInfo {\n // Unix Nano\n 10: optional i64 (js.type = \"Long\") lastAccessTime\n 20: optional string identity\n 30: optional double ratePerSecond\n}\n\nstruct RetryPolicy {\n // Interval of the first retry. If coefficient is 1.0 then it is used for all retries.\n 10: optional i32 initialIntervalInSeconds\n\n // Coefficient used to calculate the next retry interval.\n // The next retry interval is previous interval multiplied by the coefficient.\n // Must be 1 or larger.\n 20: optional double backoffCoefficient\n\n // Maximum interval between retries. Exponential backoff leads to interval increase.\n // This value is the cap of the increase. Default is 100x of initial interval.\n 30: optional i32 maximumIntervalInSeconds\n\n // Maximum number of attempts. When exceeded the retries stop even if not expired yet.\n // Must be 1 or bigger. Default is unlimited.\n 40: optional i32 maximumAttempts\n\n // Non-Retriable errors. Will stop retrying if error matches this list.\n 50: optional list nonRetriableErrorReasons\n\n // Expiration time for the whole retry process.\n 60: optional i32 expirationIntervalInSeconds\n}\n\n// HistoryBranchRange represents a piece of range for a branch.\nstruct HistoryBranchRange{\n // branchID of original branch forked from\n 10: optional string branchID\n // beinning node for the range, inclusive\n 20: optional i64 beginNodeID\n // ending node for the range, exclusive\n 30: optional i64 endNodeID\n}\n\n// For history persistence to serialize/deserialize branch details\nstruct HistoryBranch{\n 10: optional string treeID\n 20: optional string branchID\n 30: optional list ancestors\n}\n\n// VersionHistoryItem contains signal eventID and the corresponding version\nstruct VersionHistoryItem{\n 10: optional i64 (js.type = \"Long\") eventID\n 20: optional i64 (js.type = \"Long\") version\n}\n\n// VersionHistory contains the version history of a branch\nstruct VersionHistory{\n 10: optional binary branchToken\n 20: optional list items\n}\n\n// VersionHistories contains all version histories from all branches\nstruct VersionHistories{\n 10: optional i32 currentVersionHistoryIndex\n 20: optional list histories\n}\n\n// ReapplyEventsRequest is the request for reapply events API\nstruct ReapplyEventsRequest{\n 10: optional string domainName\n 20: optional WorkflowExecution workflowExecution\n 30: optional DataBlob events\n}\n\n// SupportedClientVersions contains the support versions for client library\nstruct SupportedClientVersions{\n 10: optional string goSdk\n 20: optional string javaSdk\n}\n\n// ClusterInfo contains information about cadence cluster\nstruct ClusterInfo{\n 10: optional SupportedClientVersions supportedClientVersions\n}\n\nstruct RefreshWorkflowTasksRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct FeatureFlags {\n\t10: optional bool WorkflowExecutionAlreadyCompletedErrorEnabled\n}\n\nenum CrossClusterTaskType {\n StartChildExecution\n CancelExecution\n SignalExecution\n RecordChildWorkflowExecutionComplete\n ApplyParentClosePolicy\n}\n\nenum CrossClusterTaskFailedCause {\n DOMAIN_NOT_ACTIVE\n DOMAIN_NOT_EXISTS\n WORKFLOW_ALREADY_RUNNING\n WORKFLOW_NOT_EXISTS\n WORKFLOW_ALREADY_COMPLETED\n UNCATEGORIZED\n}\n\nenum GetTaskFailedCause {\n SERVICE_BUSY\n TIMEOUT\n SHARD_OWNERSHIP_LOST\n UNCATEGORIZED\n}\n\nstruct CrossClusterTaskInfo {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional CrossClusterTaskType taskType\n 50: optional i16 taskState\n 60: optional i64 (js.type = \"Long\") taskID\n 70: optional i64 (js.type = \"Long\") visibilityTimestamp\n}\n\nstruct CrossClusterStartChildExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string requestID\n 30: optional i64 (js.type = \"Long\") initiatedEventID\n 40: optional StartChildWorkflowExecutionInitiatedEventAttributes initiatedEventAttributes\n // targetRunID is for scheduling first decision task\n // targetWorkflowID is available in initiatedEventAttributes\n 50: optional string targetRunID\n 60: optional map partitionConfig\n}\n\nstruct CrossClusterStartChildExecutionResponseAttributes {\n 10: optional string runID\n}\n\nstruct CrossClusterCancelExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional string requestID\n 50: optional i64 (js.type = \"Long\") initiatedEventID\n 60: optional bool childWorkflowOnly\n}\n\nstruct CrossClusterCancelExecutionResponseAttributes {\n}\n\nstruct CrossClusterSignalExecutionRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional string requestID\n 50: optional i64 (js.type = \"Long\") initiatedEventID\n 60: optional bool childWorkflowOnly\n 70: optional string signalName\n 80: optional binary signalInput\n 90: optional binary control\n}\n\nstruct CrossClusterSignalExecutionResponseAttributes {\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes {\n 10: optional string targetDomainID\n 20: optional string targetWorkflowID\n 30: optional string targetRunID\n 40: optional i64 (js.type = \"Long\") initiatedEventID\n 50: optional HistoryEvent completionEvent\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes {\n}\n\nstruct ApplyParentClosePolicyAttributes {\n 10: optional string childDomainID\n 20: optional string childWorkflowID\n 30: optional string childRunID\n 40: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct ApplyParentClosePolicyStatus {\n 10: optional bool completed\n 20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct ApplyParentClosePolicyRequest {\n 10: optional ApplyParentClosePolicyAttributes child\n 20: optional ApplyParentClosePolicyStatus status\n}\n\nstruct CrossClusterApplyParentClosePolicyRequestAttributes {\n 10: optional list children\n}\n\nstruct ApplyParentClosePolicyResult {\n 10: optional ApplyParentClosePolicyAttributes child\n 20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct CrossClusterApplyParentClosePolicyResponseAttributes {\n 10: optional list childrenStatus\n}\n\nstruct CrossClusterTaskRequest {\n 10: optional CrossClusterTaskInfo taskInfo\n 20: optional CrossClusterStartChildExecutionRequestAttributes startChildExecutionAttributes\n 30: optional CrossClusterCancelExecutionRequestAttributes cancelExecutionAttributes\n 40: optional CrossClusterSignalExecutionRequestAttributes signalExecutionAttributes\n 50: optional CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes recordChildWorkflowExecutionCompleteAttributes\n 60: optional CrossClusterApplyParentClosePolicyRequestAttributes applyParentClosePolicyAttributes\n}\n\nstruct CrossClusterTaskResponse {\n 10: optional i64 (js.type = \"Long\") taskID\n 20: optional CrossClusterTaskType taskType\n 30: optional i16 taskState\n 40: optional CrossClusterTaskFailedCause failedCause\n 50: optional CrossClusterStartChildExecutionResponseAttributes startChildExecutionAttributes\n 60: optional CrossClusterCancelExecutionResponseAttributes cancelExecutionAttributes\n 70: optional CrossClusterSignalExecutionResponseAttributes signalExecutionAttributes\n 80: optional CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes recordChildWorkflowExecutionCompleteAttributes\n 90: optional CrossClusterApplyParentClosePolicyResponseAttributes applyParentClosePolicyAttributes\n}\n\nstruct GetCrossClusterTasksRequest {\n 10: optional list shardIDs\n 20: optional string targetCluster\n}\n\nstruct GetCrossClusterTasksResponse {\n 10: optional map> tasksByShard\n 20: optional map failedCauseByShard\n}\n\nstruct RespondCrossClusterTasksCompletedRequest {\n 10: optional i32 shardID\n 20: optional string targetCluster\n 30: optional list taskResponses\n 40: optional bool fetchNewTasks\n}\n\nstruct RespondCrossClusterTasksCompletedResponse {\n 10: optional list tasks\n}\n\nenum IsolationGroupState {\n INVALID,\n HEALTHY,\n DRAINED,\n}\n\nstruct IsolationGroupPartition {\n 10: optional string name\n 20: optional IsolationGroupState state\n}\n\nstruct IsolationGroupConfiguration {\n 10: optional list isolationGroups\n}\n\nstruct AsyncWorkflowConfiguration {\n 10: optional bool enabled\n // PredefinedQueueName is the name of the predefined queue in cadence server config's asyncWorkflowQueues\n 20: optional string predefinedQueueName\n // queueType is the type of the queue if predefined_queue_name is not used\n 30: optional string queueType\n // queueConfig is the configuration for the queue if predefined_queue_name is not used\n 40: optional DataBlob queueConfig\n}\n\n/**\n* Any is a logical duplicate of google.protobuf.Any.\n*\n* The intent of the type is the same, but it is not intended to be directly\n* compatible with google.protobuf.Any or any Thrift equivalent - this blob is\n* RPC-type agnostic by design (as the underlying data may be transported over\n* proto or thrift), and the data-bytes may be in any encoding.\n*\n* This is intentionally different from DataBlob, which supports only a handful\n* of known encodings so it can be interpreted everywhere. Any supports literally\n* any contents, and needs to be considered opaque until it is given to something\n* that is expecting it.\n*\n* See ValueType to interpret the contents.\n**/\nstruct Any {\n // Type-string describing value's contents, and intentionally avoiding the\n // name \"type\" as it is often a special term.\n // This should usually be a hard-coded string of some kind.\n 10: optional string ValueType\n // Arbitrarily-encoded bytes, to be deserialized by a runtime implementation.\n // The contents are described by ValueType.\n 20: optional binary Value\n}\n\nstruct AutoConfigHint {\n 10: optional bool enableAutoConfig\n 20: optional i64 pollerWaitTimeInMs\n}\n\nstruct QueueState {\n 10: optional map virtualQueueStates\n 20: optional TaskKey exclusiveMaxReadLevel\n}\n\nstruct VirtualQueueState {\n 10: optional list virtualSliceStates\n}\n\nstruct VirtualSliceState {\n 10: optional TaskRange taskRange\n 20: optional Predicate predicate\n}\n\nstruct TaskRange {\n 10: optional TaskKey inclusiveMin\n 20: optional TaskKey exclusiveMax\n}\n\nstruct TaskKey {\n 10: optional i64 scheduledTimeNano\n 20: optional i64 taskID\n}\n\nstruct ActiveClusterSelectionPolicy {\n 10: optional ActiveClusterSelectionStrategy strategy\n\n // sticky_region is the region sticky if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_REGION_STICKY\n // This is the default strategy for active-active domains and region would be set to receiver cluster's region if not specified.\n 20: optional string stickyRegion\n\n // external_entity_type/external_entity_key is the type/key of the external entity if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_EXTERNAL_ENTITY\n // external entity type must be one of the supported types in active cluster manager. Custom ones can be added by implementing the corresponding interface.\n 30: optional string externalEntityType\n 40: optional string externalEntityKey\n}\n\nenum ActiveClusterSelectionStrategy {\n REGION_STICKY,\n EXTERNAL_ENTITY,\n}\n\nenum PredicateType {\n Universal,\n Empty,\n DomainID,\n}\n\nstruct UniversalPredicateAttributes {}\n\nstruct EmptyPredicateAttributes {}\n\nstruct DomainIDPredicateAttributes {\n 10: optional list domainIDs\n 20: optional bool isExclusive\n}\n\nstruct Predicate {\n 10: optional PredicateType predicateType\n 20: optional UniversalPredicateAttributes universalPredicateAttributes\n 30: optional EmptyPredicateAttributes emptyPredicateAttributes\n 40: optional DomainIDPredicateAttributes domainIDPredicateAttributes\n}\n" diff --git a/idls b/idls index cc6f52f87..dec7ecc36 160000 --- a/idls +++ b/idls @@ -1 +1 @@ -Subproject commit cc6f52f87bc6e3b78906f518e3a993bcb88c51b5 +Subproject commit dec7ecc362e6e39beeb3e5914e7e8c1886bbbc46 diff --git a/internal/activity_task_handler.go b/internal/activity_task_handler.go index 1a5f9f224..74d9fe4f5 100644 --- a/internal/activity_task_handler.go +++ b/internal/activity_task_handler.go @@ -80,7 +80,7 @@ func newActivityTaskHandlerWithCustomProvider( } return &activityTaskHandlerImpl{ clock: clock, - taskListName: params.TaskList, + taskListName: params.TaskList.GetName(), identity: params.Identity, service: service, logger: params.Logger, diff --git a/internal/client.go b/internal/client.go index e8bd46fe0..c2044df69 100644 --- a/internal/client.go +++ b/internal/client.go @@ -656,6 +656,7 @@ func getFeatureFlags(options *ClientOptions) FeatureFlags { return FeatureFlags{ WorkflowExecutionAlreadyCompletedErrorEnabled: options.FeatureFlags.WorkflowExecutionAlreadyCompletedErrorEnabled, PollerAutoScalerEnabled: options.FeatureFlags.PollerAutoScalerEnabled, + EphemeralTaskListsEnabled: options.FeatureFlags.EphemeralTaskListsEnabled, } } return FeatureFlags{} diff --git a/internal/compatibility/enum_test.go b/internal/compatibility/enum_test.go index a3e3f044c..f34aa6145 100644 --- a/internal/compatibility/enum_test.go +++ b/internal/compatibility/enum_test.go @@ -266,6 +266,7 @@ func TestTaskListKind(t *testing.T) { apiv1.TaskListKind_TASK_LIST_KIND_INVALID, apiv1.TaskListKind_TASK_LIST_KIND_NORMAL, apiv1.TaskListKind_TASK_LIST_KIND_STICKY, + apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL, } { assert.Equal(t, item, proto.TaskListKind(thrift.TaskListKind(item))) } diff --git a/internal/compatibility/proto/enum.go b/internal/compatibility/proto/enum.go index 5ddf54ce0..f711cb93e 100644 --- a/internal/compatibility/proto/enum.go +++ b/internal/compatibility/proto/enum.go @@ -35,6 +35,8 @@ func TaskListKind(t *shared.TaskListKind) apiv1.TaskListKind { return apiv1.TaskListKind_TASK_LIST_KIND_NORMAL case shared.TaskListKindSticky: return apiv1.TaskListKind_TASK_LIST_KIND_STICKY + case shared.TaskListKindEphemeral: + return apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL } panic("unexpected enum value") } diff --git a/internal/compatibility/thrift/enum.go b/internal/compatibility/thrift/enum.go index 0a5682f19..f7b1f5b66 100644 --- a/internal/compatibility/thrift/enum.go +++ b/internal/compatibility/thrift/enum.go @@ -34,6 +34,8 @@ func TaskListKind(t apiv1.TaskListKind) *shared.TaskListKind { return shared.TaskListKindNormal.Ptr() case apiv1.TaskListKind_TASK_LIST_KIND_STICKY: return shared.TaskListKindSticky.Ptr() + case apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL: + return shared.TaskListKindEphemeral.Ptr() } panic("unexpected enum value") } diff --git a/internal/internal_activity.go b/internal/internal_activity.go index 75a40ed43..ae2a186ec 100644 --- a/internal/internal_activity.go +++ b/internal/internal_activity.go @@ -59,6 +59,7 @@ type ( activityOptions struct { ActivityID *string // Users can choose IDs but our framework makes it optional to decrease the crust. TaskListName string + TaskListKind shared.TaskListKind ScheduleToCloseTimeoutSeconds int32 ScheduleToStartTimeoutSeconds int32 StartToCloseTimeoutSeconds int32 diff --git a/internal/internal_event_handlers.go b/internal/internal_event_handlers.go index cc6dbb27d..d1d82d7a4 100644 --- a/internal/internal_event_handlers.go +++ b/internal/internal_event_handlers.go @@ -121,6 +121,7 @@ type ( contextPropagators []ContextPropagator tracer opentracing.Tracer workflowInterceptorFactories []WorkflowInterceptorFactory + featureFlags FeatureFlags } localActivityTask struct { @@ -205,6 +206,7 @@ func newWorkflowExecutionEventHandler( contextPropagators []ContextPropagator, tracer opentracing.Tracer, workflowInterceptorFactories []WorkflowInterceptorFactory, + featureFlags FeatureFlags, ) workflowExecutionEventHandler { context := &workflowEnvironmentImpl{ workflowInfo: workflowInfo, @@ -222,6 +224,7 @@ func newWorkflowExecutionEventHandler( contextPropagators: contextPropagators, tracer: tracer, workflowInterceptorFactories: workflowInterceptorFactories, + featureFlags: featureFlags, } context.logger = logger.With( zapcore.Field{Key: tagWorkflowType, Type: zapcore.StringType, String: workflowInfo.WorkflowType.Name}, @@ -472,7 +475,7 @@ func (wc *workflowEnvironmentImpl) ExecuteActivity(parameters executeActivityPar } activityID := scheduleTaskAttr.GetActivityId() scheduleTaskAttr.ActivityType = activityTypePtr(parameters.ActivityType) - scheduleTaskAttr.TaskList = common.TaskListPtr(m.TaskList{Name: common.StringPtr(parameters.TaskListName)}) + scheduleTaskAttr.TaskList = common.TaskListPtr(m.TaskList{Name: common.StringPtr(parameters.TaskListName), Kind: parameters.TaskListKind.Ptr()}) scheduleTaskAttr.Input = parameters.Input scheduleTaskAttr.ScheduleToCloseTimeoutSeconds = common.Int32Ptr(parameters.ScheduleToCloseTimeoutSeconds) scheduleTaskAttr.StartToCloseTimeoutSeconds = common.Int32Ptr(parameters.StartToCloseTimeoutSeconds) @@ -804,6 +807,10 @@ func (wc *workflowEnvironmentImpl) GetWorkflowInterceptors() []WorkflowIntercept return wc.workflowInterceptorFactories } +func (wc *workflowEnvironmentImpl) GetFeatureFlags() FeatureFlags { + return wc.featureFlags +} + func (weh *workflowExecutionEventHandlerImpl) ProcessEvent( event *m.HistoryEvent, isReplay bool, diff --git a/internal/internal_event_handlers_test.go b/internal/internal_event_handlers_test.go index 0b87fc801..33a8419bc 100644 --- a/internal/internal_event_handlers_test.go +++ b/internal/internal_event_handlers_test.go @@ -1065,6 +1065,7 @@ func testWorkflowExecutionEventHandler(t *testing.T, registry *registry) *workfl nil, opentracing.NoopTracer{}, nil, + FeatureFlags{}, ).(*workflowExecutionEventHandlerImpl) } diff --git a/internal/internal_task_handlers.go b/internal/internal_task_handlers.go index 841b98199..1653bb8f9 100644 --- a/internal/internal_task_handlers.go +++ b/internal/internal_task_handlers.go @@ -144,6 +144,7 @@ type ( tracer opentracing.Tracer workflowInterceptorFactories []WorkflowInterceptorFactory disableStrictNonDeterminism bool + featureFlags FeatureFlags } activityProvider func(name string) activity @@ -419,6 +420,7 @@ func newWorkflowTaskHandler( tracer: params.Tracer, workflowInterceptorFactories: params.WorkflowInterceptorChainFactories, disableStrictNonDeterminism: params.WorkerBugPorts.DisableStrictNonDeterminismCheck, + featureFlags: params.FeatureFlags, } traceLog(func() { @@ -622,6 +624,7 @@ func (w *workflowExecutionContextImpl) createEventHandler() { w.wth.contextPropagators, w.wth.tracer, w.wth.workflowInterceptorFactories, + w.wth.featureFlags, ) w.eventHandler.Store(eventHandler) } diff --git a/internal/internal_task_handlers_test.go b/internal/internal_task_handlers_test.go index 1db0c7bb5..b24b6b6e9 100644 --- a/internal/internal_task_handlers_test.go +++ b/internal/internal_task_handlers_test.go @@ -325,7 +325,7 @@ func (t *TaskHandlersTestSuite) testWorkflowTaskWorkflowExecutionStartedHelper(p func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowExecutionStarted() { params := workerExecutionParameters{ - TaskList: testWorkflowTaskTasklist, + TaskList: &s.TaskList{Name: common.StringPtr(testWorkflowTaskTasklist), Kind: s.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ Identity: "test-id-1", Logger: t.logger, @@ -336,7 +336,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowExecutionStarted() { func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowExecutionStarted_WithDataConverter() { params := workerExecutionParameters{ - TaskList: testWorkflowTaskTasklist, + TaskList: &s.TaskList{Name: common.StringPtr(testWorkflowTaskTasklist), Kind: s.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ Identity: "test-id-1", Logger: t.logger, @@ -347,24 +347,24 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowExecutionStarted_WithDa } func (t *TaskHandlersTestSuite) TestWorkflowTask_BinaryChecksum() { - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} checksum1 := "chck1" checksum2 := "chck2" testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ ScheduledEventId: common.Int64Ptr(2), BinaryChecksum: common.StringPtr(checksum1)}), createTestEventTimerStarted(5, 0), createTestEventTimerFired(6, 0), - createTestEventDecisionTaskScheduled(7, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventDecisionTaskScheduled(7, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(8), createTestEventDecisionTaskCompleted(9, &s.DecisionTaskCompletedEventAttributes{ ScheduledEventId: common.Int64Ptr(7), BinaryChecksum: common.StringPtr(checksum2)}), createTestEventTimerStarted(10, 1), createTestEventTimerFired(11, 1), - createTestEventDecisionTaskScheduled(12, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventDecisionTaskScheduled(12, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(13), } task := createWorkflowTask(testEvents, 8, "BinaryChecksumWorkflow") @@ -394,16 +394,16 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_BinaryChecksum() { func (t *TaskHandlersTestSuite) TestWorkflowTask_ActivityTaskScheduled() { // Schedule an activity and see if we complete workflow. - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), createTestEventActivityTaskStarted(6, &s.ActivityTaskStartedEventAttributes{}), createTestEventActivityTaskCompleted(7, &s.ActivityTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(5)}), @@ -440,20 +440,20 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_ActivityTaskScheduled() { func (t *TaskHandlersTestSuite) TestWorkflowTask_QueryWorkflow() { // Schedule an activity and see if we complete workflow. - taskList := "sticky-tl" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} execution := &s.WorkflowExecution{ WorkflowId: common.StringPtr("fake-workflow-id"), RunId: common.StringPtr(uuid.New()), } testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), createTestEventActivityTaskStarted(6, &s.ActivityTaskStartedEventAttributes{}), createTestEventActivityTaskCompleted(7, &s.ActivityTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(5)}), @@ -493,16 +493,16 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_QueryWorkflow_2() { // This test appears to be just a finer-grained version of TestWorkflowTask_QueryWorkflow, though the older names // for them implied entirely different purposes. Likely it can be combined with TestWorkflowTask_QueryWorkflow // without losing anything useful. - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), createTestEventActivityTaskStarted(6, &s.ActivityTaskStartedEventAttributes{}), createTestEventActivityTaskCompleted(7, &s.ActivityTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(5)}), @@ -570,16 +570,16 @@ func (t *TaskHandlersTestSuite) verifyQueryResult(response interface{}, expected } func (t *TaskHandlersTestSuite) TestCacheEvictionWhenErrorOccurs() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("pkg.Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), } params := workerExecutionParameters{ @@ -609,13 +609,13 @@ func (t *TaskHandlersTestSuite) TestCacheEvictionWhenErrorOccurs() { } func (t *TaskHandlersTestSuite) TestWithMissingHistoryEvents() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), - createTestEventDecisionTaskScheduled(6, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventDecisionTaskScheduled(6, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(7), } params := workerExecutionParameters{ @@ -645,19 +645,19 @@ func (t *TaskHandlersTestSuite) TestWithMissingHistoryEvents() { } func (t *TaskHandlersTestSuite) TestWithTruncatedHistory() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskFailed(4, &s.DecisionTaskFailedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), - createTestEventDecisionTaskScheduled(5, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventDecisionTaskScheduled(5, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(6), createTestEventDecisionTaskCompleted(7, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(5)}), createTestEventActivityTaskScheduled(8, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("pkg.Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), } params := workerExecutionParameters{ @@ -730,10 +730,10 @@ func (t *TaskHandlersTestSuite) testSideEffectDeferHelper(disableSticky bool) { RegisterWorkflowOptions{Name: workflowName}, ) - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), } @@ -767,16 +767,16 @@ func (t *TaskHandlersTestSuite) testSideEffectDeferHelper(disableSticky bool) { } func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("pkg.Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), } task := createWorkflowTask(testEvents, 3, "HelloWorld_Workflow") @@ -838,17 +838,17 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() { } func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicLogNonexistingID() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ // Insert an ID which does not exist ActivityId: common.StringPtr("NotAnActivityID"), ActivityType: &s.ActivityType{Name: common.StringPtr("pkg.Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), } @@ -881,15 +881,15 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicLogNonexistingI require.Equal(t.T(), zapcore.ErrorType, replayErrorField.Type) require.ErrorContains(t.T(), replayErrorField.Interface.(error), "nondeterministic workflow: "+ - "history event is ActivityTaskScheduled: (ActivityId:NotAnActivityID, ActivityType:(Name:pkg.Greeter_Activity), TaskList:(Name:taskList), Input:[]), "+ - "replay decision is ScheduleActivityTask: (ActivityId:0, ActivityType:(Name:Greeter_Activity), TaskList:(Name:taskList)") + "history event is ActivityTaskScheduled: (ActivityId:NotAnActivityID, ActivityType:(Name:pkg.Greeter_Activity), TaskList:(Name:taskList, Kind:NORMAL), Input:[]), "+ + "replay decision is ScheduleActivityTask: (ActivityId:0, ActivityType:(Name:Greeter_Activity), TaskList:(Name:taskList, Kind:NORMAL)") } func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowReturnsPanicError() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), } task := createWorkflowTask(testEvents, 3, "ReturnPanicWorkflow") @@ -916,10 +916,10 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowReturnsPanicError() { } func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowPanics() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), } @@ -955,7 +955,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowPanics() { } func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} parentID := "parentID" parentRunID := "parentRun" cronSchedule := "5 4 * * *" @@ -979,7 +979,7 @@ func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() { } startedEventAttributes := &s.WorkflowExecutionStartedEventAttributes{ Input: lastCompletionResult, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, ParentWorkflowExecution: parentExecution, CronSchedule: &cronSchedule, ContinuedExecutionRunId: &continuedRunID, @@ -992,7 +992,7 @@ func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() { } testEvents := []*s.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, startedEventAttributes), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), } task := createWorkflowTask(testEvents, 3, workflowType) @@ -1015,7 +1015,7 @@ func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() { attr := r.Decisions[0].CompleteWorkflowExecutionDecisionAttributes var result WorkflowInfo t.NoError(getDefaultDataConverter().FromData(attr.Result, &result)) - t.EqualValues(taskList, result.TaskListName) + t.EqualValues(taskList.GetName(), result.TaskListName) t.EqualValues(parentID, result.ParentWorkflowExecution.ID) t.EqualValues(parentRunID, result.ParentWorkflowExecution.RunID) t.EqualValues(cronSchedule, *result.CronSchedule) @@ -1030,7 +1030,7 @@ func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() { } func (t *TaskHandlersTestSuite) TestConsistentQuery_InvalidQueryTask() { - taskList := "taskList" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} params := workerExecutionParameters{ TaskList: taskList, WorkerOptions: WorkerOptions{ @@ -1057,7 +1057,7 @@ func (t *TaskHandlersTestSuite) TestConsistentQuery_InvalidQueryTask() { } func (t *TaskHandlersTestSuite) TestConsistentQuery_Success() { - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} checksum1 := "chck1" numberOfSignalsToComplete, err := getDefaultDataConverter().ToData(2) t.NoError(err) @@ -1065,7 +1065,7 @@ func (t *TaskHandlersTestSuite) TestConsistentQuery_Success() { t.NoError(err) testEvents := []*s.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{ - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, Input: numberOfSignalsToComplete, }), createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{}), @@ -1142,9 +1142,9 @@ func (t *TaskHandlersTestSuite) assertQueryResultsEqual(expected map[string]*s.W func (t *TaskHandlersTestSuite) TestWorkflowTask_CancelActivityBeforeSent() { // Schedule an activity and see if we complete workflow. - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{}), createTestEventDecisionTaskStarted(3), } @@ -1169,9 +1169,9 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_CancelActivityBeforeSent() { func (t *TaskHandlersTestSuite) TestWorkflowTask_PageToken() { // Schedule a decision activity and see if we complete workflow. - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{}), } task := createWorkflowTask(testEvents, 0, "HelloWorld_Workflow") @@ -1244,7 +1244,7 @@ func (t *TaskHandlersTestSuite) TestLocalActivityRetry_DecisionHeartbeatFail() { task := createWorkflowTask(testEvents, 0, "RetryLocalActivityWorkflow") stopCh := make(chan struct{}) params := workerExecutionParameters{ - TaskList: testWorkflowTaskTasklist, + TaskList: &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ Identity: "test-id-1", Logger: t.logger, @@ -1548,7 +1548,7 @@ func (t *TaskHandlersTestSuite) TestRegression_QueriesDoNotLeakGoroutines() { // so a size of 2 actually means a size of 1. SetStickyWorkflowCacheSize(2) - taskList := "tl1" + taskList := &s.TaskList{Name: common.StringPtr("taskList"), Kind: s.TaskListKindNormal.Ptr()} params := workerExecutionParameters{ TaskList: taskList, WorkerOptions: WorkerOptions{ @@ -1562,14 +1562,14 @@ func (t *TaskHandlersTestSuite) TestRegression_QueriesDoNotLeakGoroutines() { // process a throw-away workflow to fill the cache. this is copied from TestWorkflowTask_QueryWorkflow since it's // relatively simple, but any should work fine, as long as it can be queried. testEvents := []*s.HistoryEvent{ - createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), - createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: &s.TaskList{Name: &taskList}}), + createTestEventWorkflowExecutionStarted(1, &s.WorkflowExecutionStartedEventAttributes{TaskList: taskList}), + createTestEventDecisionTaskScheduled(2, &s.DecisionTaskScheduledEventAttributes{TaskList: taskList}), createTestEventDecisionTaskStarted(3), createTestEventDecisionTaskCompleted(4, &s.DecisionTaskCompletedEventAttributes{ScheduledEventId: common.Int64Ptr(2)}), createTestEventActivityTaskScheduled(5, &s.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &s.ActivityType{Name: common.StringPtr("Greeter_Activity")}, - TaskList: &s.TaskList{Name: &taskList}, + TaskList: taskList, }), } cachedTask := createWorkflowTask(testEvents[0:1], 1, "HelloWorld_Workflow") diff --git a/internal/internal_task_pollers.go b/internal/internal_task_pollers.go index 74d385f6e..dadf24e4e 100644 --- a/internal/internal_task_pollers.go +++ b/internal/internal_task_pollers.go @@ -99,7 +99,7 @@ type ( activityTaskPoller struct { basePoller domain string - taskListName string + taskList *s.TaskList identity string service workflowserviceclient.Interface taskHandler ActivityTaskHandler @@ -301,7 +301,7 @@ func newWorkflowTaskPoller( basePoller: basePoller{shutdownC: params.WorkerStopChannel}, service: service, domain: domain, - taskListName: params.TaskList, + taskListName: params.TaskList.GetName(), identity: params.Identity, taskHandler: taskHandler, ldaTunnel: ldaTunnelInterface, @@ -1037,7 +1037,7 @@ func newActivityTaskPoller(taskHandler ActivityTaskHandler, service workflowserv taskHandler: taskHandler, service: service, domain: domain, - taskListName: params.TaskList, + taskList: params.TaskList, identity: params.Identity, logger: params.Logger, metricsScope: metrics.NewTaggedScope(params.MetricsScope), @@ -1058,7 +1058,7 @@ func (atp *activityTaskPoller) poll(ctx context.Context) (*s.PollForActivityTask }) request := &s.PollForActivityTaskRequest{ Domain: common.StringPtr(atp.domain), - TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(atp.taskListName)}), + TaskList: atp.taskList, Identity: common.StringPtr(atp.identity), TaskListMetadata: &s.TaskListMetadata{MaxTasksPerSecond: &atp.activitiesPerSecond}, } @@ -1161,7 +1161,7 @@ func (atp *activityTaskPoller) ProcessTask(task interface{}) error { executionStartTime := time.Now() // Process the activity task. - request, err := atp.taskHandler.Execute(atp.taskListName, activityTask.task) + request, err := atp.taskHandler.Execute(atp.taskList.GetName(), activityTask.task) if err != nil { metricsScope.Counter(metrics.ActivityExecutionFailedCounter).Inc(1) return err diff --git a/internal/internal_utils.go b/internal/internal_utils.go index b0e5f09f2..b2d58703a 100644 --- a/internal/internal_utils.go +++ b/internal/internal_utils.go @@ -75,7 +75,8 @@ type ( FeatureFlags struct { WorkflowExecutionAlreadyCompletedErrorEnabled bool // Deprecated: use AutoScalerOptions instead - PollerAutoScalerEnabled bool + PollerAutoScalerEnabled bool + EphemeralTaskListsEnabled bool } ) diff --git a/internal/internal_worker.go b/internal/internal_worker.go index 11b6e5c1b..06a68462e 100644 --- a/internal/internal_worker.go +++ b/internal/internal_worker.go @@ -39,6 +39,7 @@ import ( "sync/atomic" "time" + "go.uber.org/cadence/internal/common" "go.uber.org/cadence/internal/common/debug" "go.uber.org/cadence/internal/common/isolationgroup" @@ -132,7 +133,7 @@ type ( WorkerOptions // Task list name to poll. - TaskList string + TaskList *shared.TaskList // Context to store user provided key/value pairs UserContext context.Context @@ -168,7 +169,7 @@ func ensureRequiredParams(params *workerExecutionParameters) { params.Tracer = opentracing.NoopTracer{} } if params.Identity == "" { - params.Identity = getWorkerIdentity(params.TaskList) + params.Identity = getWorkerIdentity(params.TaskList.GetName()) } if params.Logger == nil { // create default logger if user does not supply one. @@ -381,13 +382,27 @@ func newSessionWorker(service workflowserviceclient.Interface, } sessionEnvironment := newSessionEnvironment(params.SessionResourceID, maxConcurrentSessionExecutionSize) - creationTasklist := getCreationTasklist(params.TaskList) + creationTasklist := getCreationTasklist(params.TaskList.GetName()) params.UserContext = context.WithValue(params.UserContext, sessionEnvironmentContextKey, sessionEnvironment) - params.TaskList = sessionEnvironment.GetResourceSpecificTasklist() + resourceSpecificTasklist := sessionEnvironment.GetResourceSpecificTasklist() + if params.FeatureFlags.EphemeralTaskListsEnabled { + params.TaskList = &shared.TaskList{ + Name: common.StringPtr(resourceSpecificTasklist), + Kind: shared.TaskListKindEphemeral.Ptr(), + } + } else { + params.TaskList = &shared.TaskList{ + Name: common.StringPtr(resourceSpecificTasklist), + Kind: shared.TaskListKindNormal.Ptr(), + } + } activityWorker := newActivityWorker(service, domain, params, overrides, env, nil) params.MaxConcurrentActivityTaskPollers = 1 - params.TaskList = creationTasklist + params.TaskList = &shared.TaskList{ + Name: common.StringPtr(creationTasklist), + Kind: shared.TaskListKindNormal.Ptr(), + } creationWorker := newActivityWorker(service, domain, params, overrides, env, sessionEnvironment.GetTokenBucket()) return &sessionWorker{ @@ -1020,8 +1035,11 @@ func newAggregatedWorker( backgroundActivityContext, backgroundActivityContextCancel := context.WithCancel(ctx) workerParams := workerExecutionParameters{ - WorkerOptions: wOptions, - TaskList: taskList, + WorkerOptions: wOptions, + TaskList: &shared.TaskList{ + Name: common.StringPtr(taskList), + Kind: shared.TaskListKindNormal.Ptr(), + }, UserContext: backgroundActivityContext, UserContextCancel: backgroundActivityContextCancel, } diff --git a/internal/internal_worker_base.go b/internal/internal_worker_base.go index 051461ae5..a10776af9 100644 --- a/internal/internal_worker_base.go +++ b/internal/internal_worker_base.go @@ -98,6 +98,7 @@ type ( UpsertSearchAttributes(attributes map[string]interface{}) error GetRegistry() *registry GetWorkflowInterceptors() []WorkflowInterceptorFactory + GetFeatureFlags() FeatureFlags } // WorkflowDefinition wraps the code that can execute a workflow. diff --git a/internal/internal_worker_interfaces_test.go b/internal/internal_worker_interfaces_test.go index d0eb8347e..7027407b5 100644 --- a/internal/internal_worker_interfaces_test.go +++ b/internal/internal_worker_interfaces_test.go @@ -27,6 +27,7 @@ import ( "testing" "time" + "go.uber.org/cadence/internal/common" "go.uber.org/cadence/internal/common/testlogger" "github.com/golang/mock/gomock" @@ -179,7 +180,7 @@ func (s *InterfacesTestSuite) TestInterface() { domain := "testDomain" // Workflow execution parameters. workflowExecutionParameters := workerExecutionParameters{ - TaskList: "testTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentActivityTaskPollers: 4, MaxConcurrentDecisionTaskPollers: 4, @@ -211,7 +212,7 @@ func (s *InterfacesTestSuite) TestInterface() { // Create activity execution parameters. activityExecutionParameters := workerExecutionParameters{ - TaskList: "testTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentActivityTaskPollers: 10, MaxConcurrentDecisionTaskPollers: 10, diff --git a/internal/internal_worker_test.go b/internal/internal_worker_test.go index 6f39f1cb5..e66890230 100644 --- a/internal/internal_worker_test.go +++ b/internal/internal_worker_test.go @@ -1074,7 +1074,7 @@ func TestWorkerOptionDefaults(t *testing.T) { require.Nil(t, decisionWorker.executionParameters.ContextPropagators) expected := workerExecutionParameters{ - TaskList: taskList, + TaskList: &shared.TaskList{Name: common.StringPtr(taskList), Kind: shared.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentActivityTaskPollers: defaultConcurrentPollRoutineSize, MaxConcurrentDecisionTaskPollers: defaultConcurrentPollRoutineSize, @@ -1140,7 +1140,7 @@ func TestWorkerOptionNonDefaults(t *testing.T) { require.True(t, len(decisionWorker.executionParameters.ContextPropagators) > 0) expected := workerExecutionParameters{ - TaskList: taskList, + TaskList: &shared.TaskList{Name: common.StringPtr(taskList), Kind: shared.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentActivityTaskPollers: options.MaxConcurrentActivityTaskPollers, MaxConcurrentDecisionTaskPollers: options.MaxConcurrentDecisionTaskPollers, diff --git a/internal/internal_workers_test.go b/internal/internal_workers_test.go index 757d44c06..c069e4776 100644 --- a/internal/internal_workers_test.go +++ b/internal/internal_workers_test.go @@ -23,6 +23,8 @@ package internal import ( "context" + "strings" + "sync" "testing" "time" @@ -93,7 +95,7 @@ func (s *WorkersTestSuite) TestWorkflowWorker() { ctx, cancel := context.WithCancel(context.Background()) executionParameters := workerExecutionParameters{ - TaskList: "testTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentDecisionTaskPollers: 5, Logger: logger}, @@ -125,7 +127,7 @@ func (s *WorkersTestSuite) testActivityWorker(useLocallyDispatched bool) { s.service.EXPECT().RespondActivityTaskCompleted(gomock.Any(), gomock.Any(), callOptions()...).Return(nil).AnyTimes() executionParameters := workerExecutionParameters{ - TaskList: "testTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentActivityTaskPollers: 5, Logger: testlogger.NewZap(s.T())}, @@ -169,7 +171,7 @@ func (s *WorkersTestSuite) TestActivityWorkerStop() { stopC := make(chan struct{}) ctx, cancel := context.WithCancel(context.Background()) executionParameters := workerExecutionParameters{ - TaskList: "testTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: AugmentWorkerOptions( WorkerOptions{ MaxConcurrentActivityTaskPollers: 5, @@ -210,7 +212,7 @@ func (s *WorkersTestSuite) TestPollForDecisionTask_InternalServiceError() { s.service.EXPECT().PollForDecisionTask(gomock.Any(), gomock.Any(), callOptions()...).Return(&m.PollForDecisionTaskResponse{}, &m.InternalServiceError{}).AnyTimes() executionParameters := workerExecutionParameters{ - TaskList: "testDecisionTaskList", + TaskList: &m.TaskList{Name: common.StringPtr("testDecisionTaskList"), Kind: m.TaskListKindNormal.Ptr()}, WorkerOptions: WorkerOptions{ MaxConcurrentDecisionTaskPollers: 5, Logger: testlogger.NewZap(s.T())}, @@ -891,6 +893,104 @@ func (s *WorkersTestSuite) TestMultipleLocallyDispatchedActivity() { s.True(activityCalledCount.Load() > 0) } +func (s *WorkersTestSuite) TestSessionWorker() { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + pollCount := atomic.NewInt32(0) + done := make(chan struct{}) + var hostSpecificTl sync.Once + var commonTl sync.Once + s.service.EXPECT().DescribeDomain(gomock.Any(), gomock.Any(), callOptions()...).Return(nil, nil).AnyTimes() + s.service.EXPECT().PollForActivityTask(gomock.Any(), gomock.Any(), callOptions()...).DoAndReturn(func(ctx context.Context, request *m.PollForActivityTaskRequest, opts ...yarpc.CallOption) (*m.PollForActivityTaskResponse, error) { + // The host-specific TL + if strings.Contains(request.TaskList.GetName(), "@") && request.TaskList.GetKind() == m.TaskListKindNormal { + hostSpecificTl.Do(func() { + if pollCount.Add(1) == 2 { + close(done) + } + }) + } + // The common creation TL + if request.TaskList.GetName() == "test-tl__internal_session_creation" && request.TaskList.GetKind() == m.TaskListKindNormal { + commonTl.Do(func() { + if pollCount.Add(1) == 2 { + close(done) + } + }) + } + return &m.PollForActivityTaskResponse{}, nil + }).AnyTimes() + options := WorkerOptions{ + Logger: testlogger.NewZap(s.T()), + DisableActivityWorker: true, + DisableWorkflowWorker: true, + EnableSessionWorker: true, + Identity: "test-worker-identity", + } + worker, err := newAggregatedWorker(s.service, domain, "test-tl", options) + s.NoError(err, "worked to create worker") + + err = worker.Start() + s.NoError(err, "worker failed to start") + + // Wait for both to complete + select { + case <-ctx.Done(): + s.Fail("Timed out") + case <-done: + } +} + +func (s *WorkersTestSuite) TestSessionWorker_Ephemeral() { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + pollCount := atomic.NewInt32(0) + done := make(chan struct{}) + var hostSpecificTl sync.Once + var commonTl sync.Once + s.service.EXPECT().DescribeDomain(gomock.Any(), gomock.Any(), callOptions()...).Return(nil, nil).AnyTimes() + s.service.EXPECT().PollForActivityTask(gomock.Any(), gomock.Any(), callOptions()...).DoAndReturn(func(ctx context.Context, request *m.PollForActivityTaskRequest, opts ...yarpc.CallOption) (*m.PollForActivityTaskResponse, error) { + // The host-specific TL is a random UUID and the + if strings.Contains(request.TaskList.GetName(), "@") && request.TaskList.GetKind() == m.TaskListKindEphemeral { + hostSpecificTl.Do(func() { + if pollCount.Add(1) == 2 { + close(done) + } + }) + } + // The common creation TL + if request.TaskList.GetName() == "test-tl__internal_session_creation" && request.TaskList.GetKind() == m.TaskListKindNormal { + commonTl.Do(func() { + if pollCount.Add(1) == 2 { + close(done) + } + }) + } + return &m.PollForActivityTaskResponse{}, nil + }).AnyTimes() + options := WorkerOptions{ + Logger: testlogger.NewZap(s.T()), + DisableActivityWorker: true, + DisableWorkflowWorker: true, + EnableSessionWorker: true, + Identity: "test-worker-identity", + FeatureFlags: FeatureFlags{EphemeralTaskListsEnabled: true}, + } + worker, err := newAggregatedWorker(s.service, domain, "test-tl", options) + s.NoError(err, "worked to create worker") + + err = worker.Start() + s.NoError(err, "worker failed to start") + defer worker.Stop() + + // Wait for both to complete + select { + case <-ctx.Done(): + s.Fail("Timed out") + case <-done: + } +} + // wait for test to complete - timeout and fail after 10 seconds to not block execution of other tests func startWorkerAndWait(s *WorkersTestSuite, worker *aggregatedWorker, doneCh *chan struct{}) { s.T().Helper() diff --git a/internal/internal_workflow_testsuite.go b/internal/internal_workflow_testsuite.go index 53bce4061..80583e622 100644 --- a/internal/internal_workflow_testsuite.go +++ b/internal/internal_workflow_testsuite.go @@ -326,6 +326,7 @@ func newTestWorkflowEnvironmentImpl(s *WorkflowTestSuite, parentRegistry *regist env.service = mockService + env.workerOptions.FeatureFlags = FeatureFlags{EphemeralTaskListsEnabled: true} if env.workerOptions.Logger == nil { env.workerOptions.Logger = env.logger } @@ -1632,7 +1633,7 @@ func (env *testWorkflowEnvironmentImpl) newTestActivityTaskHandler(taskList stri wOptions.DataConverter = dataConverter params := workerExecutionParameters{ WorkerOptions: wOptions, - TaskList: taskList, + TaskList: &shared.TaskList{Name: common.StringPtr(taskList), Kind: shared.TaskListKindNormal.Ptr()}, UserContext: wOptions.BackgroundActivityContext, WorkerStopChannel: env.workerStopChannel, } @@ -2163,6 +2164,10 @@ func (env *testWorkflowEnvironmentImpl) GetWorkflowInterceptors() []WorkflowInte return env.workflowInterceptors } +func (env *testWorkflowEnvironmentImpl) GetFeatureFlags() FeatureFlags { + return env.workerOptions.FeatureFlags +} + func newTestSessionEnvironment(testWorkflowEnvironment *testWorkflowEnvironmentImpl, params *workerExecutionParameters, concurrentSessionExecutionSize int) *testSessionEnvironmentImpl { resourceID := params.SessionResourceID diff --git a/internal/workflow.go b/internal/workflow.go index 51313a885..5a74949d6 100644 --- a/internal/workflow.go +++ b/internal/workflow.go @@ -772,8 +772,12 @@ func (wc *workflowEnvironmentInterceptor) ExecuteActivity(ctx Context, typeName // Use session tasklist oldTaskListName := options.TaskListName options.TaskListName = sessionInfo.tasklist + if wc.env.GetFeatureFlags().EphemeralTaskListsEnabled { + options.TaskListKind = s.TaskListKindEphemeral + } defer func() { options.TaskListName = oldTaskListName + options.TaskListKind = s.TaskListKindNormal }() } } diff --git a/internal/workflow_replayer.go b/internal/workflow_replayer.go index f64d6a89c..6db1de6d7 100644 --- a/internal/workflow_replayer.go +++ b/internal/workflow_replayer.go @@ -324,7 +324,10 @@ func (r *WorkflowReplayer) replayWorkflowHistory( Logger: logger, DisableStickyExecution: true, }, - TaskList: replayTaskListName, + TaskList: &shared.TaskList{ + Name: common.StringPtr(replayTaskListName), + Kind: shared.TaskListKindNormal.Ptr(), + }, } metricScope := tally.NoopScope diff --git a/internal/workflow_replayer_test.go b/internal/workflow_replayer_test.go index 98dbf1dba..6818ea5d4 100644 --- a/internal/workflow_replayer_test.go +++ b/internal/workflow_replayer_test.go @@ -46,7 +46,7 @@ type workflowReplayerSuite struct { } var ( - testTaskList = "taskList" + testTaskList = &shared.TaskList{Name: common.StringPtr("testTaskList"), Kind: shared.TaskListKindNormal.Ptr()} ) func TestWorkflowReplayerSuite(t *testing.T) { @@ -311,7 +311,7 @@ func getTestReplayWorkflowFullHistory(t *testing.T) *shared.History { Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflow")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), @@ -320,7 +320,7 @@ func getTestReplayWorkflowFullHistory(t *testing.T) *shared.History { createTestEventActivityTaskScheduled(5, &shared.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &shared.ActivityType{Name: common.StringPtr("testActivity")}, - TaskList: &shared.TaskList{Name: &testTaskList}, + TaskList: testTaskList, }), createTestEventActivityTaskStarted(6, &shared.ActivityTaskStartedEventAttributes{ ScheduledEventId: common.Int64Ptr(5), @@ -347,7 +347,7 @@ func getTestReplayWorkflowPartialHistoryWithDecisionEvents(t *testing.T) *shared Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflow")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), @@ -356,7 +356,7 @@ func getTestReplayWorkflowPartialHistoryWithDecisionEvents(t *testing.T) *shared createTestEventActivityTaskScheduled(5, &shared.ActivityTaskScheduledEventAttributes{ ActivityId: common.StringPtr("0"), ActivityType: &shared.ActivityType{Name: common.StringPtr("testActivity-fm")}, - TaskList: &shared.TaskList{Name: &testTaskList}, + TaskList: testTaskList, }), }, } @@ -367,7 +367,7 @@ func getTestReplayWorkflowPartialHistoryNoDecisionEvents(t *testing.T) *shared.H Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflow")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), @@ -404,7 +404,7 @@ func getTestReplayWorkflowLocalActivityHistory(t *testing.T) *shared.History { Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflowLocalActivity")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), @@ -429,7 +429,7 @@ func getTestReplayWorkflowLocalActivityResultMismatchHistory(t *testing.T) *shar Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflowLocalActivity")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), @@ -455,7 +455,7 @@ func getTestReplayWorkflowLocalActivityTypeMismatchHistory(t *testing.T) *shared Events: []*shared.HistoryEvent{ createTestEventWorkflowExecutionStarted(1, &shared.WorkflowExecutionStartedEventAttributes{ WorkflowType: &shared.WorkflowType{Name: common.StringPtr("go.uber.org/cadence/internal.testReplayWorkflowLocalActivity")}, - TaskList: &shared.TaskList{Name: common.StringPtr(testTaskList)}, + TaskList: testTaskList, Input: testEncodeFunctionArgs(t, getDefaultDataConverter()), }), createTestEventDecisionTaskScheduled(2, &shared.DecisionTaskScheduledEventAttributes{}), diff --git a/internal/workflow_shadower_worker.go b/internal/workflow_shadower_worker.go index 5669dcfd9..6647684b8 100644 --- a/internal/workflow_shadower_worker.go +++ b/internal/workflow_shadower_worker.go @@ -72,12 +72,15 @@ func newShadowWorker( replayer.registry = registry ensureRequiredParams(¶ms) - if len(params.TaskList) != 0 { + if params.TaskList.GetName() != "" { // include domain name in tasklist to avoid confliction // since all shadow workflow will be run in a single system domain - params.TaskList = generateShadowTaskList(domain, params.TaskList) - params.MetricsScope = tagScope(params.MetricsScope, tagTaskList, params.TaskList) - params.Logger = params.Logger.With(zap.String(tagTaskList, params.TaskList)) + params.TaskList = &shared.TaskList{ + Name: common.StringPtr(generateShadowTaskList(domain, params.TaskList.GetName())), + Kind: params.TaskList.GetKind().Ptr(), + } + params.MetricsScope = tagScope(params.MetricsScope, tagTaskList, params.TaskList.GetName()) + params.Logger = params.Logger.With(zap.String(tagTaskList, params.TaskList.GetName())) } params.UserContext = context.WithValue(params.UserContext, serviceClientContextKey, service) @@ -105,7 +108,7 @@ func newShadowWorker( service: service, domain: domain, - taskList: params.TaskList, + taskList: params.TaskList.GetName(), options: shadowOptions, logger: params.Logger, featureFlags: params.FeatureFlags, diff --git a/internal/workflow_shadower_worker_test.go b/internal/workflow_shadower_worker_test.go index bb55ee1a5..52e36e3ff 100644 --- a/internal/workflow_shadower_worker_test.go +++ b/internal/workflow_shadower_worker_test.go @@ -90,7 +90,7 @@ func (s *shadowWorkerSuite) TestNewShadowWorker() { s.True(ok) taskList := shadowWorker.activityWorker.executionParameters.TaskList - s.Contains(taskList, testDomain) + s.Contains(taskList.GetName(), testDomain) } func (s *shadowWorkerSuite) TestStartShadowWorker_Failed_InvalidShadowOption() { @@ -228,7 +228,7 @@ func (s *shadowWorkerSuite) TestStartShadowWorker_Succeed() { var workflowParams shadower.WorkflowParams getDefaultDataConverter().FromData(startRequest.Input, &workflowParams) s.Equal(testDomain, workflowParams.GetDomain()) - s.Equal(generateShadowTaskList(testDomain, testTaskList), workflowParams.GetTaskList()) + s.Equal(generateShadowTaskList(testDomain, testTaskList.GetName()), workflowParams.GetTaskList()) s.Equal(workflowQuery, workflowParams.GetWorkflowQuery()) s.Equal(samplingRate, workflowParams.GetSamplingRate()) s.Equal(shadowMode.toThriftPtr(), workflowParams.ShadowMode) diff --git a/test/integration_test.go b/test/integration_test.go index c1e6dcfb3..204fcfe38 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -161,6 +161,7 @@ func (ts *IntegrationTestSuite) BeforeTest(suiteName, testName string) { Logger: zaptest.NewLogger(ts.T()), WorkflowInterceptorChainFactories: []interceptors.WorkflowInterceptorFactory{ts.tracer}, ContextPropagators: []workflow.ContextPropagator{NewStringMapPropagator([]string{testContextKey})}, + EnableSessionWorker: true, } if testName == "TestNonDeterministicWorkflowQuery" || testName == "TestNonDeterministicWorkflowFailPolicy" { @@ -169,6 +170,11 @@ func (ts *IntegrationTestSuite) BeforeTest(suiteName, testName string) { // disable sticky executon so each workflow yield will require rerunning it from beginning options.DisableStickyExecution = true } + if testName == "TestSession_Ephemeral" { + options.FeatureFlags = internal.FeatureFlags{ + EphemeralTaskListsEnabled: true, + } + } ts.worker = worker.New(ts.rpcClient.Interface, domainName, ts.taskListName, options) ts.registerWorkflowsAndActivities(ts.worker) @@ -583,6 +589,16 @@ func (ts *IntegrationTestSuite) TestOverrideSpanContext() { ts.Equal("some-value", result["mockpfx-baggage-some-key"]) } +func (ts *IntegrationTestSuite) TestSession() { + _, err := ts.executeWorkflow("test-session", ts.workflows.Session, nil) + ts.NoError(err) +} + +func (ts *IntegrationTestSuite) TestSession_Ephemeral() { + // Ephemeral TaskList is enabled by the test name + ts.TestSession() +} + // TestVersionedWorkflowV1 tests that a workflow started on the worker with VersionedWorkflowV1 // can be replayed on worker with VersionedWorkflowV2 and VersionedWorkflowV3, // but not on VersionedWorkflowV4, VersionedWorkflowV5, VersionedWorkflowV6. diff --git a/test/workflow_test.go b/test/workflow_test.go index e53403477..5975492d4 100644 --- a/test/workflow_test.go +++ b/test/workflow_test.go @@ -659,6 +659,29 @@ func (w *Workflows) OverrideSpanContext(ctx workflow.Context) (map[string]string return res, err } +func (w *Workflows) Session(ctx workflow.Context) error { + ctx = workflow.WithActivityOptions(ctx, w.defaultActivityOptions()) + + so := &workflow.SessionOptions{ + CreationTimeout: time.Second * 10, + ExecutionTimeout: time.Second * 10, + } + sessionCtx, err := workflow.CreateSession(ctx, so) + if err != nil { + return err + } + defer workflow.CompleteSession(sessionCtx) + var expected string + if err = workflow.ExecuteActivity(ctx, "Prefix_ToUpper", "hello").Get(ctx, &expected); err != nil { + return err + } + if expected != "HELLO" { + return fmt.Errorf("expected 'HELLO', got %s", expected) + } + + return nil +} + func (w *Workflows) register(worker worker.Worker) { // Kept to verify backward compatibility of workflow registration. workflow.RegisterWithOptions(w.Basic, workflow.RegisterOptions{DisableAlreadyRegisteredCheck: true}) @@ -689,6 +712,7 @@ func (w *Workflows) register(worker worker.Worker) { worker.RegisterWorkflow(w.WorkflowWithLocalActivityCtxPropagation) worker.RegisterWorkflow(w.NonDeterminismSimulatorWorkflow) worker.RegisterWorkflow(w.OverrideSpanContext) + worker.RegisterWorkflow(w.Session) }