@temporalio/workflow 0.9.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"worker-interface.js","sourceRoot":"","sources":["../src/worker-interface.ts"],"names":[],"mappings":";;;AAMA,+CAS4B;AAC5B,2DAAwD;AAExD,2CAA8E;AAC9E,iCAA8B;AAC9B,mDAAgE;AAChE,qCAAqD;AACrD,iDAAqF;AAGrF,SAAgB,cAAc,CAAC,EAA+C;IAC5E,iBAAK,CAAC,OAAO,GAAG,EAAE,CAAC;AACrB,CAAC;AAFD,wCAEC;AAED,SAAgB,eAAe;IAC7B,MAAM,MAAM,GAAG,UAAiB,CAAC;IACjC,8EAA8E;IAC9E,uEAAuE;IACvE,+EAA+E;IAC/E,MAAM,CAAC,OAAO,GAAG;QACf,MAAM,IAAI,kCAAyB,CAAC,wEAAwE,CAAC,CAAC;IAChH,CAAC,CAAC;IACF,MAAM,CAAC,OAAO,GAAG;QACf,MAAM,IAAI,kCAAyB,CAAC,wEAAwE,CAAC,CAAC;IAChH,CAAC,CAAC;IACF,MAAM,CAAC,OAAO,GAAG;QACf,MAAM,IAAI,kCAAyB,CAAC,wEAAwE,CAAC,CAAC;IAChH,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;IAErC,MAAM,CAAC,IAAI,GAAG,UAAU,GAAG,IAAe;QACxC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,OAAO,IAAK,YAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,YAAY,CAAC,iBAAK,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG;QAChB,OAAO,iBAAK,CAAC,GAAG,CAAC;IACnB,CAAC,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,Y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U,EAAE,EAAE,QAAQ,EAAE;KACzB,CAAC,CAAC,MAAM,EAAE,CAAC;AACd,CAAC;AATD,gDASC;AAED,SAAgB,wBAAwB;IACtC,OAAO,iBAAK,CAAC,wBAAwB,EAAE,CAAC;AAC1C,CAAC;AAFD,4DAEC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB;IAClC,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,SAAS;QACP,MAAM,aAAa,GAAG,YAAY,CAAC;QACnC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,iBAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,EAAE;YAC3D,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE;gBACb,IAAI,CAAC,OAAO,EAAE,CAAC;gBACf,YAAY,EAAE,CAAC;gBACf,qDAAqD;gBACrD,iBAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aACrC;SACF;QACD,IAAI,aAAa,KAAK,YAAY,EAAE;YAClC,MAAM;SACP;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAjBD,oDAiBC"}
@@ -1,18 +1,19 @@
1
- import { BaseWorkflowHandle, Workflow, WorkflowHandleSignals } from '@temporalio/common';
1
+ import { BaseWorkflowHandle, SignalDefinition, Workflow } from '@temporalio/common';
2
2
  /**
3
3
  * Handle representing an external Workflow execution
4
4
  */
