-
Notifications
You must be signed in to change notification settings - Fork 122
/
client.ts
32 lines (27 loc) · 967 Bytes
/
client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Client } from '@temporalio/client';
import { example } from './workflows';
async function run() {
const client = new Client();
// @@@SNIPSTART typescript-search-attributes-client
const handle = await client.workflow.start(example, {
taskQueue: 'search-attributes',
workflowId: 'search-attributes-example-0',
searchAttributes: {
CustomIntField: [2],
CustomKeywordListField: ['keywordA', 'keywordB'],
CustomBoolField: [true],
CustomDatetimeField: [new Date()],
CustomTextField: [
'String field is for text. When queried, it will be tokenized for partial match. StringTypeField cannot be used in Order By',
],
},
});
const { searchAttributes } = await handle.describe();
// @@@SNIPEND
console.log('searchAttributes at start:', searchAttributes);
console.log('searchAttributes at end:', await handle.result());
}
run().catch((err) => {
console.error(err);
process.exit(1);
});