From 2abbf90493622555ea505398bebc7122d4815387 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 21 Nov 2024 01:51:55 -0800 Subject: [PATCH 1/7] Added a `count` method to the workflow client, a higher-level user-friendlier option to using the corresponding GRPC method directly. --- packages/client/src/helpers.ts | 28 ++++++++++++++- packages/client/src/types.ts | 15 +++++++- packages/client/src/workflow-client.ts | 25 ++++++++++++- .../test/src/test-integration-workflows.ts | 36 ++++++++++++++++++- 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/packages/client/src/helpers.ts b/packages/client/src/helpers.ts index 4682be663..1d2df113b 100644 --- a/packages/client/src/helpers.ts +++ b/packages/client/src/helpers.ts @@ -10,7 +10,15 @@ import { Replace } from '@temporalio/common/lib/type-helpers'; import { optionalTsToDate, requiredTsToDate } from '@temporalio/common/lib/time'; import { decodeMapFromPayloads } from '@temporalio/common/lib/internal-non-workflow/codec-helpers'; import { temporal, google } from '@temporalio/proto'; -import { RawWorkflowExecutionInfo, WorkflowExecutionInfo, WorkflowExecutionStatusName } from './types'; +import { + CountWorkflowExecution, + CountWorkflowExecutionsAggregationGroup, + RawCountWorkflowExecutions, + RawCountWorkflowExecutionsAggregationGroup, + RawWorkflowExecutionInfo, + WorkflowExecutionInfo, + WorkflowExecutionStatusName, +} from './types'; function workflowStatusCodeToName(code: temporal.api.enums.v1.WorkflowExecutionStatus): WorkflowExecutionStatusName { return workflowStatusCodeToNameInternal(code) ?? 'UNKNOWN'; @@ -81,6 +89,24 @@ export async function executionInfoFromRaw( }; } +export function countWorkflowExecutionFromRaw(raw: RawCountWorkflowExecutions): CountWorkflowExecution { + return { + // Note: lossy conversion of Long to number + count: raw.count!.toNumber(), + groups: raw.groups!.map((group) => executionCountAggregationGroupFromRaw(group)), + }; +} + +export function executionCountAggregationGroupFromRaw( + raw: RawCountWorkflowExecutionsAggregationGroup +): CountWorkflowExecutionsAggregationGroup { + return { + // Note: lossy conversion of Long to number + count: raw.count!.toNumber(), + group_values: raw.groupValues!.map((group_value) => searchAttributePayloadConverter.fromPayload(group_value)), + }; +} + type ErrorDetailsName = `temporal.api.errordetails.v1.${keyof typeof temporal.api.errordetails.v1}`; /** diff --git a/packages/client/src/types.ts b/packages/client/src/types.ts index bfc495031..26e94353e 100644 --- a/packages/client/src/types.ts +++ b/packages/client/src/types.ts @@ -1,5 +1,5 @@ import type * as grpc from '@grpc/grpc-js'; -import type { SearchAttributes } from '@temporalio/common'; +import type { SearchAttributes, SearchAttributeValue } from '@temporalio/common'; import { makeProtoEnumConverters } from '@temporalio/common/lib/internal-workflow'; import * as proto from '@temporalio/proto'; import { Replace } from '@temporalio/common/lib/type-helpers'; @@ -14,6 +14,9 @@ export type GetWorkflowExecutionHistoryRequest = export type DescribeWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IDescribeWorkflowExecutionResponse; export type RawWorkflowExecutionInfo = proto.temporal.api.workflow.v1.IWorkflowExecutionInfo; +export type RawCountWorkflowExecutions = proto.temporal.api.workflowservice.v1.ICountWorkflowExecutionsResponse; +export type RawCountWorkflowExecutionsAggregationGroup = + proto.temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse.IAggregationGroup; export type TerminateWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.ITerminateWorkflowExecutionResponse; export type RequestCancelWorkflowExecutionResponse = @@ -52,6 +55,16 @@ export interface WorkflowExecutionInfo { raw: RawWorkflowExecutionInfo; } +export interface CountWorkflowExecution { + count: number; + groups: CountWorkflowExecutionsAggregationGroup[]; +} + +export interface CountWorkflowExecutionsAggregationGroup { + count: number; + group_values: SearchAttributeValue[]; +} + export type WorkflowExecutionDescription = Replace< WorkflowExecutionInfo, { diff --git a/packages/client/src/workflow-client.ts b/packages/client/src/workflow-client.ts index 3e0fb0150..8a0c1a561 100644 --- a/packages/client/src/workflow-client.ts +++ b/packages/client/src/workflow-client.ts @@ -58,6 +58,7 @@ import { WorkflowStartUpdateOutput, } from './interceptors'; import { + CountWorkflowExecution, DescribeWorkflowExecutionResponse, encodeQueryRejectCondition, GetWorkflowExecutionHistoryRequest, @@ -77,7 +78,7 @@ import { WorkflowStartOptions, WorkflowUpdateOptions, } from './workflow-options'; -import { executionInfoFromRaw, rethrowKnownErrorTypes } from './helpers'; +import { countWorkflowExecutionFromRaw, executionInfoFromRaw, rethrowKnownErrorTypes } from './helpers'; import { BaseClient, BaseClientOptions, @@ -1308,6 +1309,28 @@ export class WorkflowClient extends BaseClient { }; } + /** + * Return workflow execution count by given `query`. + * + * ⚠️ To use advanced query functionality, as of the 1.18 server release, you must use Elasticsearch based visibility. + * + * More info on the concept of "visibility" and the query syntax on the Temporal documentation site: + * https://docs.temporal.io/visibility + */ + public async count(query?: string): Promise { + let response: temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse; + try { + response = await this.workflowService.countWorkflowExecutions({ + namespace: this.options.namespace, + query, + }); + } catch (e) { + this.rethrowGrpcError(e, 'Failed to count workflows', undefined); + } + + return countWorkflowExecutionFromRaw(response); + } + protected getOrMakeInterceptors(workflowId: string, runId?: string): WorkflowClientInterceptor[] { if (typeof this.options.interceptors === 'object' && 'calls' in this.options.interceptors) { // eslint-disable-next-line deprecation/deprecation diff --git a/packages/test/src/test-integration-workflows.ts b/packages/test/src/test-integration-workflows.ts index 727e4fc70..9911a3471 100644 --- a/packages/test/src/test-integration-workflows.ts +++ b/packages/test/src/test-integration-workflows.ts @@ -1,7 +1,7 @@ import { randomUUID } from 'crypto'; import { ExecutionContext } from 'ava'; import { firstValueFrom, Subject } from 'rxjs'; -import { WorkflowFailedError } from '@temporalio/client'; +import { CountWorkflowExecution, WorkflowFailedError } from '@temporalio/client'; import * as activity from '@temporalio/activity'; import { msToNumber, tsToMs } from '@temporalio/common/lib/time'; import { TestWorkflowEnvironment } from '@temporalio/testing'; @@ -1264,3 +1264,37 @@ export const interceptors: workflow.WorkflowInterceptorsFactory = () => { } return {}; }; + +export async function completableWorkflow(completes: boolean): Promise { + await workflow.condition(() => completes); +} + +test('Count workflow executions', async (t) => { + const { taskQueue, createWorker, executeWorkflow, startWorkflow } = helpers(t); + const worker = await createWorker(); + const client = t.context.env.client; + + await worker.runUntil(async () => { + // Run 3 workflows that complete. + for (let i = 0; i < 3; i++) { + await executeWorkflow(completableWorkflow, { args: [true] }); + } + }); + + // Run 2 workflows that don't complete + // (use startWorkflow to avoid waiting for workflows to complete, which they never will) + for (let i = 0; i < 2; i++) { + await startWorkflow(completableWorkflow, { args: [false] }); + } + + const actual = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`); + const expected: CountWorkflowExecution = { + count: 5, + groups: [ + { count: 2, group_values: [['Runningggg']] }, + { count: 3, group_values: [['Completedddd']] }, + ], + }; + + t.deepEqual(expected, actual); +}); From f2110f1394c2b38edc0b0e663fb73a2ff7f0567a Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 21 Nov 2024 15:29:54 -0800 Subject: [PATCH 2/7] Review changes, fixed failing integration test. --- packages/client/src/helpers.ts | 4 +- packages/client/src/types.ts | 2 +- packages/client/src/workflow-client.ts | 6 +-- .../test/src/test-integration-workflows.ts | 38 ++++++++++++------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/packages/client/src/helpers.ts b/packages/client/src/helpers.ts index 1d2df113b..4e01d4257 100644 --- a/packages/client/src/helpers.ts +++ b/packages/client/src/helpers.ts @@ -89,7 +89,7 @@ export async function executionInfoFromRaw( }; } -export function countWorkflowExecutionFromRaw(raw: RawCountWorkflowExecutions): CountWorkflowExecution { +export function decodeCountWorkflowExecutionsResponse(raw: RawCountWorkflowExecutions): CountWorkflowExecution { return { // Note: lossy conversion of Long to number count: raw.count!.toNumber(), @@ -103,7 +103,7 @@ export function executionCountAggregationGroupFromRaw( return { // Note: lossy conversion of Long to number count: raw.count!.toNumber(), - group_values: raw.groupValues!.map((group_value) => searchAttributePayloadConverter.fromPayload(group_value)), + groupValues: raw.groupValues!.map((group_value) => searchAttributePayloadConverter.fromPayload(group_value)), }; } diff --git a/packages/client/src/types.ts b/packages/client/src/types.ts index 26e94353e..0e0f2d179 100644 --- a/packages/client/src/types.ts +++ b/packages/client/src/types.ts @@ -62,7 +62,7 @@ export interface CountWorkflowExecution { export interface CountWorkflowExecutionsAggregationGroup { count: number; - group_values: SearchAttributeValue[]; + groupValues: SearchAttributeValue[]; } export type WorkflowExecutionDescription = Replace< diff --git a/packages/client/src/workflow-client.ts b/packages/client/src/workflow-client.ts index 8a0c1a561..b97c45eb0 100644 --- a/packages/client/src/workflow-client.ts +++ b/packages/client/src/workflow-client.ts @@ -78,7 +78,7 @@ import { WorkflowStartOptions, WorkflowUpdateOptions, } from './workflow-options'; -import { countWorkflowExecutionFromRaw, executionInfoFromRaw, rethrowKnownErrorTypes } from './helpers'; +import { decodeCountWorkflowExecutionsResponse, executionInfoFromRaw, rethrowKnownErrorTypes } from './helpers'; import { BaseClient, BaseClientOptions, @@ -1325,10 +1325,10 @@ export class WorkflowClient extends BaseClient { query, }); } catch (e) { - this.rethrowGrpcError(e, 'Failed to count workflows', undefined); + this.rethrowGrpcError(e, 'Failed to count workflows'); } - return countWorkflowExecutionFromRaw(response); + return decodeCountWorkflowExecutionsResponse(response); } protected getOrMakeInterceptors(workflowId: string, runId?: string): WorkflowClientInterceptor[] { diff --git a/packages/test/src/test-integration-workflows.ts b/packages/test/src/test-integration-workflows.ts index 9911a3471..be7086f02 100644 --- a/packages/test/src/test-integration-workflows.ts +++ b/packages/test/src/test-integration-workflows.ts @@ -15,7 +15,8 @@ import { activityStartedSignal } from './workflows/definitions'; import * as workflows from './workflows'; import { Context, helpers, makeTestFunction } from './helpers-integration'; import { overrideSdkInternalFlag } from './mock-internal-flags'; -import { asSdkLoggerSink, loadHistory, RUN_TIME_SKIPPING_TESTS } from './helpers'; +import { asSdkLoggerSink, loadHistory, RUN_TIME_SKIPPING_TESTS, waitUntil } from './helpers'; +import asyncRetry from 'async-retry'; const test = makeTestFunction({ workflowsPath: __filename, @@ -1274,27 +1275,36 @@ test('Count workflow executions', async (t) => { const worker = await createWorker(); const client = t.context.env.client; - await worker.runUntil(async () => { - // Run 3 workflows that complete. - for (let i = 0; i < 3; i++) { - await executeWorkflow(completableWorkflow, { args: [true] }); - } - }); - // Run 2 workflows that don't complete // (use startWorkflow to avoid waiting for workflows to complete, which they never will) for (let i = 0; i < 2; i++) { await startWorkflow(completableWorkflow, { args: [false] }); } - const actual = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`); - const expected: CountWorkflowExecution = { + await worker.runUntil(async () => { + try { + // Run 3 workflows that complete. + await Promise.all([ + executeWorkflow(completableWorkflow, { args: [true] }), + executeWorkflow(completableWorkflow, { args: [true] }), + executeWorkflow(completableWorkflow, { args: [true] }) + ]) + } catch (err) { + throw new Error('executing workflow unexpectedly failed') + }; + }); + + const actualTotal = await client.workflow.count(`TaskQueue = '${taskQueue}'`); + t.deepEqual(actualTotal, { count: 5, groups: [] }); + + const expectedByExecutionStatus: CountWorkflowExecution = { count: 5, groups: [ - { count: 2, group_values: [['Runningggg']] }, - { count: 3, group_values: [['Completedddd']] }, + { count: 2, groupValues: [['Running']] }, + { count: 3, groupValues: [['Completed']] }, ], }; - - t.deepEqual(expected, actual); + + const actualByExecutionStatus = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`); + t.deepEqual(actualByExecutionStatus, expectedByExecutionStatus); }); From 7887dcccfe6ff7b97e8a74292fdfc1acee1fd624 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 21 Nov 2024 15:40:06 -0800 Subject: [PATCH 3/7] Linting fix --- packages/test/src/test-integration-workflows.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/test/src/test-integration-workflows.ts b/packages/test/src/test-integration-workflows.ts index be7086f02..54b14e44c 100644 --- a/packages/test/src/test-integration-workflows.ts +++ b/packages/test/src/test-integration-workflows.ts @@ -1,6 +1,7 @@ import { randomUUID } from 'crypto'; import { ExecutionContext } from 'ava'; import { firstValueFrom, Subject } from 'rxjs'; +import asyncRetry from 'async-retry'; import { CountWorkflowExecution, WorkflowFailedError } from '@temporalio/client'; import * as activity from '@temporalio/activity'; import { msToNumber, tsToMs } from '@temporalio/common/lib/time'; @@ -16,7 +17,6 @@ import * as workflows from './workflows'; import { Context, helpers, makeTestFunction } from './helpers-integration'; import { overrideSdkInternalFlag } from './mock-internal-flags'; import { asSdkLoggerSink, loadHistory, RUN_TIME_SKIPPING_TESTS, waitUntil } from './helpers'; -import asyncRetry from 'async-retry'; const test = makeTestFunction({ workflowsPath: __filename, @@ -1287,11 +1287,11 @@ test('Count workflow executions', async (t) => { await Promise.all([ executeWorkflow(completableWorkflow, { args: [true] }), executeWorkflow(completableWorkflow, { args: [true] }), - executeWorkflow(completableWorkflow, { args: [true] }) - ]) + executeWorkflow(completableWorkflow, { args: [true] }), + ]); } catch (err) { - throw new Error('executing workflow unexpectedly failed') - }; + throw new Error('executing workflow unexpectedly failed'); + } }); const actualTotal = await client.workflow.count(`TaskQueue = '${taskQueue}'`); @@ -1304,7 +1304,7 @@ test('Count workflow executions', async (t) => { { count: 3, groupValues: [['Completed']] }, ], }; - + const actualByExecutionStatus = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`); t.deepEqual(actualByExecutionStatus, expectedByExecutionStatus); }); From 40489d83f3cd8735aa9698df8782a01e83dac6df Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Fri, 22 Nov 2024 10:32:59 -0800 Subject: [PATCH 4/7] Lint fix and inlining some types/functions --- packages/client/src/helpers.ts | 25 ++++++++----------- packages/client/src/types.ts | 13 +++------- .../test/src/test-integration-workflows.ts | 19 ++++++-------- 3 files changed, 21 insertions(+), 36 deletions(-) diff --git a/packages/client/src/helpers.ts b/packages/client/src/helpers.ts index 4e01d4257..7d553887f 100644 --- a/packages/client/src/helpers.ts +++ b/packages/client/src/helpers.ts @@ -12,9 +12,6 @@ import { decodeMapFromPayloads } from '@temporalio/common/lib/internal-non-workf import { temporal, google } from '@temporalio/proto'; import { CountWorkflowExecution, - CountWorkflowExecutionsAggregationGroup, - RawCountWorkflowExecutions, - RawCountWorkflowExecutionsAggregationGroup, RawWorkflowExecutionInfo, WorkflowExecutionInfo, WorkflowExecutionStatusName, @@ -89,21 +86,19 @@ export async function executionInfoFromRaw( }; } -export function decodeCountWorkflowExecutionsResponse(raw: RawCountWorkflowExecutions): CountWorkflowExecution { +export function decodeCountWorkflowExecutionsResponse( + raw: temporal.api.workflowservice.v1.ICountWorkflowExecutionsResponse +): CountWorkflowExecution { return { // Note: lossy conversion of Long to number count: raw.count!.toNumber(), - groups: raw.groups!.map((group) => executionCountAggregationGroupFromRaw(group)), - }; -} - -export function executionCountAggregationGroupFromRaw( - raw: RawCountWorkflowExecutionsAggregationGroup -): CountWorkflowExecutionsAggregationGroup { - return { - // Note: lossy conversion of Long to number - count: raw.count!.toNumber(), - groupValues: raw.groupValues!.map((group_value) => searchAttributePayloadConverter.fromPayload(group_value)), + groups: raw.groups!.map((group) => { + return { + // Note: lossy conversion of Long to number + count: group.count!.toNumber(), + groupValues: group.groupValues!.map((value) => searchAttributePayloadConverter.fromPayload(value)), + }; + }), }; } diff --git a/packages/client/src/types.ts b/packages/client/src/types.ts index 0e0f2d179..6dd29ce9d 100644 --- a/packages/client/src/types.ts +++ b/packages/client/src/types.ts @@ -14,9 +14,6 @@ export type GetWorkflowExecutionHistoryRequest = export type DescribeWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.IDescribeWorkflowExecutionResponse; export type RawWorkflowExecutionInfo = proto.temporal.api.workflow.v1.IWorkflowExecutionInfo; -export type RawCountWorkflowExecutions = proto.temporal.api.workflowservice.v1.ICountWorkflowExecutionsResponse; -export type RawCountWorkflowExecutionsAggregationGroup = - proto.temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse.IAggregationGroup; export type TerminateWorkflowExecutionResponse = proto.temporal.api.workflowservice.v1.ITerminateWorkflowExecutionResponse; export type RequestCancelWorkflowExecutionResponse = @@ -57,12 +54,10 @@ export interface WorkflowExecutionInfo { export interface CountWorkflowExecution { count: number; - groups: CountWorkflowExecutionsAggregationGroup[]; -} - -export interface CountWorkflowExecutionsAggregationGroup { - count: number; - groupValues: SearchAttributeValue[]; + groups: { + count: number; + groupValues: SearchAttributeValue[]; + }[]; } export type WorkflowExecutionDescription = Replace< diff --git a/packages/test/src/test-integration-workflows.ts b/packages/test/src/test-integration-workflows.ts index 54b14e44c..d033c018e 100644 --- a/packages/test/src/test-integration-workflows.ts +++ b/packages/test/src/test-integration-workflows.ts @@ -1,7 +1,6 @@ import { randomUUID } from 'crypto'; import { ExecutionContext } from 'ava'; import { firstValueFrom, Subject } from 'rxjs'; -import asyncRetry from 'async-retry'; import { CountWorkflowExecution, WorkflowFailedError } from '@temporalio/client'; import * as activity from '@temporalio/activity'; import { msToNumber, tsToMs } from '@temporalio/common/lib/time'; @@ -16,7 +15,7 @@ import { activityStartedSignal } from './workflows/definitions'; import * as workflows from './workflows'; import { Context, helpers, makeTestFunction } from './helpers-integration'; import { overrideSdkInternalFlag } from './mock-internal-flags'; -import { asSdkLoggerSink, loadHistory, RUN_TIME_SKIPPING_TESTS, waitUntil } from './helpers'; +import { asSdkLoggerSink, loadHistory, RUN_TIME_SKIPPING_TESTS } from './helpers'; const test = makeTestFunction({ workflowsPath: __filename, @@ -1282,16 +1281,12 @@ test('Count workflow executions', async (t) => { } await worker.runUntil(async () => { - try { - // Run 3 workflows that complete. - await Promise.all([ - executeWorkflow(completableWorkflow, { args: [true] }), - executeWorkflow(completableWorkflow, { args: [true] }), - executeWorkflow(completableWorkflow, { args: [true] }), - ]); - } catch (err) { - throw new Error('executing workflow unexpectedly failed'); - } + // Run 3 workflows that complete. + await Promise.all([ + executeWorkflow(completableWorkflow, { args: [true] }), + executeWorkflow(completableWorkflow, { args: [true] }), + executeWorkflow(completableWorkflow, { args: [true] }), + ]); }); const actualTotal = await client.workflow.count(`TaskQueue = '${taskQueue}'`); From 1fa93f9a7127c9503c6c3857b6039aad00002f76 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Mon, 25 Nov 2024 11:48:07 -0800 Subject: [PATCH 5/7] Update doc comments --- packages/client/src/workflow-client.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/client/src/workflow-client.ts b/packages/client/src/workflow-client.ts index b97c45eb0..2b3b9327a 100644 --- a/packages/client/src/workflow-client.ts +++ b/packages/client/src/workflow-client.ts @@ -1286,10 +1286,11 @@ export class WorkflowClient extends BaseClient { } /** - * List workflows by given `query`. - * - * ⚠️ To use advanced query functionality, as of the 1.18 server release, you must use Elasticsearch based visibility. - * + * Return a list of Workflow Executions matching the given `query`. If no `query` is provided, returns the 10 most + * recently closed Workflow Executions. + * + * Note that the list of Workflow Executions returned is approximate and eventually consistent. + * * More info on the concept of "visibility" and the query syntax on the Temporal documentation site: * https://docs.temporal.io/visibility */ @@ -1310,10 +1311,11 @@ export class WorkflowClient extends BaseClient { } /** - * Return workflow execution count by given `query`. - * - * ⚠️ To use advanced query functionality, as of the 1.18 server release, you must use Elasticsearch based visibility. + * Return the number of Workflow Executions matching the given `query`. If no `query` is provided, then return the + * total number of Workflow Executions for this namespace. * + * Note that the number of Workflow Executions returned is approximate and eventually consistent. + * * More info on the concept of "visibility" and the query syntax on the Temporal documentation site: * https://docs.temporal.io/visibility */ From fec196a39487ca8f99b9c0cb357dead809c7419d Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Mon, 25 Nov 2024 11:53:25 -0800 Subject: [PATCH 6/7] Formatting/linting fix --- packages/client/src/workflow-client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/src/workflow-client.ts b/packages/client/src/workflow-client.ts index 2b3b9327a..557f9b6d4 100644 --- a/packages/client/src/workflow-client.ts +++ b/packages/client/src/workflow-client.ts @@ -1288,9 +1288,9 @@ export class WorkflowClient extends BaseClient { /** * Return a list of Workflow Executions matching the given `query`. If no `query` is provided, returns the 10 most * recently closed Workflow Executions. - * + * * Note that the list of Workflow Executions returned is approximate and eventually consistent. - * + * * More info on the concept of "visibility" and the query syntax on the Temporal documentation site: * https://docs.temporal.io/visibility */ @@ -1311,11 +1311,11 @@ export class WorkflowClient extends BaseClient { } /** - * Return the number of Workflow Executions matching the given `query`. If no `query` is provided, then return the + * Return the number of Workflow Executions matching the given `query`. If no `query` is provided, then return the * total number of Workflow Executions for this namespace. * * Note that the number of Workflow Executions returned is approximate and eventually consistent. - * + * * More info on the concept of "visibility" and the query syntax on the Temporal documentation site: * https://docs.temporal.io/visibility */ From 3b5d8e1446431ad1cdd1c15bad306eef43342c44 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Mon, 25 Nov 2024 12:54:02 -0800 Subject: [PATCH 7/7] Removed note about 'default' behaviour for `list` API --- packages/client/src/workflow-client.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/client/src/workflow-client.ts b/packages/client/src/workflow-client.ts index 557f9b6d4..173d03bad 100644 --- a/packages/client/src/workflow-client.ts +++ b/packages/client/src/workflow-client.ts @@ -1286,8 +1286,7 @@ export class WorkflowClient extends BaseClient { } /** - * Return a list of Workflow Executions matching the given `query`. If no `query` is provided, returns the 10 most - * recently closed Workflow Executions. + * Return a list of Workflow Executions matching the given `query`. * * Note that the list of Workflow Executions returned is approximate and eventually consistent. *