diff --git a/client/client.go b/client/client.go index d5030cb67..ad6105f9b 100644 --- a/client/client.go +++ b/client/client.go @@ -401,13 +401,15 @@ type ( // - "(WorkflowID = 'wid1' or (WorkflowType = 'type2' and WorkflowID = 'wid2'))". // - "CloseTime between '2019-08-27T15:04:05+00:00' and '2019-08-28T15:04:05+00:00'". // - to list only open workflow use "CloseTime = missing" - // Advanced queries require ElasticSearch, but simple queries do not. + // For supported operations on different server versions see [Visibility]. // Retrieved workflow executions are sorted by StartTime in descending order when list open workflow, // and sorted by CloseTime in descending order for other queries. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // + // [Visibility]: https://docs.temporal.io/visibility ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error) // ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal @@ -420,25 +422,29 @@ type ( // - serviceerror.Unavailable ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error) - // ScanWorkflow gets workflow executions based on query. This API only works with ElasticSearch, - // and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause + // ScanWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause // (see ListWorkflow for query examples). + // For supported operations on different server versions see [Visibility]. // ScanWorkflow should be used when retrieving large amount of workflows and order is not needed. - // It will use more ElasticSearch resources than ListWorkflow, but will be several times faster + // It will use more resources than ListWorkflow, but will be several times faster // when retrieving millions of workflows. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // + // [Visibility]: https://docs.temporal.io/visibility ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error) - // CountWorkflow gets number of workflow executions based on query. This API only works with ElasticSearch, - // and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause + // CountWorkflow gets number of workflow executions based on query. The query is basically the SQL WHERE clause // (see ListWorkflow for query examples). + // For supported operations on different server versions see [Visibility]. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // + // [Visibility]: https://docs.temporal.io/visibility CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error) // GetSearchAttributes returns valid search attributes keys and value types. diff --git a/internal/client.go b/internal/client.go index de4006de4..5b5e564c3 100644 --- a/internal/client.go +++ b/internal/client.go @@ -233,18 +233,20 @@ type ( // - serviceerror.NamespaceNotFound ListOpenWorkflow(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error) - // ListWorkflow gets workflow executions based on query. This API only works with ElasticSearch, - // and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause, + // ListWorkflow gets workflow executions based on query.The query is basically the SQL WHERE clause, // examples: // - "(WorkflowID = 'wid1' or (WorkflowType = 'type2' and WorkflowID = 'wid2'))". // - "CloseTime between '2019-08-27T15:04:05+00:00' and '2019-08-28T15:04:05+00:00'". // - to list only open workflow use "CloseTime = missing" // Retrieved workflow executions are sorted by StartTime in descending order when list open workflow, // and sorted by CloseTime in descending order for other queries. + // For supported operations on different server versions see [Visibility]. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // + // [Visibility]: https://docs.temporal.io/visibility ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error) // ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal @@ -257,25 +259,28 @@ type ( // - serviceerror.Unavailable ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error) - // ScanWorkflow gets workflow executions based on query. This API only works with ElasticSearch, - // and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause + // ScanWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause // (see ListWorkflow for query examples). // ScanWorkflow should be used when retrieving large amount of workflows and order is not needed. - // It will use more ElasticSearch resources than ListWorkflow, but will be several times faster + // It will use more resources than ListWorkflow, but will be several times faster // when retrieving millions of workflows. + // For supported operations on different server versions see [Visibility]. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // [Visibility]: https://docs.temporal.io/visibility ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error) - // CountWorkflow gets number of workflow executions based on query. This API only works with ElasticSearch, - // and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause + // CountWorkflow gets number of workflow executions based on query. The query is basically the SQL WHERE clause // (see ListWorkflow for query examples). + // For supported operations on different server versions see [Visibility]. // The errors it can return: // - serviceerror.InvalidArgument // - serviceerror.Internal // - serviceerror.Unavailable + // + // [Visibility]: https://docs.temporal.io/visibility CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error) // GetSearchAttributes returns valid search attributes keys and value types. @@ -592,9 +597,11 @@ type ( // Memo - Optional non-indexed info that will be shown in list workflow. Memo map[string]interface{} - // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only - // supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side. + // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes map[string]interface{} // EnableEagerStart - request eager execution for this workflow, if a local worker is available. diff --git a/internal/schedule_client.go b/internal/schedule_client.go index 354315f53..fc34326b8 100644 --- a/internal/schedule_client.go +++ b/internal/schedule_client.go @@ -269,10 +269,12 @@ type ( // On ScheduleHandle.Describe() or ScheduleHandle.Update() Memo will be returned as *commonpb.Payload. Memo map[string]interface{} - // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only - // supported when Temporal server is using advanced visiblity). The key and value type must be registered on Temporal server side. + // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. // On ScheduleHandle.Describe() or ScheduleHandle.Update() SearchAttributes will be returned as *commonpb.Payload. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes map[string]interface{} } @@ -338,9 +340,11 @@ type ( // Memo - Optional non-indexed info that will be shown in list schedules. Memo map[string]interface{} - // SearchAttributes - Optional indexed info that can be used in query of List schedules APIs (only - // supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side. + // SearchAttributes - Optional indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes map[string]interface{} } @@ -395,9 +399,11 @@ type ( // Memo - Non-indexed user supplied information. Memo *commonpb.Memo - // SearchAttributes - Indexed info that can be used in query of List schedules APIs (only - // supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side. + // SearchAttributes - Indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes *commonpb.SearchAttributes } @@ -571,9 +577,11 @@ type ( // Memo - Non-indexed user supplied information. Memo *commonpb.Memo - // SearchAttributes - Indexed info that can be used in query of List schedules APIs (only - // supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side. + // SearchAttributes - Indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes *commonpb.SearchAttributes } @@ -599,7 +607,7 @@ type ( // Create a new Schedule. Create(ctx context.Context, options ScheduleOptions) (ScheduleHandle, error) - // List returns an interator to list all schedules + // List returns an iterator to list all schedules // // Note: When using advanced visibility List is eventually consistent. List(ctx context.Context, options ScheduleListOptions) (ScheduleListIterator, error) diff --git a/internal/workflow.go b/internal/workflow.go index e3d79efa0..01d910314 100644 --- a/internal/workflow.go +++ b/internal/workflow.go @@ -289,9 +289,11 @@ type ( // Memo - Optional non-indexed info that will be shown in list workflow. Memo map[string]interface{} - // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only - // supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side. + // SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side. // Use GetSearchAttributes API to get valid key and corresponding value type. + // For supported operations on different server versions see [Visibility]. + // + // [Visibility]: https://docs.temporal.io/visibility SearchAttributes map[string]interface{} // ParentClosePolicy - Optional policy to decide what to do for the child. @@ -1278,7 +1280,9 @@ func signalExternalWorkflow(ctx Context, workflowID, runID, signalName string, a // "CustomKeywordField": "seattle", // } // -// This is only supported when using ElasticSearch. +// For supported operations on different server versions see [Visibility]. +// +// [Visibility]: https://docs.temporal.io/visibility func UpsertSearchAttributes(ctx Context, attributes map[string]interface{}) error { assertNotInReadOnlyState(ctx) i := getWorkflowOutboundInterceptor(ctx) diff --git a/workflow/workflow.go b/workflow/workflow.go index a808c6779..47f5056ba 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -568,7 +568,9 @@ func GetLastError(ctx Context) error { // "CustomKeywordField": "seattle", // } // -// This is only supported when using ElasticSearch. +// For supported operations on different server versions see [Visibility]. +// +// [Visibility]: https://docs.temporal.io/visibility func UpsertSearchAttributes(ctx Context, attributes map[string]interface{}) error { return internal.UpsertSearchAttributes(ctx, attributes) }