Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ jobs:
DISABLE_SERVER_1_27_TESTS: "1"
DISABLE_PRIORITY_TESTS: "1"
DISABLE_STANDALONE_ACTIVITY_TESTS: "1"
DISABLE_STANDALONE_NEXUS_TESTS: "1"
DISABLE_NEXUS_CALLER_TIMEOUT_TESTS: "1"
DISABLE_NEW_NEXUS_ERROR_FORMAT_TESTS: "1"
working-directory: ./internal/cmd/build
Expand Down
110 changes: 110 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,92 @@ type (
// NOTE: Experimental
TerminateActivityOptions = internal.ClientTerminateActivityOptions

// StartNexusOperationOptions contains configuration parameters for starting a Nexus operation execution.
//
// NOTE: Experimental
StartNexusOperationOptions = internal.ClientStartNexusOperationOptions

// NexusClientOptions contains options for creating a NexusClient.
//
// NOTE: Experimental
NexusClientOptions = internal.ClientNexusClientOptions

// NexusClient is the client for starting Nexus operations bound to a specific endpoint and service.
// This is for standalone Nexus operations outside of workflow context.
// For Nexus operations within workflows, use workflow.NexusClient.
//
// NOTE: Experimental
NexusClient = internal.ClientNexusClient

// NexusOperationHandle represents a running or completed standalone Nexus operation execution.
// It can be used to get the result, describe, cancel, or terminate the operation.
//
// NOTE: Experimental
NexusOperationHandle = internal.ClientNexusOperationHandle

// NexusOperationMetadata contains information about a Nexus operation execution.
// This is returned by ListNexusOperations and embedded in NexusOperationExecutionDescription.
//
// NOTE: Experimental
NexusOperationMetadata = internal.ClientNexusOperationMetadata

// NexusOperationExecutionDescription contains detailed information about a Nexus operation execution.
// This is returned by NexusOperationHandle.Describe.
//
// NOTE: Experimental
NexusOperationExecutionDescription = internal.ClientNexusOperationExecutionDescription

// NexusOperationCancellationInfo contains cancellation information for a Nexus operation.
//
// NOTE: Experimental
NexusOperationCancellationInfo = internal.ClientNexusOperationCancellationInfo

// DescribeNexusOperationOptions contains options for NexusOperationHandle.Describe call.
//
// NOTE: Experimental
DescribeNexusOperationOptions = internal.ClientDescribeNexusOperationOptions

// CancelNexusOperationOptions contains options for NexusOperationHandle.Cancel call.
//
// NOTE: Experimental
CancelNexusOperationOptions = internal.ClientCancelNexusOperationOptions

// TerminateNexusOperationOptions contains options for NexusOperationHandle.Terminate call.
//
// NOTE: Experimental
TerminateNexusOperationOptions = internal.ClientTerminateNexusOperationOptions

// ListNexusOperationsOptions contains input for ListNexusOperations call.
//
// NOTE: Experimental
ListNexusOperationsOptions = internal.ClientListNexusOperationsOptions

// CountNexusOperationsOptions contains input for CountNexusOperations call.
//
// NOTE: Experimental
CountNexusOperationsOptions = internal.ClientCountNexusOperationsOptions

// CountNexusOperationsResult contains the result of the CountNexusOperations call.
//
// NOTE: Experimental
CountNexusOperationsResult = internal.ClientCountNexusOperationsResult

// CountNexusOperationsAggregationGroup contains groups of Nexus operations if
// CountNexusOperationExecutions is grouped by a field.
//
// NOTE: Experimental
CountNexusOperationsAggregationGroup = internal.ClientCountNexusOperationsAggregationGroup

// ListNexusOperationsResult contains the result of the ListNexusOperations call.
//
// NOTE: Experimental
ListNexusOperationsResult = internal.ClientListNexusOperationsResult

// GetNexusOperationHandleOptions contains input for GetNexusOperationHandle call.
//
// NOTE: Experimental
GetNexusOperationHandleOptions = internal.ClientGetNexusOperationHandleOptions

// Client is the client for starting and getting information about a workflow executions as well as
// completing activities asynchronously.
Client interface {
Expand Down Expand Up @@ -1504,6 +1590,30 @@ type (
// NOTE: Experimental
CountActivities(ctx context.Context, options CountActivitiesOptions) (*CountActivitiesResult, error)

// NewNexusClient creates a new Nexus client bound to the given endpoint and service.
// This is for standalone Nexus operations outside of workflow context.
// For Nexus operations within workflows, use workflow.NexusClient instead.
//
// NOTE: Experimental
NewNexusClient(options NexusClientOptions) (NexusClient, error)

// GetNexusOperationHandle creates a handle to the referenced Nexus operation.
// No network call is made. The handle can be used to poll, describe, cancel, or terminate.
//
// NOTE: Experimental
GetNexusOperationHandle(options GetNexusOperationHandleOptions) NexusOperationHandle
Comment thread
jmaeagle99 marked this conversation as resolved.

// ListNexusOperations lists Nexus operation executions based on query.
// Currently, all errors are returned in the iterator and not the base level error.
//
// NOTE: Experimental
ListNexusOperations(ctx context.Context, options ListNexusOperationsOptions) (ListNexusOperationsResult, error)

// CountNexusOperations counts Nexus operation executions based on query.
//
// NOTE: Experimental
CountNexusOperations(ctx context.Context, options CountNexusOperationsOptions) (*CountNexusOperationsResult, error)

// WorkflowService provides access to the underlying gRPC service. This should only be used for advanced use cases
// that cannot be accomplished via other Client methods. Unlike calls to other Client methods, calls directly to the
// service are not configured with internal semantics such as automatic retries.
Expand Down
1 change: 1 addition & 0 deletions contrib/tools/workflowcheck/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/google/go-cmp v0.7.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
go.temporal.io/api v1.62.11 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/sync v0.19.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
Expand Down
2 changes: 2 additions & 0 deletions contrib/tools/workflowcheck/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
go.temporal.io/api v1.62.11 h1:MWDaooDvOJCIRb1atqeZX2ErDPNTsNc3/mMEVEvvaVU=
go.temporal.io/api v1.62.11/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
Expand Down
48 changes: 48 additions & 0 deletions interceptor/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,54 @@ type ClientPollActivityResultInput = internal.ClientPollActivityResultInput
// NOTE: Experimental
type ClientPollActivityResultOutput = internal.ClientPollActivityResultOutput

// ClientExecuteNexusOperationInput is the input to
// ClientOutboundInterceptor.ExecuteNexusOperation.
//
// NOTE: Experimental
type ClientExecuteNexusOperationInput = internal.ClientExecuteNexusOperationInput

// ClientGetNexusOperationHandleInput is the input to
// ClientOutboundInterceptor.GetNexusOperationHandle.
//
// NOTE: Experimental
type ClientGetNexusOperationHandleInput = internal.ClientGetNexusOperationHandleInput

// ClientCancelNexusOperationInput is the input to
// ClientOutboundInterceptor.CancelNexusOperation.
//
// NOTE: Experimental
type ClientCancelNexusOperationInput = internal.ClientCancelNexusOperationInput

// ClientTerminateNexusOperationInput is the input to
// ClientOutboundInterceptor.TerminateNexusOperation.
//
// NOTE: Experimental
type ClientTerminateNexusOperationInput = internal.ClientTerminateNexusOperationInput

// ClientDescribeNexusOperationInput is the input to
// ClientOutboundInterceptor.DescribeNexusOperation.
//
// NOTE: Experimental
type ClientDescribeNexusOperationInput = internal.ClientDescribeNexusOperationInput

// ClientDescribeNexusOperationOutput is the output of
// ClientOutboundInterceptor.DescribeNexusOperation.
//
// NOTE: Experimental
type ClientDescribeNexusOperationOutput = internal.ClientDescribeNexusOperationOutput

// ClientPollNexusOperationResultInput is the input to
// ClientOutboundInterceptor.PollNexusOperationResult.
//
// NOTE: Experimental
type ClientPollNexusOperationResultInput = internal.ClientPollNexusOperationResultInput

// ClientPollNexusOperationResultOutput is the output of
// ClientOutboundInterceptor.PollNexusOperationResult.
//
// NOTE: Experimental
type ClientPollNexusOperationResultOutput = internal.ClientPollNexusOperationResultOutput

// ScheduleClientCreateInput is input for
// ScheduleClientInterceptor.CreateSchedule.
type ScheduleClientCreateInput = internal.ScheduleClientCreateInput
Expand Down
24 changes: 24 additions & 0 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,30 @@ type (
// NOTE: Experimental
CountActivities(ctx context.Context, options ClientCountActivitiesOptions) (*ClientCountActivitiesResult, error)

// NewNexusClient creates a new Nexus client bound to the given endpoint and service.
// This is for standalone Nexus operations outside of workflow context.
// For Nexus operations within workflows, use workflow.NewNexusClient instead.
//
// NOTE: Experimental
NewNexusClient(options ClientNexusClientOptions) (ClientNexusClient, error)

// GetNexusOperationHandle creates a handle to the referenced Nexus operation.
// No network call is made. The handle can be used to poll, describe, cancel, or terminate.
//
// NOTE: Experimental
GetNexusOperationHandle(options ClientGetNexusOperationHandleOptions) ClientNexusOperationHandle

// ListNexusOperations lists Nexus operation executions based on query.
// Currently, all errors are returned in the iterator and not the base level error.
//
// NOTE: Experimental
ListNexusOperations(ctx context.Context, options ClientListNexusOperationsOptions) (ClientListNexusOperationsResult, error)

// CountNexusOperations counts Nexus operation executions based on query.
//
// NOTE: Experimental
CountNexusOperations(ctx context.Context, options ClientCountNexusOperationsOptions) (*ClientCountNexusOperationsResult, error)

// WorkflowService provides access to the underlying gRPC service. This should only be used for advanced use cases
// that cannot be accomplished via other Client methods. Unlike calls to other Client methods, calls directly to the
// service are not configured with internal semantics such as automatic retries.
Expand Down
4 changes: 3 additions & 1 deletion internal/cmd/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (b *builder) integrationTest() error {
if *devServerFlag {
devServer, err := testsuite.StartDevServer(context.Background(), testsuite.DevServerOptions{
CachedDownload: testsuite.CachedDownload{
Version: "v1.7.0",
Version: "v1.7.1-standalone-nexus-operations",
},
ClientOptions: &client.Options{
HostPort: "127.0.0.1:7233",
Expand Down Expand Up @@ -160,6 +160,8 @@ func (b *builder) integrationTest() error {
"--dynamic-config-value", "history.enableTransitionHistory=true",
"--dynamic-config-value", `component.nexusoperations.useSystemCallbackURL=false`,
"--dynamic-config-value", `component.nexusoperations.callback.endpoint.template="http://localhost:7243/namespaces/{{.NamespaceName}}/nexus/callback"`,
"--dynamic-config-value", "nexusoperation.enableStandalone=true",
"--dynamic-config-value", "history.enableChasmCallbacks=true",
"--dynamic-config-value", "frontend.ListWorkersEnabled=true",
},
})
Expand Down
124 changes: 124 additions & 0 deletions internal/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,36 @@ type ClientOutboundInterceptor interface {
// NOTE: Experimental
PollActivityResult(context.Context, *ClientPollActivityResultInput) (*ClientPollActivityResultOutput, error)

// ExecuteNexusOperation intercepts NexusClient.ExecuteOperation.
//
// NOTE: Experimental
ExecuteNexusOperation(context.Context, *ClientExecuteNexusOperationInput) (ClientNexusOperationHandle, error)

// GetNexusOperationHandle intercepts client.Client.GetNexusOperationHandle.
//
// NOTE: Experimental
GetNexusOperationHandle(*ClientGetNexusOperationHandleInput) ClientNexusOperationHandle

// CancelNexusOperation intercepts NexusOperationHandle.Cancel.
//
// NOTE: Experimental
CancelNexusOperation(context.Context, *ClientCancelNexusOperationInput) error

// TerminateNexusOperation intercepts NexusOperationHandle.Terminate.
//
// NOTE: Experimental
TerminateNexusOperation(context.Context, *ClientTerminateNexusOperationInput) error

// DescribeNexusOperation intercepts NexusOperationHandle.Describe.
//
// NOTE: Experimental
DescribeNexusOperation(context.Context, *ClientDescribeNexusOperationInput) (*ClientDescribeNexusOperationOutput, error)

// PollNexusOperationResult intercepts NexusOperationHandle.Get.
//
// NOTE: Experimental
PollNexusOperationResult(context.Context, *ClientPollNexusOperationResultInput) (*ClientPollNexusOperationResultOutput, error)

mustEmbedClientOutboundInterceptorBase()
}

Expand Down Expand Up @@ -670,6 +700,100 @@ type ClientPollActivityResultOutput struct {
Error error
}

// ClientExecuteNexusOperationInput is the input to
// ClientOutboundInterceptor.ExecuteNexusOperation.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientExecuteNexusOperationInput]
type ClientExecuteNexusOperationInput struct {
Options *ClientStartNexusOperationOptions
Endpoint string
Service string
OperationType string
Input interface{}
}

// ClientGetNexusOperationHandleInput is the input to
// ClientOutboundInterceptor.GetNexusOperationHandle.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientGetNexusOperationHandleInput]
type ClientGetNexusOperationHandleInput struct {
OperationID string
RunID string
}

// ClientCancelNexusOperationInput is the input to
// ClientOutboundInterceptor.CancelNexusOperation.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientCancelNexusOperationInput]
type ClientCancelNexusOperationInput struct {
OperationID string
RunID string
Reason string
}

// ClientTerminateNexusOperationInput is the input to
// ClientOutboundInterceptor.TerminateNexusOperation.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientTerminateNexusOperationInput]
type ClientTerminateNexusOperationInput struct {
OperationID string
RunID string
Reason string
}

// ClientDescribeNexusOperationInput is the input to
// ClientOutboundInterceptor.DescribeNexusOperation.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientDescribeNexusOperationInput]
type ClientDescribeNexusOperationInput struct {
OperationID string
RunID string
}

// ClientDescribeNexusOperationOutput is the output of
// ClientOutboundInterceptor.DescribeNexusOperation.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientDescribeNexusOperationOutput]
type ClientDescribeNexusOperationOutput struct {
Description *ClientNexusOperationExecutionDescription
}

// ClientPollNexusOperationResultInput is the input to
// ClientOutboundInterceptor.PollNexusOperationResult.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientPollNexusOperationResultInput]
type ClientPollNexusOperationResultInput struct {
OperationID string
RunID string
}

// ClientPollNexusOperationResultOutput is the output of
// ClientOutboundInterceptor.PollNexusOperationResult.
//
// NOTE: Experimental
//
// Exposed as: [go.temporal.io/sdk/interceptor.ClientPollNexusOperationResultOutput]
type ClientPollNexusOperationResultOutput struct {
// Result is the result of the operation, if it has completed successfully.
Result converter.EncodedValue
// Error is the result of a failed operation.
Error error
}

// NexusOutboundInterceptor intercepts Nexus operation method invocations. See documentation in the interceptor package
// for more details.
//
Expand Down
Loading
Loading