5
- export interface ExternalWorkflowHandle<T extends Workflow> {
5
+ export interface ExternalWorkflowHandle {
6
6
  /**
7
- * A mapping of the different signals defined by Workflow interface `T` to callable functions.
8
- * Call to signal a running Workflow.
7
+ * Signal a running Workflow.
8
+ *
9
+ * @param def a signal definition as returned from {@link defineSignal} or signal name (string)
9
10
  *
10
11
  * @example
11
12
  * ```ts
12
- * await workflow.signal.increment(3);
13
+ * await handle.signal(incrementSignal, 3);
13
14
  * ```
14
15
  */
15
- signal: WorkflowHandleSignals<T>;
16
+ signal<Args extends any[] = []>(def: SignalDefinition<Args> | string, ...args: Args): Promise<void>;
16
17
  /**
17
18
  * Cancel the external Workflow execution.
18
19
  *
@@ -29,26 +30,26 @@ export interface ExternalWorkflowHandle<T extends Workflow> {
29
30
  readonly runId?: string;
30
31
  }
31
32
  /**
32
- * Transforms a workflow interface `T` into a client interface
33
+ * A client side handle to a single Workflow instance.
34
+ * It can be used to signal, wait for completion, and cancel a Workflow execution.
33
35
  *
34
- * Given a workflow interface such as:
36
+ * Given the following Workflow definition:
35
37
  * ```ts
36
- * export interface Counter {
37
- * execute(initialValue?: number): number;
38
- * signals: {
39
- * increment(amount?: number): void;
40
- * };
41
- * }
38
+ * export const incrementSignal = defineSignal('increment');
39
+ * export async function counterWorkflow(initialValue: number): Promise<void>;
42
40
  * ```
43
41
  *
44
- * Create a handle for running and interacting with a single workflow
42
+ * Start a new Workflow execution and get a handle for interacting with it:
45
43
  * ```ts
46
- * // `counter` is a registered workflow file, typically found at
47
- * // `lib/workflows/counter.js` after building the typescript project
48
- * const workflow = Context.child<Counter>('counter');
49
- * // start workflow `execute` function with initialValue of 2 and await its completion
50
- * await workflow.execute(2);
44
+ * // Start the Workflow with initialValue of 2.
45
+ * const handle = await startWorkflow(counterWorkflow, { args: [2] });
46
+ * await handle.signal(incrementSignal, 2);
47
+ * await handle.result(); // throws WorkflowExecutionTerminatedError
51
48
  * ```
52
49
  */
53
50
  export interface ChildWorkflowHandle<T extends Workflow> extends BaseWorkflowHandle<T> {
51
+ /**
52
+ * The runId of the initial run of the bound Workflow
53
+ */
54
+ readonly originalRunId: string;
54
55
  }
package/lib/workflow.d.ts CHANGED
@@ -1,20 +1,20 @@
1
- import { ActivityFunction, ActivityOptions, Workflow } from '@temporalio/common';
1
+ import { ActivityFunction, ActivityOptions, Workflow, WorkflowResultType, SignalDefinition, QueryDefinition, WithWorkflowArgs, WorkflowReturnType } from '@temporalio/common';
2
2
  import { ChildWorkflowOptions, ChildWorkflowOptionsWithDefaults, ContinueAsNewOptions, WorkflowInfo } from './interfaces';
3
3
  import { ExternalDependencies } from './dependencies';
4
4
  import { ExternalWorkflowHandle, ChildWorkflowHandle } from './workflow-handle';
5
5
  /**
6
6
  * Adds default values to `workflowId` and `workflowIdReusePolicy` to given workflow options.
7
7
  */
8
- export declare function addDefaultWorkflowOptions(opts: ChildWorkflowOptions): ChildWorkflowOptionsWithDefaults;
8
+ export declare function addDefaultWorkflowOptions<T extends Workflow>(opts: WithWorkflowArgs<T, ChildWorkflowOptions>): ChildWorkflowOptionsWithDefaults;
9
9
  /**
10
10
  * Asynchronous sleep.
11
11
  *
12
12
  * Schedules a timer on the Temporal service.
13
- * The returned promise is {@link cancel | cancellable}.
14
13
  *
15
- * @param ms milliseconds to sleep for
14
+ * @param ms sleep duration - {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds. If given a negative number, value will be set to 1.
15
+ *
16
16
  */
17
- export declare function sleep(ms: number): Promise<void>;
17
+ export declare function sleep(ms: number | string): Promise<void>;
18
18
  export interface ActivityInfo {
19
19
  name: string;
20
20
  type: string;
@@ -74,25 +74,99 @@ export declare function createActivityHandle<A extends Record<string, ActivityFu
74
74
  * Returns a client-side handle that can be used to signal and cancel an existing Workflow execution.
75
75
  * It takes a Workflow ID and optional run ID.
76
76
  */
77
- export declare function createExternalWorkflowHandle<T extends Workflow>(workflowId: string, runId?: string): ExternalWorkflowHandle<T>;
77
+ export declare function getExternalWorkflowHandle(workflowId: string, runId?: string): ExternalWorkflowHandle;
78
+ /**
79
+ * Start a child Workflow execution
80
+ *
81
+ * **Override for Workflows that accept no arguments**.
82
+ *
83
+ * - Returns a client-side handle that implements a child Workflow interface.
84
+ * - By default a child will be scheduled on the same task queue as its parent.
85
+ *
86
+ * A child Workflow handle supports awaiting completion, signaling and cancellation via {@link CancellationScope}s.
87
+ * In order to query the child, use a {@link WorkflowClient} from an Activity.
88
+ */
89
+ export declare function startChild<T extends Workflow>(workflowType: string, options: ChildWorkflowOptions): Promise<ChildWorkflowHandle<T>>;
90
+ /**
91
+ * Start a child Workflow execution
92
+ *
93
+ * **Override for Workflows that accept no arguments**.
94
+ *
95
+ * - Returns a client-side handle that implements a child Workflow interface.
96
+ * - Deduces the Workflow type and signature from provided Workflow function.
97
+ * - By default a child will be scheduled on the same task queue as its parent.
98
+ *
99
+ * A child Workflow handle supports awaiting completion, signaling and cancellation via {@link CancellationScope}s.
100
+ * In order to query the child, use a {@link WorkflowClient} from an Activity.
101
+ */
102
+ export declare function startChild<T extends Workflow>(workflowFunc: T, options: WithWorkflowArgs<T, ChildWorkflowOptions>): Promise<ChildWorkflowHandle<T>>;
103
+ /**
104
+ * Start a child Workflow execution
105
+ *
106
+ * **Override for Workflows that accept no arguments**.
107
+ *
108
+ * - Returns a client-side handle that implements a child Workflow interface.
109
+ * - The child will be scheduled on the same task queue as its parent.
110
+ *
111
+ * A child Workflow handle supports awaiting completion, signaling and cancellation via {@link CancellationScope}s.
112
+ * In order to query the child, use a {@link WorkflowClient} from an Activity.
113
+ */
114
+ export declare function startChild<T extends () => Promise<any>>(workflowType: string): Promise<ChildWorkflowHandle<T>>;
115
+ /**
116
+ * Start a child Workflow execution
117
+ *
118
+ * **Override for Workflows that accept no arguments**.
119
+ *
120
+ * - Returns a client-side handle that implements a child Workflow interface.
121
+ * - Deduces the Workflow type and signature from provided Workflow function.
122
+ * - The child will be scheduled on the same task queue as its parent.
123
+ *
124
+ * A child Workflow handle supports awaiting completion, signaling and cancellation via {@link CancellationScope}s.
125
+ * In order to query the child, use a {@link WorkflowClient} from an Activity.
126
+ */
127
+ export declare function startChild<T extends () => Promise<any>>(workflowFunc: T): Promise<ChildWorkflowHandle<T>>;
128
+ /**
129
+ * Start a child Workflow execution and await its completion.
130
+ *
131
+ * - By default a child will be scheduled on the same task queue as its parent.
132
+ * - This operation is cancellable using {@link CancellationScope}s.
133
+ *
134
+ * @return The result of the child Workflow.
135
+ */
136
+ export declare function executeChild<T extends Workflow>(workflowType: string, options: WithWorkflowArgs<T, ChildWorkflowOptions>): Promise<WorkflowResultType<T>>;
137
+ /**
138
+ * Start a child Workflow execution and await its completion.
139
+ *
140
+ * - By default a child will be scheduled on the same task queue as its parent.
141
+ * - Deduces the Workflow type and signature from provided Workflow function.
142
+ * - This operation is cancellable using {@link CancellationScope}s.
143
+ *
144
+ * @return The result of the child Workflow.
145
+ */
146
+ export declare function executeChild<T extends Workflow>(workflowType: T, options: WithWorkflowArgs<T, ChildWorkflowOptions>): Promise<WorkflowResultType<T>>;
78
147
  /**
79
- * Returns a client-side handle that implements a child Workflow interface.
80
- * Takes a child Workflow type and optional child Workflow options as arguments.
81
- * Workflow options may be needed to override the timeouts and task queue if they differ from the parent Workflow.
148
+ * Start a child Workflow execution and await its completion.
149
+ *
150
+ * **Override for Workflows that accept no arguments**.
151
+ *
152
+ * - The child will be scheduled on the same task queue as its parent.
153
+ * - This operation is cancellable using {@link CancellationScope}s.
82
154
  *
83
- * A child Workflow supports starting, awaiting completion, signaling and cancellation via {@link CancellationScope}s.
84
- * In order to query the child, use a WorkflowClient from an Activity.
155
+ * @return The result of the child Workflow.
85
156
  */
86
- export declare function createChildWorkflowHandle<T extends Workflow>(workflowType: string, options?: ChildWorkflowOptions): ChildWorkflowHandle<T>;
157
+ export declare function executeChild<T extends () => WorkflowReturnType>(workflowType: string): Promise<WorkflowResultType<T>>;
87
158
  /**
88
- * Returns a client-side handle that implements a child Workflow interface.
89
- * Deduces the Workflow interface from provided Workflow function.
90
- * Workflow options may be needed to override the timeouts and task queue if they differ from the parent Workflow.
159
+ * Start a child Workflow execution and await its completion.
91
160
  *
92
- * A child Workflow supports starting, awaiting completion, signaling and cancellation via {@link CancellationScope}s.
93
- * In order to query the child, use a WorkflowClient from an Activity.
161
+ * **Override for Workflows that accept no arguments**.
162
+ *
163
+ * - The child will be scheduled on the same task queue as its parent.
164
+ * - Deduces the Workflow type and signature from provided Workflow function.
165
+ * - This operation is cancellable using {@link CancellationScope}s.
166
+ *
167
+ * @return The result of the child Workflow.
94
168
  */
95
- export declare function createChildWorkflowHandle<T extends Workflow>(workflowFunc: T, options?: ChildWorkflowOptions): ChildWorkflowHandle<T>;
169
+ export declare function executeChild<T extends () => WorkflowReturnType>(workflowFunc: T): Promise<ChildWorkflowHandle<T>>;
96
170
  /**
97
171
  * Get information about the current Workflow
98
172
  */
@@ -102,8 +176,14 @@ export declare function workflowInfo(): WorkflowInfo;
102
176
  *
103
177
  * @example
104
178
  * ```ts
105
- * import { dependencies } from '@temporalio/workflow';
106
- * import { MyDependencies } from '../interfaces';
179
+ * import { dependencies, ExternalDependencies } from '@temporalio/workflow';
180
+ *
181
+ * interface MyDependencies extends ExternalDependencies {
182
+ * logger: {
183
+ * info(message: string): void;
184
+ * error(message: string): void;
185
+ * };
186
+ * }
107
187
  *
108
188
  * const { logger } = dependencies<MyDependencies>();
109
189
  * logger.info('setting up');
@@ -151,14 +231,14 @@ export declare function continueAsNew<F extends Workflow>(...args: Parameters<F>
151
231
  /**
152
232
  * Generate an RFC compliant V4 uuid.
153
233
  * Uses the workflow's deterministic PRNG making it safe for use within a workflow.
154
- * This function is cryptograpically insecure.
234
+ * This function is cryptographically insecure.
155
235
  * See the {@link https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid | stackoverflow discussion}.
156
236
  */
157
237
  export declare function uuid4(): string;
158
238
  /**
159
239
  * Patch or upgrade workflow code by checking or stating that this workflow has a certain patch.
160
240
  *
161
- * See [docs page](https://docs.temporal.io/docs/node/versioning) for info.
241
+ * See [docs page](https://docs.temporal.io/docs/typescript/versioning) for info.
162
242
  *
163
243
  * If the workflow is replaying an existing history, then this function returns true if that
164
244
  * history was produced by a worker which also had a `patched` call with the same `patchId`.
@@ -176,7 +256,7 @@ export declare function patched(patchId: string): boolean;
176
256
  /**
177
257
  * Indicate that a patch is being phased out.
178
258
  *
179
- * See [docs page](https://docs.temporal.io/docs/node/versioning) for info.
259
+ * See [docs page](https://docs.temporal.io/docs/typescript/versioning) for info.
180
260
  *
181
261
  * Workflows with this call may be deployed alongside workflows with a {@link patched} call, but
182
262
  * they must *not* be deployed while any workers still exist running old code without a
@@ -191,3 +271,42 @@ export declare function patched(patchId: string): boolean;
191
271
  * calls with the same ID, which means all such calls will always return the same value.
192
272
  */
193
273
  export declare function deprecatePatch(patchId: string): void;
274
+ /**
275
+ * Returns a Promise that resolves when `fn` evaluates to `true` or `timeout` expires.
276
+ *
277
+ * @param timeout {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
278
+ *
279
+ * @returns a boolean indicating whether the condition was true before the timeout expires
280
+ */
281
+ export declare function condition(timeout: number | string, fn: () => boolean): Promise<boolean>;
282
+ /**
283
+ * Returns a Promise that resolves when `fn` evaluates to `true`.
284
+ */
285
+ export declare function condition(fn: () => boolean): Promise<void>;
286
+ /**
287
+ * Define a signal method for a Workflow.
288
+ *
289
+ * Definitions are used to register listeners in the Workflow via {@link setListener} and to signal Workflows using a {@link WorkflowHandle}, {@link ChildWorkflowHandle} or {@link ExternalWorkflowHandle}.
290
+ * Definitions can be reused in multiple Workflows.
291
+ */
292
+ export declare function defineSignal<Args extends any[] = []>(name: string): SignalDefinition<Args>;
293
+ /**
294
+ * Define a query method for a Workflow.
295
+ *
296
+ * Definitions are used to register listeners in the Workflow via {@link setListener} and to query Workflows using a {@link WorkflowHandle}.
297
+ * Definitions can be reused in multiple Workflows.
298
+ */
299
+ export declare function defineQuery<Ret, Args extends any[] = []>(name: string): QueryDefinition<Ret, Args>;
300
+ /**
301
+ * A listener function capable of accepting the arguments for a given SignalDefinition or QueryDefinition.
302
+ */
303
+ export declare type Listener<Ret, Args extends any[], T extends SignalDefinition<Args> | QueryDefinition<Ret, Args>> = T extends SignalDefinition<infer A> ? (...args: A) => void | Promise<void> : T extends QueryDefinition<infer R, infer A> ? (...args: A) => R : never;
304
+ /**
305
+ * Set a listener function for a Workflow query or signal.
306
+ *
307
+ * If this function is called multiple times for a given signal or query name the last listener will overwrite any previous calls.
308
+ *
309
+ * @param def a {@link SignalDefinition} or {@link QueryDefinition} as returned by {@link defineSignal} or {@link defineQuery} respectively.
310
+ * @param listener a compatible listener function for the given definition.
311
+ */
312
+ export declare function setListener<Ret, Args extends any[], T extends SignalDefinition<Args> | QueryDefinition<Ret, Args>>(def: T, listener: Listener<Ret, Args, T>): void;