@dudousxd/nestjs-durable-core 0.87.0 → 0.88.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.
- package/dist/index.cjs +1816 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +564 -10
- package/dist/index.d.ts +564 -10
- package/dist/index.js +1807 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -943,6 +943,37 @@ interface DurableTopology {
|
|
|
943
943
|
role: 'control-plane' | 'tenant';
|
|
944
944
|
/** The tenant's isolation partition name; set only when `role` is 'tenant'. */
|
|
945
945
|
tenant?: string;
|
|
946
|
+
/**
|
|
947
|
+
* The engine behind the gateway, when it is not nestjs-durable's own (e.g. `'@nestjs/workflows'`
|
|
948
|
+
* for `@dudousxd/nestjs-durable-workflows-gateway`). Shown in the console header. Absent: durable.
|
|
949
|
+
*/
|
|
950
|
+
engine?: string;
|
|
951
|
+
/**
|
|
952
|
+
* Console features this gateway cannot serve, as `false`; the SPA hides their controls. A key
|
|
953
|
+
* left out (or no object at all, as from every durable gateway) means supported.
|
|
954
|
+
*/
|
|
955
|
+
capabilities?: ConsoleCapabilities;
|
|
956
|
+
}
|
|
957
|
+
/** See {@link DurableTopology.capabilities}. `false` hides the control; absent means supported. */
|
|
958
|
+
interface ConsoleCapabilities {
|
|
959
|
+
/** Search-attribute filters (`attributes` in a run query). */
|
|
960
|
+
searchAttributes?: boolean;
|
|
961
|
+
/** The tenant/namespace picker. */
|
|
962
|
+
namespaces?: boolean;
|
|
963
|
+
/** Tag filters. */
|
|
964
|
+
tags?: boolean;
|
|
965
|
+
/** Origin chips (which package/app started a run). */
|
|
966
|
+
origins?: boolean;
|
|
967
|
+
/** Breakpoints (`Continue`). */
|
|
968
|
+
breakpoints?: boolean;
|
|
969
|
+
/** Re-dispatching lost remote steps. */
|
|
970
|
+
redispatch?: boolean;
|
|
971
|
+
/** Republishing lifecycle events. */
|
|
972
|
+
republishLifecycle?: boolean;
|
|
973
|
+
/** The schedules panel. */
|
|
974
|
+
schedules?: boolean;
|
|
975
|
+
/** The workers / partitions health panel. */
|
|
976
|
+
workers?: boolean;
|
|
946
977
|
}
|
|
947
978
|
/** The run whose settling started a run, as its detail names it. */
|
|
948
979
|
interface LifecycleSource {
|
|
@@ -1462,6 +1493,21 @@ interface StepSettlement {
|
|
|
1462
1493
|
startedAt: Date;
|
|
1463
1494
|
finishedAt: Date;
|
|
1464
1495
|
}
|
|
1496
|
+
/**
|
|
1497
|
+
* A step's result as {@link StateStore.settleResultsIfPending} writes it onto the step's `pending`
|
|
1498
|
+
* checkpoint. Unlike a {@link StepSettlement}, what the result does not carry keeps the stored value:
|
|
1499
|
+
* `output` is written only for a `completed` result, `events` and `startedAt` only when present.
|
|
1500
|
+
*/
|
|
1501
|
+
interface StepResultSettlement {
|
|
1502
|
+
runId: string;
|
|
1503
|
+
seq: number;
|
|
1504
|
+
status: 'completed' | 'failed';
|
|
1505
|
+
output?: unknown;
|
|
1506
|
+
error?: StepError | undefined;
|
|
1507
|
+
events?: StepEvent[] | undefined;
|
|
1508
|
+
startedAt?: Date | undefined;
|
|
1509
|
+
finishedAt: Date;
|
|
1510
|
+
}
|
|
1465
1511
|
/**
|
|
1466
1512
|
* A structured event a step (or its worker) emits while running — a log line and/or a sub-step
|
|
1467
1513
|
* outcome. The dashboard renders these under the step, so you can see what happened inside a step
|
|
@@ -1714,6 +1760,29 @@ interface StateStore {
|
|
|
1714
1760
|
* Optional: a store that omits it gets {@link saveCheckpointsIfPending} with the whole rows.
|
|
1715
1761
|
*/
|
|
1716
1762
|
settleCheckpointsIfPending?(settlements: StepSettlement[]): Promise<boolean[]>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Settle steps from their results and read them back, in one round trip where the store can: per
|
|
1765
|
+
* entry and in input order, while the row at `(runId, seq)` is still `pending` and its run is not
|
|
1766
|
+
* `cancelled` or `completed` (a late result for a finished run settles nothing), write the result
|
|
1767
|
+
* (see {@link StepResultSettlement} for what keeps its stored value) and resolve the row as it now
|
|
1768
|
+
* reads, without its `input` (as {@link getCheckpointsForSettle} reads it); `null` for an entry
|
|
1769
|
+
* that wrote nothing (the row is absent or already settled, or the run finished). Claims like
|
|
1770
|
+
* {@link settleCheckpointsIfPending}: a later entry for a row an earlier one settled loses, and a
|
|
1771
|
+
* rejection writes nothing. The engine settles a batch of one run's step results through it
|
|
1772
|
+
* without reading the rows first.
|
|
1773
|
+
*
|
|
1774
|
+
* Optional: a store that omits it gets {@link getCheckpointsForSettle} followed by
|
|
1775
|
+
* {@link settleCheckpointsIfPending}.
|
|
1776
|
+
*/
|
|
1777
|
+
settleResultsIfPending?(results: StepResultSettlement[]): Promise<(StepCheckpoint | null)[]>;
|
|
1778
|
+
/**
|
|
1779
|
+
* Write `checkpoint` only if the run has no checkpoint at its `seq` yet; resolves whether it wrote.
|
|
1780
|
+
* The engine writes a step it dispatches for the first time through it, instead of reading the
|
|
1781
|
+
* position first: a row already there (written by a turn it did not see) is then read and acted on.
|
|
1782
|
+
*
|
|
1783
|
+
* Optional: a store that omits it gets a {@link getCheckpoint} before the {@link saveCheckpoint}.
|
|
1784
|
+
*/
|
|
1785
|
+
insertCheckpointIfAbsent?(checkpoint: StepCheckpoint): Promise<boolean>;
|
|
1717
1786
|
/** Used by recovery on boot to find runs to resume (crashed, left `running`). */
|
|
1718
1787
|
listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
|
|
1719
1788
|
/**
|
|
@@ -1736,6 +1805,16 @@ interface StateStore {
|
|
|
1736
1805
|
listOrphanedRuns?(nowMs: number, limit: number, namespace?: string, ownedBy?: OwnedLeaseReclaim): Promise<WorkflowRun[]>;
|
|
1737
1806
|
/** The oldest `pending` runs awaiting dispatch (FIFO, by `createdAt`), capped at `limit`. */
|
|
1738
1807
|
listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
|
|
1808
|
+
/**
|
|
1809
|
+
* Claim up to `limit` of the oldest `pending` runs that no instance holds (no lease, or one that
|
|
1810
|
+
* expired by `nowMs`): lease each to `owner` until `leaseUntilMs` and resolve them as locked, in
|
|
1811
|
+
* one statement where the store can. Rows another claimer is locking right now are skipped, not
|
|
1812
|
+
* waited on (`FOR UPDATE SKIP LOCKED`), so instances polling at once split the backlog instead of
|
|
1813
|
+
* racing for the same rows. `namespace` and the read scope filter like {@link listPendingRuns}.
|
|
1814
|
+
*
|
|
1815
|
+
* Optional: a store that omits it gets {@link listPendingRuns} and a {@link tryLockRun} per run.
|
|
1816
|
+
*/
|
|
1817
|
+
claimPendingRuns?(limit: number, owner: string, leaseUntilMs: number, nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
|
|
1739
1818
|
/**
|
|
1740
1819
|
* Suspended runs whose durable timer is due (`wakeAt <= nowMs`), ready to resume — the most
|
|
1741
1820
|
* overdue first, at most `limit` of them when it is given. Every driving instance polls this each
|
|
@@ -1748,6 +1827,15 @@ interface StateStore {
|
|
|
1748
1827
|
* acquired — so concurrent engine instances never recover the same run twice.
|
|
1749
1828
|
*/
|
|
1750
1829
|
tryLockRun(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<boolean>;
|
|
1830
|
+
/**
|
|
1831
|
+
* {@link tryLockRun}, resolving the run as it reads once locked (`null` when the lease was not
|
|
1832
|
+
* acquired, or the run does not exist): the engine takes a run's lease and reads it in one round
|
|
1833
|
+
* trip where the store can. The read honors the store's read scope like {@link getRun}; a run
|
|
1834
|
+
* outside it is not locked.
|
|
1835
|
+
*
|
|
1836
|
+
* Optional: a store that omits it gets a {@link getRun} and a {@link tryLockRun}.
|
|
1837
|
+
*/
|
|
1838
|
+
tryLockRunAndGet?(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<WorkflowRun | null>;
|
|
1751
1839
|
/**
|
|
1752
1840
|
* Release a run's recovery lease so another instance can pick it up (e.g. once it suspends).
|
|
1753
1841
|
*
|
|
@@ -1828,6 +1916,40 @@ interface StateStore {
|
|
|
1828
1916
|
takeBufferedSignal(token: string): Promise<{
|
|
1829
1917
|
payload: unknown;
|
|
1830
1918
|
} | null>;
|
|
1919
|
+
/**
|
|
1920
|
+
* Take the oldest buffered signal (lowest id) whose token is one of `tokens`, with that token, or
|
|
1921
|
+
* null if none is buffered. Atomic like {@link takeBufferedSignal}: two concurrent callers never
|
|
1922
|
+
* take the same row. `ctx.waitForAny` resolves with it, so when several of its signals are already
|
|
1923
|
+
* buffered the one sent first wins, whichever condition it matches.
|
|
1924
|
+
*
|
|
1925
|
+
* Optional: without it `waitForAny` takes {@link takeBufferedSignal} token by token in the order
|
|
1926
|
+
* the conditions are declared.
|
|
1927
|
+
*/
|
|
1928
|
+
takeOldestBufferedSignal?(tokens: string[]): Promise<{
|
|
1929
|
+
token: string;
|
|
1930
|
+
payload: unknown;
|
|
1931
|
+
} | null>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Record that the signal `id` was sent on `token`, unless it already was: resolves `true` when this
|
|
1934
|
+
* call recorded it (the signal is new) and `false` when an unexpired record for the same `token`
|
|
1935
|
+
* and `id` exists (a re-send). The record lasts until `expiresAt` (epoch ms); a record whose
|
|
1936
|
+
* `expiresAt <= nowMs` counts as absent and is replaced. Atomic: of two concurrent calls with the
|
|
1937
|
+
* same `token` and `id`, exactly one resolves `true`. Backs `engine.signal(token, payload, { id })`.
|
|
1938
|
+
*
|
|
1939
|
+
* Optional: a store without it can't deduplicate signals, and `signal(..., { id })` throws.
|
|
1940
|
+
*/
|
|
1941
|
+
claimSignalId?(token: string, id: string, expiresAt: number, nowMs: number): Promise<boolean>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Delete the record {@link claimSignalId} made for `token` and `id`, if any. The engine calls it
|
|
1944
|
+
* when delivering the signal failed after the claim, so the sender's retry is not taken for a
|
|
1945
|
+
* duplicate.
|
|
1946
|
+
*/
|
|
1947
|
+
releaseSignalId?(token: string, id: string): Promise<void>;
|
|
1948
|
+
/**
|
|
1949
|
+
* Delete up to `limit` signal-id records that expired at or before `nowMs`; resolves how many it
|
|
1950
|
+
* deleted. Expired records are already ignored by {@link claimSignalId}; this only reclaims space.
|
|
1951
|
+
*/
|
|
1952
|
+
deleteExpiredSignalIds?(nowMs: number, limit: number): Promise<number>;
|
|
1831
1953
|
/**
|
|
1832
1954
|
* A page of buffered signals whose token starts with `tokenPrefix`, in insertion (`id`) order,
|
|
1833
1955
|
* starting after `afterId` (exclusive; `undefined` = from the start), at most `limit` rows. The
|
|
@@ -2424,9 +2546,83 @@ interface SignalWaiter {
|
|
|
2424
2546
|
* group; without threading it through the waiter, the child-await checkpoint comes out untagged and the
|
|
2425
2547
|
* dashboard renders the fan as a sequential chain instead of one parallel group. Undefined for an
|
|
2426
2548
|
* ordinary (non-fan) signal/child await.
|
|
2549
|
+
*
|
|
2550
|
+
* `'$any'` (`ANY_WAIT_GROUP`) marks the waiter as one condition of a `ctx.waitForAny`: a signal
|
|
2551
|
+
* that takes it settles the wait only if no other condition did first, and is buffered again
|
|
2552
|
+
* otherwise (see `wait-any.ts`).
|
|
2427
2553
|
*/
|
|
2428
2554
|
parallelGroup?: string | undefined;
|
|
2429
2555
|
}
|
|
2556
|
+
/** Options for `engine.signal(token, payload, opts)`. */
|
|
2557
|
+
interface SignalOptions {
|
|
2558
|
+
/**
|
|
2559
|
+
* Deduplication id, unique per token — the id of the message, job or webhook delivery that causes
|
|
2560
|
+
* the signal. A signal sent again on the same token with the same id while the first is remembered
|
|
2561
|
+
* (see `idTtl`) is dropped: `signal()` resolves `null` and nothing is delivered or buffered, so a
|
|
2562
|
+
* sender that runs twice (a redelivered message, a retried job) signals once and the first payload
|
|
2563
|
+
* wins. The same id on another token is another signal. Needs a store with `claimSignalId` (every
|
|
2564
|
+
* bundled store).
|
|
2565
|
+
*
|
|
2566
|
+
* If storing the signal fails, `signal()` rejects and the id is forgotten, so a retry gets through.
|
|
2567
|
+
* A duplicate sent on the same engine while the first send is still in flight waits for it, and
|
|
2568
|
+
* sends in its place if it fails. Across instances a concurrent duplicate is dropped at once, so
|
|
2569
|
+
* the sender whose call rejected must retry.
|
|
2570
|
+
*/
|
|
2571
|
+
id?: string | undefined;
|
|
2572
|
+
/**
|
|
2573
|
+
* How long this signal's `id` is remembered (ms, or a duration like `'30d'`). Default: the engine's
|
|
2574
|
+
* `signalIdTtl` (7 days).
|
|
2575
|
+
*/
|
|
2576
|
+
idTtl?: string | number | undefined;
|
|
2577
|
+
}
|
|
2578
|
+
declare const waitConditionValue: unique symbol;
|
|
2579
|
+
/**
|
|
2580
|
+
* What a condition of {@link WorkflowCtx.waitForAny} waits for. Plain data: the same object travels
|
|
2581
|
+
* in a remote workflow's `waitAny` command.
|
|
2582
|
+
*
|
|
2583
|
+
* - `signal`: a signal sent on token `signal` (`engine.signal(token, payload)`); its value is the payload.
|
|
2584
|
+
* - `timer`: `ms` after the wait is first reached, or at `until` (epoch ms); its value is `null`.
|
|
2585
|
+
* - `child`: the run `childId` settling; its value is the run's output (a failed run throws).
|
|
2586
|
+
*/
|
|
2587
|
+
type WaitConditionSpec = {
|
|
2588
|
+
kind: 'signal';
|
|
2589
|
+
signal: string;
|
|
2590
|
+
} | {
|
|
2591
|
+
kind: 'timer';
|
|
2592
|
+
ms?: number | undefined;
|
|
2593
|
+
until?: number | undefined;
|
|
2594
|
+
} | {
|
|
2595
|
+
kind: 'child';
|
|
2596
|
+
childId: string;
|
|
2597
|
+
};
|
|
2598
|
+
/**
|
|
2599
|
+
* A condition for {@link WorkflowCtx.waitForAny}, made by `ctx.signalWait()`, `ctx.timer()` or
|
|
2600
|
+
* `ctx.childWait()`. `T` is the value it resolves with (type-only). Only a description: nothing is
|
|
2601
|
+
* waited for, and nothing journaled, until it is passed to `waitForAny`.
|
|
2602
|
+
*/
|
|
2603
|
+
type WaitCondition<T = unknown> = WaitConditionSpec & {
|
|
2604
|
+
/** Type-only: the `value` `waitForAny()` returns when this condition wins. Never set. */
|
|
2605
|
+
readonly [waitConditionValue]?: T;
|
|
2606
|
+
};
|
|
2607
|
+
/** One condition of a remote `waitAny` command: the spec plus its key in the conditions object. */
|
|
2608
|
+
type WaitAnyCondition = WaitConditionSpec & {
|
|
2609
|
+
key: string;
|
|
2610
|
+
};
|
|
2611
|
+
/** What a `waitForAny` resolved with, untyped: the winning condition's key and its value. */
|
|
2612
|
+
interface WaitAnyOutcome {
|
|
2613
|
+
key: string;
|
|
2614
|
+
value: unknown;
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* What `ctx.waitForAny(name, conditions)` resolves with: the key of the condition that won and its
|
|
2618
|
+
* value, typed per key (check `key` to narrow `value`).
|
|
2619
|
+
*/
|
|
2620
|
+
type WaitAnyResult<C extends Record<string, WaitCondition<unknown>>> = {
|
|
2621
|
+
[K in keyof C & string]: {
|
|
2622
|
+
key: K;
|
|
2623
|
+
value: C[K] extends WaitCondition<infer T> ? T : never;
|
|
2624
|
+
};
|
|
2625
|
+
}[keyof C & string];
|
|
2430
2626
|
/**
|
|
2431
2627
|
* A DB-less tenant worker → control plane request to start a run. Published by a worker that has
|
|
2432
2628
|
* no direct DB access (the hosted-control-plane tenant model) onto the
|
|
@@ -2570,6 +2766,14 @@ interface RemoteTask {
|
|
|
2570
2766
|
*/
|
|
2571
2767
|
priority?: number | undefined;
|
|
2572
2768
|
attempt: number;
|
|
2769
|
+
/**
|
|
2770
|
+
* The engine instance that dispatched the task and wants its result back, when the transport
|
|
2771
|
+
* routes replies ({@link Transport.consumeRepliesFor}): that instance keeps the workflow body
|
|
2772
|
+
* parked on the step, so its result continues the body there instead of replaying it elsewhere.
|
|
2773
|
+
* A worker sends the result to that instance while it is alive, else to the shared results, like
|
|
2774
|
+
* a task without it. Absent when replies are not routed (a step fan's tasks never carry it).
|
|
2775
|
+
*/
|
|
2776
|
+
replyTo?: string | undefined;
|
|
2573
2777
|
}
|
|
2574
2778
|
interface StepResult {
|
|
2575
2779
|
runId: string;
|
|
@@ -2627,9 +2831,14 @@ interface WorkflowTask {
|
|
|
2627
2831
|
/** One resolved durable op in a run's history — a superset of a completed {@link StepCheckpoint}. */
|
|
2628
2832
|
interface HistoryEvent {
|
|
2629
2833
|
seq: number;
|
|
2630
|
-
kind: 'step' | 'call' | 'timer' | 'signal' | 'child';
|
|
2834
|
+
kind: 'step' | 'call' | 'timer' | 'signal' | 'child' | 'any';
|
|
2835
|
+
/** The op's name. For `any`, the `waitForAny` name. */
|
|
2631
2836
|
name?: string | undefined;
|
|
2632
|
-
/**
|
|
2837
|
+
/**
|
|
2838
|
+
* Resolved value: a step/call output, a child run's output, a signal payload. For `any`, the
|
|
2839
|
+
* `{ key, value }` the wait resolved with (a winning child's output unwrapped; a failed child
|
|
2840
|
+
* sets `error` and leaves `{ key }`).
|
|
2841
|
+
*/
|
|
2633
2842
|
output?: unknown;
|
|
2634
2843
|
/** Set when the op resolved to a failure (e.g. a failed remote step the workflow may catch). */
|
|
2635
2844
|
error?: StepError | undefined;
|
|
@@ -2679,6 +2888,16 @@ type WorkflowCommand =
|
|
|
2679
2888
|
seq: number;
|
|
2680
2889
|
signal: string;
|
|
2681
2890
|
}
|
|
2891
|
+
/** `ctx.waitForAny(name, conditions)` — block until the first of `conditions` happens. The engine
|
|
2892
|
+
* resolves it exactly as the in-process ctx does (see `wait-any.ts`), journals `{ key, value }` at
|
|
2893
|
+
* `seq` and replays it as an `any` {@link HistoryEvent}. A timer's `ms` counts from when the engine
|
|
2894
|
+
* first applies the command. */
|
|
2895
|
+
| {
|
|
2896
|
+
kind: 'waitAny';
|
|
2897
|
+
seq: number;
|
|
2898
|
+
name: string;
|
|
2899
|
+
conditions: WaitAnyCondition[];
|
|
2900
|
+
}
|
|
2682
2901
|
/** `ctx.start_child(workflow, input)` — start a child run with its own lifecycle. A worker's
|
|
2683
2902
|
* `ctx.all([...])` fan-out tags every dispatched child with the same `parallelGroup` so the
|
|
2684
2903
|
* dashboard can render the fan as one group (parity with the gathered `recordStep` tag). */
|
|
@@ -2827,6 +3046,14 @@ interface Transport {
|
|
|
2827
3046
|
dispatchMany?(tasks: RemoteTask[]): Promise<void>;
|
|
2828
3047
|
/** worker → engine: a step finished (ok or error). */
|
|
2829
3048
|
onResult(handler: (result: StepResult) => Promise<void>): void;
|
|
3049
|
+
/**
|
|
3050
|
+
* Also consume the results workers address to engine instance `replyTo` (tasks dispatched with
|
|
3051
|
+
* {@link RemoteTask.replyTo}), handing them to the {@link onResult} handlers. A transport that
|
|
3052
|
+
* implements it must never lose such a result: while `replyTo` is gone (crashed, scaled down,
|
|
3053
|
+
* drained), its results go, or are moved, to the shared results. Optional: a transport without it
|
|
3054
|
+
* gets tasks without `replyTo`, and every result comes back on the shared results.
|
|
3055
|
+
*/
|
|
3056
|
+
consumeRepliesFor?(replyTo: string): void;
|
|
2830
3057
|
/** worker → engine: liveness signal for an in-flight long step. */
|
|
2831
3058
|
onHeartbeat(handler: (beat: Heartbeat) => Promise<void>): void;
|
|
2832
3059
|
/** Release the transport's resources (broker workers, queues, connections) for a clean shutdown.
|
|
@@ -3079,7 +3306,24 @@ interface ChildCallOptions {
|
|
|
3079
3306
|
* (TS class) child, which runs in the engine and never hits a broker queue.
|
|
3080
3307
|
*/
|
|
3081
3308
|
priority?: number | undefined;
|
|
3309
|
+
/**
|
|
3310
|
+
* What happens to this child if it is still running when its parent ends:
|
|
3311
|
+
*
|
|
3312
|
+
* - `'cancel'`: cancelled with its saga undo (`cancel(child, { compensate: true })`);
|
|
3313
|
+
* - `'terminate'`: cancelled without compensating (`cancel(child)`);
|
|
3314
|
+
* - `'abandon'`: left running, also when the parent is CANCELLED (the cancel cascade skips it).
|
|
3315
|
+
*
|
|
3316
|
+
* Applied when the parent completes or fails in a workflow turn. A cancelled or timed-out parent
|
|
3317
|
+
* keeps cascading its cancel to its children as before, except `'abandon'` ones. Omitted: today's
|
|
3318
|
+
* behaviour (a finished parent leaves its children alone; a cancelled one cascades). In-process
|
|
3319
|
+
* (TS class) parents only: a workflow replayed by a remote worker ignores it.
|
|
3320
|
+
*/
|
|
3321
|
+
parentClose?: ParentClosePolicy | undefined;
|
|
3082
3322
|
}
|
|
3323
|
+
/** See {@link ChildCallOptions.parentClose}. */
|
|
3324
|
+
type ParentClosePolicy = 'cancel' | 'terminate' | 'abandon';
|
|
3325
|
+
/** The tag a child started with a `parentClose` policy carries: `parent-close:<policy>`. */
|
|
3326
|
+
declare const PARENT_CLOSE_TAG_PREFIX = "parent-close:";
|
|
3083
3327
|
interface StepOptions {
|
|
3084
3328
|
/** Max attempts before the step (and run) fails. */
|
|
3085
3329
|
retries?: number;
|
|
@@ -3310,6 +3554,46 @@ interface WorkflowCtx<A extends SearchAttributes = SearchAttributes> {
|
|
|
3310
3554
|
waitForSignal<TPayload>(token: string, opts?: {
|
|
3311
3555
|
timeoutMs?: number;
|
|
3312
3556
|
}): Promise<TPayload>;
|
|
3557
|
+
/**
|
|
3558
|
+
* Durable wait for whichever of several conditions happens first: a signal
|
|
3559
|
+
* ({@link signalWait}), a timer ({@link timer}) or a run settling ({@link childWait}). Resolves with
|
|
3560
|
+
* the winner's key and its value — a signal's payload, `null` for a timer, a child's output (a
|
|
3561
|
+
* child that failed throws, as {@link child} does) — journaled under `name` at ONE position, so a
|
|
3562
|
+
* replay returns the same winner.
|
|
3563
|
+
*
|
|
3564
|
+
* Only the winning signal is consumed: a signal that matched another condition stays buffered for
|
|
3565
|
+
* a later wait on its token. A losing timer never fires; a losing child keeps running, and a later
|
|
3566
|
+
* `ctx.child(..., childId)` still joins it. When several conditions are ready at once the signal
|
|
3567
|
+
* sent first wins (lowest buffered id), then a child that already finished, then the earliest due
|
|
3568
|
+
* timer. A signal that arrives after a timer's deadline loses to it, even if no worker ran at the
|
|
3569
|
+
* deadline. Timers count from when the wait is first reached.
|
|
3570
|
+
*
|
|
3571
|
+
* ```ts
|
|
3572
|
+
* const outcome = await ctx.waitForAny('delivery-or-cancel', {
|
|
3573
|
+
* delivered: ctx.signalWait<CarrierEvent>(`shipment.delivered:${order.id}`),
|
|
3574
|
+
* cancelled: ctx.signalWait<{ reason: string }>(`order.cancelled:${order.id}`),
|
|
3575
|
+
* timeout: ctx.timer('3d'),
|
|
3576
|
+
* });
|
|
3577
|
+
* if (outcome.key === 'delivered') await ctx.step(thank, outcome.value);
|
|
3578
|
+
* ```
|
|
3579
|
+
*/
|
|
3580
|
+
waitForAny<C extends Record<string, WaitCondition<unknown>>>(name: string, conditions: C): Promise<WaitAnyResult<C>>;
|
|
3581
|
+
/** A signal condition for {@link waitForAny}: a signal sent on `token`. Its value is the payload. */
|
|
3582
|
+
signalWait<TPayload = unknown>(token: string): WaitCondition<TPayload>;
|
|
3583
|
+
/**
|
|
3584
|
+
* A timer condition for {@link waitForAny}: `duration` (ms, or `'30m'`, `'3d'`…) after the wait is
|
|
3585
|
+
* first reached, or at `{ until }` (a `Date` or epoch ms). Its value is `null`.
|
|
3586
|
+
*/
|
|
3587
|
+
timer(duration: string | number | {
|
|
3588
|
+
until: Date | number;
|
|
3589
|
+
}): WaitCondition<null>;
|
|
3590
|
+
/**
|
|
3591
|
+
* A child condition for {@link waitForAny}: run `childId` settling (a child from
|
|
3592
|
+
* {@link startChild}, or any run id). Its value is the run's output; a run that failed, was
|
|
3593
|
+
* cancelled or died makes `waitForAny` throw. Pass the workflow class first to type the output.
|
|
3594
|
+
*/
|
|
3595
|
+
childWait<C extends WorkflowClass>(workflow: C, childId: string): WaitCondition<WorkflowOutputOf<C>>;
|
|
3596
|
+
childWait<TOutput = unknown>(childId: string): WaitCondition<TOutput>;
|
|
3313
3597
|
/**
|
|
3314
3598
|
* Wait for a named **event** published via `engine.publishEvent(name, payload)`, then resume with
|
|
3315
3599
|
* the payload. Unlike a signal (point-to-point by token), events are name-based pub/sub: pass an
|
|
@@ -4547,7 +4831,13 @@ interface ScheduleOptions {
|
|
|
4547
4831
|
cron?: string | undefined;
|
|
4548
4832
|
/** Fixed interval (`'15m'`, or ms), windows aligned to the epoch. Exclusive with `cron`. */
|
|
4549
4833
|
every?: string | number | undefined;
|
|
4550
|
-
/**
|
|
4834
|
+
/**
|
|
4835
|
+
* An RFC 5545 recurrence rule (`'FREQ=WEEKLY;BYDAY=MO;BYHOUR=8'`, optionally with a
|
|
4836
|
+
* `DTSTART:…` line), evaluated in `timezone`. Exactly one of `cron`, `every` and `rrule`. See
|
|
4837
|
+
* {@link parseRRule} for the supported parts. No peer needed.
|
|
4838
|
+
*/
|
|
4839
|
+
rrule?: string | undefined;
|
|
4840
|
+
/** IANA timezone the cron / rrule is evaluated in (e.g. `America/Sao_Paulo`). Default UTC. */
|
|
4551
4841
|
timezone?: string | undefined;
|
|
4552
4842
|
/**
|
|
4553
4843
|
* Delay each fire by up to this much (`'30s'` or ms) — a stable per-(schedule, window) offset, so
|
|
@@ -4592,6 +4882,7 @@ interface ScheduleDescription {
|
|
|
4592
4882
|
namespace: string;
|
|
4593
4883
|
cron?: string | undefined;
|
|
4594
4884
|
everyMs?: number | undefined;
|
|
4885
|
+
rrule?: string | undefined;
|
|
4595
4886
|
timezone?: string | undefined;
|
|
4596
4887
|
jitterMs?: number | undefined;
|
|
4597
4888
|
overlap: 'allow' | 'skip';
|
|
@@ -5059,6 +5350,13 @@ interface WorkflowEngineDeps {
|
|
|
5059
5350
|
* bug to route around here.
|
|
5060
5351
|
*/
|
|
5061
5352
|
eventBufferTtlMs?: number | undefined;
|
|
5353
|
+
/**
|
|
5354
|
+
* How long `signal(token, payload, { id })` remembers an `id` (ms, or a duration like `'7d'`): a
|
|
5355
|
+
* re-send with the same token and id within it is dropped. Records past it are ignored, and
|
|
5356
|
+
* {@link WorkflowEngine.sweepExpiredSignalIds} deletes them. Keep it longer than any sender's
|
|
5357
|
+
* redelivery window. Default 7 days; a call can pass its own `idTtl`.
|
|
5358
|
+
*/
|
|
5359
|
+
signalIdTtl?: string | number | undefined;
|
|
5062
5360
|
/**
|
|
5063
5361
|
* Opt-in self-heal window (ms) for a remote step with NO `timeoutMs` whose dispatched job was LOST —
|
|
5064
5362
|
* the worker crashed mid-step leaving no result, or the transport dropped the job (a Redis
|
|
@@ -5088,6 +5386,14 @@ interface WorkflowEngineDeps {
|
|
|
5088
5386
|
* AND descriptors are published (a legacy fleet never parks blocked).
|
|
5089
5387
|
*/
|
|
5090
5388
|
blockedPollMs?: number | undefined;
|
|
5389
|
+
/**
|
|
5390
|
+
* How long (ms) the routing guard reuses the worker descriptors it read for a queue token before
|
|
5391
|
+
* reading them again. Every dispatch consults them, and on BullMQ each read is a `SCAN` of the
|
|
5392
|
+
* Redis keyspace; workers rewrite their descriptor every 10 s with a 35 s TTL, so a couple of
|
|
5393
|
+
* seconds of reuse changes nothing the guard can observe. Concurrent reads of one token share a
|
|
5394
|
+
* single request. Default 2000; `0` reads on every dispatch.
|
|
5395
|
+
*/
|
|
5396
|
+
workerDescriptorCacheMs?: number | undefined;
|
|
5091
5397
|
/**
|
|
5092
5398
|
* Build the public callback URL for a `ctx.webhook()` token (e.g.
|
|
5093
5399
|
* ``(t) => `https://api.example.com/durable/webhooks/${t}` ``). Populates
|
|
@@ -5147,6 +5453,26 @@ interface WorkflowEngineDeps {
|
|
|
5147
5453
|
* run `runPending` on a worker pod to pick those up; or a broker-backed one for a worker pool.
|
|
5148
5454
|
*/
|
|
5149
5455
|
runDispatcher?: RunDispatcher | undefined;
|
|
5456
|
+
/**
|
|
5457
|
+
* How many parked workflow bodies this instance keeps in memory between turns (the sticky
|
|
5458
|
+
* continuation cache, see `sticky-continuation.ts`). A run whose body parked here on dispatched
|
|
5459
|
+
* `ctx.step` calls continues from where it stopped when its next turn runs on this instance,
|
|
5460
|
+
* instead of replaying from the top over its whole history: the turn re-reads only the steps it
|
|
5461
|
+
* parked on. Least recently used out first; an evicted run just replays. Default 1000 (about 26 KB
|
|
5462
|
+
* of heap per parked body, measured with a small body: ~26 MB at most). `0` turns
|
|
5463
|
+
* the cache off (every turn replays).
|
|
5464
|
+
*/
|
|
5465
|
+
stickyRuns?: number | undefined;
|
|
5466
|
+
/** How long a parked body may sit idle in the sticky cache before it is dropped. Default 5 min. */
|
|
5467
|
+
stickyIdleMs?: number | undefined;
|
|
5468
|
+
/**
|
|
5469
|
+
* Ask the transports that can ({@link Transport.consumeRepliesFor}, e.g. BullMQ) to send the result
|
|
5470
|
+
* of a dispatched `ctx.step` back to this instance, which holds the body parked on it, rather
|
|
5471
|
+
* than to whichever engine instance takes it off the shared results. With several engine
|
|
5472
|
+
* instances, that is what keeps the sticky continuation hitting. A result whose instance is gone
|
|
5473
|
+
* goes to the shared results and replays elsewhere. Default `true` while the sticky cache is on.
|
|
5474
|
+
*/
|
|
5475
|
+
routeReplies?: boolean | undefined;
|
|
5150
5476
|
}
|
|
5151
5477
|
/** Options for {@link WorkflowEngine.listStalledRuns}. */
|
|
5152
5478
|
interface ListStalledRunsOptions {
|
|
@@ -5189,12 +5515,29 @@ declare class WorkflowEngine {
|
|
|
5189
5515
|
private readonly unregisteredWorkflowGraceMs;
|
|
5190
5516
|
private readonly remoteAdvanceSilenceMs?;
|
|
5191
5517
|
private readonly reconcileMs;
|
|
5518
|
+
/** Parked workflow bodies kept between turns (see {@link WorkflowEngineDeps.stickyRuns}). */
|
|
5519
|
+
private readonly sticky;
|
|
5520
|
+
/** Pending runs claimed by {@link runPending} for the turn about to run them, as read by the claim. */
|
|
5521
|
+
private readonly claimedRuns;
|
|
5522
|
+
/** The continuation each turn executing here runs in, by run id, while the turn runs. */
|
|
5523
|
+
private readonly turnContinuations;
|
|
5524
|
+
/** Whether to ask transports to route step results back here (see {@link WorkflowEngineDeps.routeReplies}). */
|
|
5525
|
+
private readonly routeReplies;
|
|
5526
|
+
/** Whether a transport routes this instance's step results back to it. */
|
|
5527
|
+
private repliesRouted;
|
|
5528
|
+
/** The run row stamp (`updatedAt`, epoch ms) a turn here wrote when it settled `suspended`. */
|
|
5529
|
+
private readonly suspendStamps;
|
|
5192
5530
|
private readonly timerBatchSize;
|
|
5193
5531
|
private readonly eventBufferTtlMs;
|
|
5532
|
+
private readonly signalIdTtlMs;
|
|
5533
|
+
/** The deduplicated {@link signal} sends in flight here, by `token \u0000 id`. */
|
|
5534
|
+
private readonly signalIdSends;
|
|
5194
5535
|
private readonly remoteRedispatchMs;
|
|
5195
5536
|
private readonly remoteRedispatchMax;
|
|
5196
5537
|
/** How long a `blocked` run waits before the recovery poll re-checks the live fleet (design §7.5). */
|
|
5197
5538
|
private readonly blockedPollMs;
|
|
5539
|
+
private readonly workerDescriptorCacheMs;
|
|
5540
|
+
private readonly descriptorCache;
|
|
5198
5541
|
/** This engine's control-plane handshake descriptor — negotiated against each worker (design §7.3). */
|
|
5199
5542
|
private readonly cpDescriptor;
|
|
5200
5543
|
private readonly webhookUrl?;
|
|
@@ -5349,6 +5692,8 @@ declare class WorkflowEngine {
|
|
|
5349
5692
|
private readonly claimsMade;
|
|
5350
5693
|
/** Pager hooks for stranded runs (see {@link onStalled}). */
|
|
5351
5694
|
private readonly stalledListeners;
|
|
5695
|
+
/** `parentClose` policies recorded by the turn in flight, per parent run (see {@link settleParentClose}). */
|
|
5696
|
+
private readonly parentCloseIntents;
|
|
5352
5697
|
/** Runs already paged about, by id → the `updatedAt` of the paged episode (see {@link sweepStalled}). */
|
|
5353
5698
|
private readonly notifiedStalled;
|
|
5354
5699
|
private lastStalledSweepAt;
|
|
@@ -5611,6 +5956,13 @@ declare class WorkflowEngine {
|
|
|
5611
5956
|
* store without `listBufferedSignals`/`deleteBufferedSignals`. Returns how many rows it deleted.
|
|
5612
5957
|
*/
|
|
5613
5958
|
sweepBufferedSignals(now?: number, budgetMs?: number): Promise<number>;
|
|
5959
|
+
/**
|
|
5960
|
+
* Delete the signal-id records (`signal(..., { id })`) that expired by `now`, in batches of
|
|
5961
|
+
* {@link SIGNAL_ID_SWEEP_BATCH}, at most `maxBatches` per call. Expired records already stop
|
|
5962
|
+
* deduplicating; this reclaims their rows. The NestJS timer poller calls it every tick. Returns how
|
|
5963
|
+
* many it deleted; 0 on a store without `deleteExpiredSignalIds`.
|
|
5964
|
+
*/
|
|
5965
|
+
sweepExpiredSignalIds(now?: number, maxBatches?: number): Promise<number>;
|
|
5614
5966
|
/**
|
|
5615
5967
|
* Register a pager hook for STRANDED runs: an in-flight run untouched past `stalledAfterMs` that is
|
|
5616
5968
|
* either suspended with NO wake timer (wake-forever: nothing will ever re-drive it) or parked on an
|
|
@@ -6026,6 +6378,7 @@ declare class WorkflowEngine {
|
|
|
6026
6378
|
*/
|
|
6027
6379
|
private updateRunIfFallback;
|
|
6028
6380
|
private resumeRunNow;
|
|
6381
|
+
private resumeLoadedRun;
|
|
6029
6382
|
/**
|
|
6030
6383
|
* The registration for an UNREGISTERED run, INHERITED from its nearest REMOTE ancestor — or
|
|
6031
6384
|
* `undefined` if it has none (the skew-protection error case in {@link resume}). Callers check the
|
|
@@ -6361,6 +6714,11 @@ declare class WorkflowEngine {
|
|
|
6361
6714
|
* for a pod that does have the workflow — which is exactly what the skew-protection error asks
|
|
6362
6715
|
* for. Same posture as `publishEvent`'s per-subscriber isolation.
|
|
6363
6716
|
*/
|
|
6717
|
+
/**
|
|
6718
|
+
* Run `claimed` (pending runs this instance just leased, read as locked): every turn starts at
|
|
6719
|
+
* once, and each re-enters the lease taken for it without reading the run again.
|
|
6720
|
+
*/
|
|
6721
|
+
private runClaimed;
|
|
6364
6722
|
private resumeLeased;
|
|
6365
6723
|
/**
|
|
6366
6724
|
* Deliver an external signal to the run waiting on `token` and resume it with `payload`.
|
|
@@ -6401,6 +6759,19 @@ declare class WorkflowEngine {
|
|
|
6401
6759
|
* same way.
|
|
6402
6760
|
*/
|
|
6403
6761
|
private deliverSignal;
|
|
6762
|
+
/**
|
|
6763
|
+
* Deliver to a waiter that is one condition of a `ctx.waitForAny` (see `wait-any.ts`): settle the
|
|
6764
|
+
* wait with this condition through the checkpoint's compare-and-set, then wake the run. A signal
|
|
6765
|
+
* that loses — the wait was settled by another condition first, or a timer of the wait came due
|
|
6766
|
+
* before it arrived (the timer then wins) — is not consumed: it is sent again on its token, where
|
|
6767
|
+
* it is buffered for the next wait (or reaches a waiter registered since).
|
|
6768
|
+
*/
|
|
6769
|
+
private deliverToWaitAny;
|
|
6770
|
+
/**
|
|
6771
|
+
* Put back a signal a `waitForAny` condition took but did not win with. A child's completion is
|
|
6772
|
+
* kept only where a parent can still consume it, as {@link deliverToParent} decides.
|
|
6773
|
+
*/
|
|
6774
|
+
private redeliverLosingSignal;
|
|
6404
6775
|
/**
|
|
6405
6776
|
* The `ctx.all` join barrier: true when `waiter` was one child of a fan (or of one wave of it)
|
|
6406
6777
|
* whose siblings are still out, so waking the parent now would only replay the fan and re-suspend.
|
|
@@ -6496,7 +6867,14 @@ declare class WorkflowEngine {
|
|
|
6496
6867
|
* Either way, the destructive `take*` ops (on the waiter row, on the buffer) arbitrate: whichever
|
|
6497
6868
|
* side actually removes the row is the one that delivers, so a signal is never delivered twice.
|
|
6498
6869
|
*/
|
|
6499
|
-
signal(token: string, payload: unknown): Promise<RunResult | null>;
|
|
6870
|
+
signal(token: string, payload: unknown, opts?: SignalOptions): Promise<RunResult | null>;
|
|
6871
|
+
/** One deduplicated {@link signal}: claim `id`, then deliver or buffer; a failure forgets the id. */
|
|
6872
|
+
private signalOnce;
|
|
6873
|
+
/**
|
|
6874
|
+
* {@link signal} without deduplication: deliver to the waiter on `token`, or buffer. `committed`
|
|
6875
|
+
* is called once the signal is durably delivered or buffered.
|
|
6876
|
+
*/
|
|
6877
|
+
private deliverOrBuffer;
|
|
6500
6878
|
/**
|
|
6501
6879
|
* Wake the run parked on `token` with `payload`, if there is one; otherwise do nothing — unlike
|
|
6502
6880
|
* {@link signal}, it never buffers. For a wake-up whose real payload is ALREADY buffered on the
|
|
@@ -6635,6 +7013,12 @@ declare class WorkflowEngine {
|
|
|
6635
7013
|
* explicitly cancelled one's does, or the children are orphans nobody is holding a reference to.
|
|
6636
7014
|
*/
|
|
6637
7015
|
private cancelChildren;
|
|
7016
|
+
/**
|
|
7017
|
+
* Apply the `parentClose` policies a parent's turn recorded (see {@link ChildCallOptions.parentClose})
|
|
7018
|
+
* when that parent completes or fails; forget them when it suspends (its next turn, here or on
|
|
7019
|
+
* another instance, records them again). Local events only: this is the instance that ran the turn.
|
|
7020
|
+
*/
|
|
7021
|
+
private settleParentClose;
|
|
6638
7022
|
/**
|
|
6639
7023
|
* The ids of the runs a run spawned — both awaited (`ctx.child`) and fire-and-forget
|
|
6640
7024
|
* (`ctx.startChild`, found via its `spawn:<id>` checkpoint). The canonical parent→children edge,
|
|
@@ -6764,12 +7148,9 @@ declare class WorkflowEngine {
|
|
|
6764
7148
|
* the timer poll of another instance runs it once this instance's hold on it would have lapsed.
|
|
6765
7149
|
*/
|
|
6766
7150
|
private honorWakeRequests;
|
|
6767
|
-
/**
|
|
6768
|
-
* The wake requests kept for `runId`. With `legacy`, also those an older engine kept as buffered
|
|
6769
|
-
* signals, which are taken as they are read.
|
|
6770
|
-
*/
|
|
7151
|
+
/** The wake requests kept for `runId`. */
|
|
6771
7152
|
private listWakeRequests;
|
|
6772
|
-
/** Delete `requests
|
|
7153
|
+
/** Delete `requests`. */
|
|
6773
7154
|
private dropWakeRequests;
|
|
6774
7155
|
/**
|
|
6775
7156
|
* Record, for the turn executing `runId` here, the wakes kept for the run so far. Called before the
|
|
@@ -7119,6 +7500,8 @@ declare class WorkflowEngine {
|
|
|
7119
7500
|
* - a `blocked` plan — descriptors exist but none can run it (park the run, never dispatch into it).
|
|
7120
7501
|
*/
|
|
7121
7502
|
private planRoute;
|
|
7503
|
+
/** The live descriptors for `token`, reused for {@link workerDescriptorCacheMs}; one read in flight. */
|
|
7504
|
+
private liveWorkerDescriptors;
|
|
7122
7505
|
/** Throw {@link WorkflowBlocked} when no live worker can run a dispatch to `token` — so the caller's
|
|
7123
7506
|
* run-execution catch parks the run `blocked` (with the plan) instead of persisting a `pending`
|
|
7124
7507
|
* checkpoint + dispatching into a queue nobody consumes (design §7.5). A no-op when the guard does
|
|
@@ -7139,6 +7522,13 @@ declare class WorkflowEngine {
|
|
|
7139
7522
|
* capable+compatible worker has appeared, else re-parks with a fresh `wakeAt` (design §7.5). */
|
|
7140
7523
|
private dueBlockedRuns;
|
|
7141
7524
|
private callRemote;
|
|
7525
|
+
/**
|
|
7526
|
+
* {@link callRemote}'s first dispatch of a step, written with
|
|
7527
|
+
* {@link StateStore.insertCheckpointIfAbsent}: resolves whether it wrote the `pending` row and
|
|
7528
|
+
* dispatched. `false` when the position already has a row, or when no live worker can take the
|
|
7529
|
+
* step (the read-first path then decides, so a step that is in fact done is never blocked).
|
|
7530
|
+
*/
|
|
7531
|
+
private dispatchIfAbsent;
|
|
7142
7532
|
/**
|
|
7143
7533
|
* Whether a `pending` step a turn just read only waits for its result: {@link callRemote} would
|
|
7144
7534
|
* suspend on it without writing (no redispatch deadline to stamp, the one stamped not yet due).
|
|
@@ -7184,6 +7574,29 @@ declare class WorkflowEngine {
|
|
|
7184
7574
|
* all at its front: pruning stops at the first fresh entry instead of walking the whole map.
|
|
7185
7575
|
*/
|
|
7186
7576
|
private noteRecent;
|
|
7577
|
+
/**
|
|
7578
|
+
* Whether this turn of `run` may run in a sticky continuation (see `sticky-continuation.ts`). Not
|
|
7579
|
+
* while the engine drains, for a cancel being compensated, nor when execution wrappers are
|
|
7580
|
+
* registered: a resumed body runs in the async scope of the turn that started it, and a wrapper
|
|
7581
|
+
* (a span, a log batch) expects one scope per turn.
|
|
7582
|
+
*/
|
|
7583
|
+
private stickyEligible;
|
|
7584
|
+
/**
|
|
7585
|
+
* The continuation this instance parked for `run`, if it is still the run's latest turn: the run
|
|
7586
|
+
* is `suspended` with the very stamp this instance's suspend wrote, on the same body and version.
|
|
7587
|
+
* Any other settle in between (another instance's turn, a retry, a cancel) changed the stamp, and
|
|
7588
|
+
* the run replays instead. Taking it removes it from the cache.
|
|
7589
|
+
*/
|
|
7590
|
+
private takeContinuation;
|
|
7591
|
+
/** Keep `cont` (parked, detached) for the run's next turn here, stamped with its suspend write. */
|
|
7592
|
+
private keepContinuation;
|
|
7593
|
+
/**
|
|
7594
|
+
* The checkpoints of the steps `cont` is parked on, as a replay would see them: in one read when
|
|
7595
|
+
* the store batches, and without the input of a step that completed (what
|
|
7596
|
+
* {@link StateStore.getCheckpointsForSettle} leaves out). A step still open or failed is read
|
|
7597
|
+
* whole, since a re-dispatch or a retry sends its input again.
|
|
7598
|
+
*/
|
|
7599
|
+
private readParked;
|
|
7187
7600
|
/**
|
|
7188
7601
|
* The run's checkpoints as a turn replays them: {@link StateStore.listCheckpointsForReplay} when
|
|
7189
7602
|
* the store has it (no input on a completed row), else {@link StateStore.listCheckpoints}.
|
|
@@ -7250,6 +7663,14 @@ declare class WorkflowEngine {
|
|
|
7250
7663
|
* under a backlog the barrier is read once per drained queue rather than once per batch.
|
|
7251
7664
|
*/
|
|
7252
7665
|
private completeRemoteResults;
|
|
7666
|
+
/**
|
|
7667
|
+
* {@link completeRemoteResults} on a store with {@link StateStore.settleResultsIfPending}: the
|
|
7668
|
+
* results settle their `pending` rows and read them back in one call, instead of a read of the rows
|
|
7669
|
+
* followed by the write. Only an entry that wrote nothing (a redelivery, or a step gone) is read
|
|
7670
|
+
* afterwards. A settled `completed` row is also handed to the run's parked body, if this instance
|
|
7671
|
+
* holds one, so its next turn does not read it again.
|
|
7672
|
+
*/
|
|
7673
|
+
private settleResultsReturning;
|
|
7253
7674
|
/**
|
|
7254
7675
|
* The outcomes for a batch of redelivered results (their steps already settled): one of them
|
|
7255
7676
|
* resumes the run if it is `suspended` and, for a step of a fan, the fan's barrier is open. A
|
|
@@ -7996,6 +8417,15 @@ declare class CodecStateStore implements StateStore {
|
|
|
7996
8417
|
/** Encodes each settlement's payloads like {@link saveCheckpoint}. Bound only when the inner store
|
|
7997
8418
|
* has it, so the engine's whole-row fallback still kicks in through the wrapper. */
|
|
7998
8419
|
readonly settleCheckpointsIfPending?: (settlements: StepSettlement[]) => Promise<boolean[]>;
|
|
8420
|
+
/** Encodes each result's payloads, decodes each row read back. Bound only when the inner store
|
|
8421
|
+
* has it. */
|
|
8422
|
+
readonly settleResultsIfPending?: (results: StepResultSettlement[]) => Promise<(StepCheckpoint | null)[]>;
|
|
8423
|
+
/** Encodes like {@link saveCheckpoint}. Bound only when the inner store has it. */
|
|
8424
|
+
readonly insertCheckpointIfAbsent?: (checkpoint: StepCheckpoint) => Promise<boolean>;
|
|
8425
|
+
/** Decodes each run claimed. Bound only when the inner store has it. */
|
|
8426
|
+
readonly claimPendingRuns?: (limit: number, owner: string, leaseUntilMs: number, nowMs: number, namespace?: string) => Promise<WorkflowRun[]>;
|
|
8427
|
+
/** Decodes the run read. Bound only when the inner store has it. */
|
|
8428
|
+
readonly tryLockRunAndGet?: (runId: string, owner: string, leaseUntilMs: number, nowMs: number) => Promise<WorkflowRun | null>;
|
|
7999
8429
|
/** Encodes each checkpoint written. Bound only when the inner store has it. */
|
|
8000
8430
|
readonly saveCheckpoints?: (checkpoints: StepCheckpoint[]) => Promise<void>;
|
|
8001
8431
|
/** Decodes each checkpoint read like {@link listCheckpoints}. Bound only when the inner store has
|
|
@@ -8033,6 +8463,17 @@ declare class CodecStateStore implements StateStore {
|
|
|
8033
8463
|
readonly listBufferedSignals?: (tokenPrefix: string, afterId: string | undefined, limit: number) => Promise<BufferedSignalRow[]>;
|
|
8034
8464
|
/** Forwarded verbatim — deletes by row id. */
|
|
8035
8465
|
readonly deleteBufferedSignals?: (ids: string[]) => Promise<void>;
|
|
8466
|
+
/** Decodes the payload like {@link takeBufferedSignal}. Bound only when the inner store has it. */
|
|
8467
|
+
readonly takeOldestBufferedSignal?: (tokens: string[]) => Promise<{
|
|
8468
|
+
token: string;
|
|
8469
|
+
payload: unknown;
|
|
8470
|
+
} | null>;
|
|
8471
|
+
/** Forwarded verbatim — a signal id record carries no payload. */
|
|
8472
|
+
readonly claimSignalId?: (token: string, id: string, expiresAt: number, nowMs: number) => Promise<boolean>;
|
|
8473
|
+
/** Forwarded verbatim. */
|
|
8474
|
+
readonly releaseSignalId?: (token: string, id: string) => Promise<void>;
|
|
8475
|
+
/** Forwarded verbatim. */
|
|
8476
|
+
readonly deleteExpiredSignalIds?: (nowMs: number, limit: number) => Promise<number>;
|
|
8036
8477
|
/** Forwarded verbatim — a waiter carries no payload. */
|
|
8037
8478
|
readonly listSignalWaitersByRun?: (runIds: string[]) => Promise<SignalWaiter[]>;
|
|
8038
8479
|
/** Forwarded verbatim — a waiter carries no payload. */
|
|
@@ -8524,6 +8965,41 @@ interface WorkflowHandler<TInput = unknown, TOutput = unknown, A extends SearchA
|
|
|
8524
8965
|
run(ctx: WorkflowCtx<A>, input: TInput): Promise<TOutput> | TOutput;
|
|
8525
8966
|
}
|
|
8526
8967
|
|
|
8968
|
+
/**
|
|
8969
|
+
* `ctx.waitForAny(name, conditions)`: one durable wait over several conditions (signals, timers,
|
|
8970
|
+
* child runs), resolved by the FIRST of them, journaled at one position. The machinery lives here so
|
|
8971
|
+
* the in-process ctx (`workflow-ctx.ts`) and the remote `waitAny` command (`engine.applyCommands`)
|
|
8972
|
+
* resolve it the same way, and the engine's signal delivery ({@link isAnyMember}) can settle it from
|
|
8973
|
+
* the sending side.
|
|
8974
|
+
*
|
|
8975
|
+
* How it stays exactly-once, and why a losing signal is not consumed:
|
|
8976
|
+
*
|
|
8977
|
+
* - The wait's position holds ONE checkpoint, `any:<name>`, written `pending` the first time the wait
|
|
8978
|
+
* is reached, with the conditions (timers resolved to absolute deadlines) as its `input`. Whoever
|
|
8979
|
+
* flips it to `completed` — through the store's compare-and-set {@link StateStore.saveCheckpointIfPending}
|
|
8980
|
+
* — is the winner. Nothing else arbitrates, so two conditions landing at once can't both win.
|
|
8981
|
+
* - Every signal/child condition registers an ordinary waiter on its own token, at the wait's
|
|
8982
|
+
* position, tagged {@link ANY_WAIT_GROUP}. A signal sent while the run waits takes that waiter, as
|
|
8983
|
+
* any signal does, and then tries the compare-and-set. If it loses (another condition already
|
|
8984
|
+
* won, or a timer's deadline passed first) the engine sends the payload again on its token
|
|
8985
|
+
* ({@link WorkflowEngine.signal}), so it is buffered for the next wait on that token instead of
|
|
8986
|
+
* being consumed.
|
|
8987
|
+
* - A signal buffered before the wait, or between registering and suspending, is taken here
|
|
8988
|
+
* ({@link takeOldestBuffered}); if that take then loses the compare-and-set, it goes back into the
|
|
8989
|
+
* buffer.
|
|
8990
|
+
* - The winner removes the other conditions' waiters. A losing timer is simply never fired (the run's
|
|
8991
|
+
* wake time moves on with its next wait). A losing child keeps running: its completion is buffered
|
|
8992
|
+
* as for any child nobody waits on, so a later `ctx.child(..., id)` still joins it.
|
|
8993
|
+
*/
|
|
8994
|
+
/** The `parallelGroup` that marks a signal waiter as one condition of a `waitForAny`. */
|
|
8995
|
+
declare const ANY_WAIT_GROUP = "$any";
|
|
8996
|
+
/** The checkpoint name of the wait called `name`. */
|
|
8997
|
+
declare function anyCheckpointName(name: string): string;
|
|
8998
|
+
/** Whether `cp` is a `waitForAny` checkpoint. */
|
|
8999
|
+
declare function isAnyCheckpoint(cp: StepCheckpoint): boolean;
|
|
9000
|
+
/** Whether `waiter` is one condition of a `waitForAny`. */
|
|
9001
|
+
declare function isAnyMember(waiter: SignalWaiter): boolean;
|
|
9002
|
+
|
|
8527
9003
|
/**
|
|
8528
9004
|
* A non-durable, in-process `StateStore` for tests and local development.
|
|
8529
9005
|
* The shipped `@dudousxd/nestjs-durable-store` package re-exports an equivalent.
|
|
@@ -8574,6 +9050,16 @@ declare class InMemoryStateStore implements StateStore {
|
|
|
8574
9050
|
saveCheckpointIfPending(checkpoint: StepCheckpoint): Promise<boolean>;
|
|
8575
9051
|
saveCheckpointsIfPending(checkpoints: StepCheckpoint[]): Promise<boolean[]>;
|
|
8576
9052
|
settleCheckpointsIfPending(settlements: StepSettlement[]): Promise<boolean[]>;
|
|
9053
|
+
readonly settleResultsIfPending?: (results: StepResultSettlement[]) => Promise<(StepCheckpoint | null)[]>;
|
|
9054
|
+
readonly insertCheckpointIfAbsent?: (checkpoint: StepCheckpoint) => Promise<boolean>;
|
|
9055
|
+
readonly tryLockRunAndGet?: (runId: string, owner: string, leaseUntilMs: number, nowMs: number) => Promise<WorkflowRun | null>;
|
|
9056
|
+
readonly claimPendingRuns?: (limit: number, owner: string, leaseUntilMs: number, nowMs: number, namespace?: string) => Promise<WorkflowRun[]>;
|
|
9057
|
+
constructor(opts?: {
|
|
9058
|
+
roundTripMethods?: boolean;
|
|
9059
|
+
});
|
|
9060
|
+
private settleResultsFallback;
|
|
9061
|
+
private insertIfAbsentFallback;
|
|
9062
|
+
private lockAndGetFallback;
|
|
8577
9063
|
listOrphanedRuns(nowMs: number, limit: number, namespace?: string, ownedBy?: OwnedLeaseReclaim): Promise<WorkflowRun[]>;
|
|
8578
9064
|
listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
|
|
8579
9065
|
listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
|
|
@@ -8599,6 +9085,15 @@ declare class InMemoryStateStore implements StateStore {
|
|
|
8599
9085
|
takeBufferedSignal(token: string): Promise<{
|
|
8600
9086
|
payload: unknown;
|
|
8601
9087
|
} | null>;
|
|
9088
|
+
takeOldestBufferedSignal(tokens: string[]): Promise<{
|
|
9089
|
+
token: string;
|
|
9090
|
+
payload: unknown;
|
|
9091
|
+
} | null>;
|
|
9092
|
+
/** `token \u0000 id -> expiresAt` of the signal ids {@link claimSignalId} recorded. */
|
|
9093
|
+
private readonly signalIds;
|
|
9094
|
+
claimSignalId(token: string, id: string, expiresAt: number, nowMs: number): Promise<boolean>;
|
|
9095
|
+
releaseSignalId(token: string, id: string): Promise<void>;
|
|
9096
|
+
deleteExpiredSignalIds(nowMs: number, limit: number): Promise<number>;
|
|
8602
9097
|
listBufferedSignals(tokenPrefix: string, afterId: string | undefined, limit: number): Promise<BufferedSignalRow[]>;
|
|
8603
9098
|
deleteBufferedSignals(ids: string[]): Promise<void>;
|
|
8604
9099
|
/** `id -> row`, so {@link removeBufferedEvent} can delete an exact row regardless of iteration
|
|
@@ -8762,4 +9257,63 @@ declare function singletonAdmissionDenialPatch(runs: WorkflowRun[], runId: strin
|
|
|
8762
9257
|
updatedAt: Date;
|
|
8763
9258
|
} | undefined;
|
|
8764
9259
|
|
|
8765
|
-
|
|
9260
|
+
/**
|
|
9261
|
+
* RFC 5545 recurrence rules for persisted schedules (`engine.schedules.create({ rrule })`), evaluated
|
|
9262
|
+
* in an IANA time zone with no dependency.
|
|
9263
|
+
*
|
|
9264
|
+
* Accepted text: `FREQ=WEEKLY;BYDAY=MO;BYHOUR=8`, optionally prefixed `RRULE:`, optionally preceded by
|
|
9265
|
+
* a `DTSTART:20260105T080000` line (local time in the schedule's zone, or UTC with a trailing `Z`).
|
|
9266
|
+
*
|
|
9267
|
+
* Supported parts: `FREQ` (`YEARLY`, `MONTHLY`, `WEEKLY`, `DAILY`, `HOURLY`, `MINUTELY`), `INTERVAL`,
|
|
9268
|
+
* `COUNT`, `UNTIL`, `BYMONTH`, `BYMONTHDAY` (negative counts from the month's end), `BYDAY` (with an
|
|
9269
|
+
* ordinal such as `1MO` or `-1FR` under `MONTHLY`/`YEARLY`), `BYHOUR`, `BYMINUTE`, `BYSECOND`, `WKST`.
|
|
9270
|
+
* Anything else (`BYSETPOS`, `BYWEEKNO`, `BYYEARDAY`, `SECONDLY`) is refused by name rather than
|
|
9271
|
+
* ignored.
|
|
9272
|
+
*
|
|
9273
|
+
* Without `DTSTART` the rule is anchored at 1970-01-01T00:00 in the zone: give one when the rule
|
|
9274
|
+
* uses `INTERVAL` > 1 or `COUNT`, or relies on DTSTART's defaults (a `WEEKLY` rule without `BYDAY`
|
|
9275
|
+
* repeats DTSTART's weekday; a missing `BYHOUR`/`BYMINUTE`/`BYSECOND` takes DTSTART's).
|
|
9276
|
+
*
|
|
9277
|
+
* Local times that don't exist (the hour skipped when clocks go forward) are skipped, as RFC 5545
|
|
9278
|
+
* says; an ambiguous one (the hour repeated when they go back) fires once, at its first instant.
|
|
9279
|
+
*/
|
|
9280
|
+
type Freq = 'YEARLY' | 'MONTHLY' | 'WEEKLY' | 'DAILY' | 'HOURLY' | 'MINUTELY';
|
|
9281
|
+
interface ByDay {
|
|
9282
|
+
weekday: number;
|
|
9283
|
+
nth?: number;
|
|
9284
|
+
}
|
|
9285
|
+
interface ParsedRRule {
|
|
9286
|
+
freq: Freq;
|
|
9287
|
+
interval: number;
|
|
9288
|
+
count?: number;
|
|
9289
|
+
/** Epoch ms, inclusive. */
|
|
9290
|
+
until?: number;
|
|
9291
|
+
byMonth?: number[];
|
|
9292
|
+
byMonthDay?: number[];
|
|
9293
|
+
byDay?: ByDay[];
|
|
9294
|
+
byHour?: number[];
|
|
9295
|
+
byMinute?: number[];
|
|
9296
|
+
bySecond?: number[];
|
|
9297
|
+
wkst: number;
|
|
9298
|
+
/** Epoch ms of DTSTART. */
|
|
9299
|
+
start: number;
|
|
9300
|
+
timezone: string;
|
|
9301
|
+
}
|
|
9302
|
+
/** Parse and validate a rule. Throws with the offending part named. */
|
|
9303
|
+
declare function parseRRule(text: string, timezone?: string): ParsedRRule;
|
|
9304
|
+
/** The first occurrence strictly after `afterMs`, or `null` when the rule has ended. */
|
|
9305
|
+
declare function nextRRuleFireMs(rule: ParsedRRule, afterMs: number): number | null;
|
|
9306
|
+
/** The latest occurrence at or before `atMs`, or `null` when there is none yet. */
|
|
9307
|
+
declare function prevRRuleFireMs(rule: ParsedRRule, atMs: number): number | null;
|
|
9308
|
+
|
|
9309
|
+
/**
|
|
9310
|
+
* {@link StateStore.settleResultsIfPending} built on a store's batched plain calls, for an adapter on
|
|
9311
|
+
* a database without `RETURNING` (MySQL) settling a batch of results: the batch's runs and rows are
|
|
9312
|
+
* read once each, the rows still `pending` of runs not finished are settled with
|
|
9313
|
+
* {@link StateStore.settleCheckpointsIfPending} (one batched, transactional call), and the rows it
|
|
9314
|
+
* settled are read back. A fixed number of statements however wide the batch, where settling each
|
|
9315
|
+
* result on its own would cost two per result.
|
|
9316
|
+
*/
|
|
9317
|
+
declare function settleResultsWithPlainCalls(store: Pick<StateStore, 'getRun' | 'getCheckpoint'> & Partial<Pick<StateStore, 'getRuns' | 'getCheckpointsForSettle' | 'getCheckpoints' | 'settleCheckpointsIfPending'>>, results: StepResultSettlement[]): Promise<(StepCheckpoint | null)[]>;
|
|
9318
|
+
|
|
9319
|
+
export { ACCUMULATOR_SEEN_MAX, ANY_WAIT_GROUP, type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllSettledOptions, type AllStepsOptions, type AllStepsSettledOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, type BufferedSignalRow, CHILD_EDGE_PREFIXES, CONTROL_FLOW_SIGNAL, CORE_ORIGIN, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type CheckpointAggregatingStore, type CheckpointNameKind, type CheckpointQuery, type CheckpointStat, type ChildCallOptions, type ChildWait, CodecStateStore, type CodecStateStoreOptions, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, type ConsoleCapabilities, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, DEFAULT_STALLED_AFTER_MS, DURABLE_OPTIONS, DURABLE_OPTIONS_CANONICAL, DURABLE_STEP_CONFIG, DURABLE_STEP_NAME, type Disagreement, type DispatchDiagnostics, type DispatchPlan, type DurableExecution, type DurableExecutionWrapper, type DurableTopology, type DurableWebhook, DurableWorkflow, type DynamicWorkflowCtx, ENGINE_MINTED_TAG_PREFIXES, ENTITY_WORKFLOW, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, type EntityWorkflowHost, EventAccumulators, type EventBatchConfig, type EventSubscription, FAN_SUMMARY_FAILURES, type FanJoin, type FanPage, type FanPageQuery, type FanSummary, type FanWait, FatalError, type FindStalledRunsOptions, GatherError, type GatherItemFailure, type GroupHealth, HANDOFF_SEQ_BASE, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryRunQueue, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, LIFECYCLE_COALESCED_TAG_PREFIX, LIFECYCLE_HEAL_WINDOW_MS, LIFECYCLE_ORPHAN_MS, LIFECYCLE_OWED_TAG_PREFIX, LIFECYCLE_PENDING_TAG, LIFECYCLE_REGISTRY_HEARTBEAT_MS, LIFECYCLE_REGISTRY_STALE_MS, LIFECYCLE_REGISTRY_TAG, LIFECYCLE_REGISTRY_TTL_MS, LIFECYCLE_REGISTRY_WORKFLOW, LIFECYCLE_TRACE_TAG_PREFIX, LIFECYCLE_TRIGGERED_TAG_PREFIX, LIFECYCLE_TRIGGER_FAILED_TAG_PREFIX, type LifecycleDelivery, type LifecycleDeliveryState, type LifecycleEventOf, type LifecycleKind, type LifecycleRegistryEntry, type LifecycleSource, type LifecycleSubscriptionLink, type ListStalledRunsOptions, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type OnErrorInput, type OnErrorRoute, type OnEventEntry, type OwnedLeaseReclaim, PARENT_CLOSE_TAG_PREFIX, type ParentClosePolicy, type ParsedRRule, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, REMOTE_EVENT, RUN_HISTORY_FIXTURE_VERSION, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, RUN_WAIT_TOKEN_PREFIX, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RepublishLifecycleResult, type RepublishLifecycleTarget, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunConsumerOptions, type RunDetail, type RunDetailOptions, type RunDispatch, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, type RunQueueOptions, type RunReply, type RunReplyResult, type RunRequest, type RunRequestKind, type RunResult, type RunSchedulesOptions, type RunScope, type RunStatus, type RunValueAxis, type RunValueFacetOptions, type RunValueFacetOrder, type RunValueFacetRow, type RunWaitLink, type RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, SINGLETON_LOCK_CHUNK, SINGLETON_RESERVED_TAGS, SINGLETON_TRACKED_TAG, STATE_STORE, STATE_STORE_CANONICAL, SUMMARY_CHILD_LIMIT, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SchemaIssue, type SchemaValidationCode, SchemaValidationError, type SearchAttributes, type SearchAttributesSchema, type Settled, type SignalOptions, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, type StalePendingStep, type StalledRunInfo, StandardSchemaV1, type StartOptions, type StartRunMessage, type StateStore, type StepCheckpoint, type StepConfig, type StepDef, type StepDispatchOpts, type StepError, type StepEvent, type StepHandler, type StepInterceptor, type StepInvocation, type StepKind, type StepLogger, type StepOptions, type StepRef, type StepResult, type StepResultSettlement, type StepScope, type StepSettlement, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type TenantTokenSource, type TenantVerifier, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, type VerifiedTenant, WORKFLOW_NAME_KEY, type WaitAnyCondition, type WaitAnyOutcome, type WaitAnyResult, type WaitCondition, type WaitConditionSpec, type WaitForRunOptions, type WireDates, type WorkerAdjust, type WorkerConcurrencyStatus, type WorkerDescriptor, type WorkerHeartbeat, type WorkerLifecycle, type WorkerStatus, type WorkflowAnnouncement, WorkflowBlocked, type WorkflowClass, type WorkflowCommand, type WorkflowCtx, type WorkflowDecision, type WorkflowDirectory, WorkflowEngine, type WorkflowEngineDeps, type WorkflowExecutor, type WorkflowHandler, type WorkflowInputOf, type WorkflowLifecycleEvent, type WorkflowLifecycleLinks, WorkflowNotRegistered, type WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, acceptingSubscription, accumulatorRunId, aggregateAnnouncements, aggregatesCheckpoints, announcementsOf, anyCheckpointName, applyAttributeQuery, assertConcurrency, assertRoutes, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, carriesLifecyclePending, checkpointNameKind, checkpointStatsOf, childIdsOf, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, coalescedSubscribersOf, codeAndDetails, codeOf, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, detailsOf, error, etagMatches, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, extendEtag, facetOrigin, fanPageBounds, fanPageEtag, findStalledRuns, foldedCount, getRunsByIds, handoffHandlerId, handoffName, hasDurableExecutionWrappers, heartbeatStatus, hmacTenantVerifier, indexWaitersByRun, info, isAnyCheckpoint, isAnyMember, isEngineMintedTag, isEventToken, isFailedMember, isLegacyDescriptor, isLifecycleTag, isNonEmptyRunScope, isRemoteEvent, isWorkflowControlFlowSignal, legacySingletonHolders, lifecycleDeliveriesOf, lifecycleEventName, lifecycleEventOf, lifecycleKindOf, lifecycleRegistryNamespace, lifecycleRegistryRunId, lifecycleRegistrySubscriptions, lifecycleRunId, lifecycleSourceOf, lifecycleTraceparentOf, listSignalWaitersOfRuns, liveHandoff, log, markRemoteEvent, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, nextRRuleFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, onErrorRunId, owedSubscribersOf, pageFan, pageFanFromStore, parentRunIdOf, parseDuration, parseLifecycleEvent, parseRRule, parseWebhookToken, partitionOfToken, planDispatch, poolNamespace, prevCronFireMs, prevRRuleFireMs, queryCheckpointsOf, readRunsByIds, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, resolveTenantToken, resolveWireTenant, retentionKeeps, retiredHandoffName, routeFor, runCompletedEvent, runDetailEtag, runDurableExecution, runFailedEvent, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, runWaitPrefix, runWaitTargetOf, runWaitToken, sanitizeQueueToken, scheduleRunIdAt, scheduledRunId, settleResultsWithPlainCalls, signTenantToken, singletonAdmissionDenialPatch, singletonAdmissionTags, singletonClaimantIds, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, summarizeFan, summarizeRunFromStore, summarizeTimeline, tenantGroup, toEventSubscription, traceIdOfTraceparent, triggerFailedSubscribersOf, triggeredRunsOf, triggeredSubscribersOf, useDurableExecution, warn, withSingletonTracked, withoutSingletonMarkers, workflowName };
|