@dudousxd/nestjs-durable-core 0.76.0 → 0.77.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.d.cts CHANGED
@@ -983,8 +983,12 @@ interface StateStore {
983
983
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
984
984
  /** The oldest `pending` runs awaiting dispatch (FIFO, by `createdAt`), capped at `limit`. */
985
985
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
986
- /** Suspended runs whose durable timer is due (`wakeAt <= nowMs`), ready to resume. */
987
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
986
+ /**
987
+ * Suspended runs whose durable timer is due (`wakeAt <= nowMs`), ready to resume — the most
988
+ * overdue first, at most `limit` of them when it is given. Every driving instance polls this each
989
+ * tick, so a recovery wave of thousands of due runs must come back in batches, not all at once.
990
+ */
991
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
988
992
  /**
989
993
  * Atomically acquire the recovery lease on a run for `owner` until `leaseUntilMs`, but only if
990
994
  * it is currently unlocked or its lease has expired (`<= nowMs`). Returns whether it was
@@ -1175,6 +1179,15 @@ interface StateStore {
1175
1179
  * plus an in-JS prefix scan that produces the identical result.
1176
1180
  */
1177
1181
  listCheckpointsByNamePrefix?(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
1182
+ /**
1183
+ * How many of the run's checkpoints with `fromSeq <= seq <= toSeq` have one of `statuses`. The join
1184
+ * barrier of a step fan (`ctx.all` over a `@Step`) asks this on every result — "is any step of the
1185
+ * fan still `pending`?" — so it must be a count, not a load of the fan.
1186
+ *
1187
+ * Optional: a store that omits it still works — the engine falls back to {@link listCheckpoints}
1188
+ * and counts in JS, which loads the whole run on every result of a fan.
1189
+ */
1190
+ countCheckpoints?(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
1178
1191
  }
1179
1192
  /**
1180
1193
  * A persisted schedule as the STORE sees it: a handful of queryable columns plus two JSON documents
@@ -1485,6 +1498,21 @@ interface AllOptions {
1485
1498
  */
1486
1499
  concurrency?: number;
1487
1500
  }
1501
+ /**
1502
+ * Options for `ctx.all` over a `@Step` — one durable step per input instead of one child workflow
1503
+ * per input. The per-call step policy (`retries`, `backoff`, …) applies to every step of the fan.
1504
+ * Flow-control `queue`s and a liveness `timeoutMs` are not supported on a fan.
1505
+ */
1506
+ interface AllStepsOptions extends Omit<StepDispatchOpts, 'queue' | 'timeoutMs'> {
1507
+ /** `waitAll` (default) or `failFast` — see {@link WorkflowCtx.all}. */
1508
+ mode?: 'waitAll' | 'failFast';
1509
+ /**
1510
+ * The most steps in flight at once. Unset sends the whole fan immediately. When set, steps go out
1511
+ * in waves of `concurrency`, the next once the previous has settled; each wave costs the parent one
1512
+ * turn. Part of the fan's identity, like `inputs`.
1513
+ */
1514
+ concurrency?: number;
1515
+ }
1488
1516
  /** One child of a fan as {@link StateStore.registerChildWaits} writes it. */
1489
1517
  interface ChildWait {
1490
1518
  waiter: SignalWaiter;
@@ -2360,6 +2388,14 @@ interface WorkflowCtx<A extends SearchAttributes = SearchAttributes> {
2360
2388
  * `concurrency` caps how many children run at once (see {@link AllOptions.concurrency}).
2361
2389
  */
2362
2390
  all<C extends WorkflowClass>(workflow: C, inputs: WorkflowInputOf<C>[], opts?: AllOptions): Promise<WorkflowOutputOf<C>[]>;
2391
+ /**
2392
+ * Run one durable **step** per entry in `inputs` in parallel and wait for all of them — the same
2393
+ * fan as above with a `@Step` instead of a child workflow, so each item costs a step instead of a
2394
+ * whole run. The steps share a `parallelGroup` (the dashboard renders them as one fan), the parent
2395
+ * replays once per settled wave rather than once per result, and outputs come back in input order;
2396
+ * failures surface as a {@link GatherError}, like the child fan.
2397
+ */
2398
+ all<TInput, TOutput>(step: StepRef<TInput, TOutput>, inputs: TInput[], opts?: AllStepsOptions): Promise<TOutput[]>;
2363
2399
  all<TOutput = unknown>(workflow: string, inputs: unknown[], opts?: AllOptions): Promise<TOutput[]>;
2364
2400
  /**
2365
2401
  * Pause the run at this point until a human resumes it from the dashboard (or
@@ -3628,6 +3664,13 @@ interface WorkflowEngineDeps {
3628
3664
  * for a genuinely-orphaned run. Default 5min; set `0` to disable (the prior wake-forever behavior).
3629
3665
  */
3630
3666
  reconcileMs?: number | undefined;
3667
+ /**
3668
+ * The most due timers one {@link WorkflowEngine.resumeDueTimers} pass loads and drives, most
3669
+ * overdue first. Every driving instance runs that pass each tick, so a wave of thousands of due
3670
+ * runs (a recovery after an outage, a fan's children waking together) is worked through in
3671
+ * batches instead of every instance loading and walking all of it. Default 500.
3672
+ */
3673
+ timerBatchSize?: number | undefined;
3631
3674
  /**
3632
3675
  * Retention for a BUFFERED event that no `waitForEvent` ever claims (see
3633
3676
  * {@link WorkflowEngine.publishEvent}'s buffering — a publish matching no live waiter keeps ONE
@@ -3746,6 +3789,7 @@ declare class WorkflowEngine {
3746
3789
  private readonly maxRecoveryAttempts?;
3747
3790
  private readonly remoteAdvanceSilenceMs?;
3748
3791
  private readonly reconcileMs;
3792
+ private readonly timerBatchSize;
3749
3793
  private readonly eventBufferTtlMs;
3750
3794
  private readonly remoteRedispatchMs;
3751
3795
  private readonly remoteRedispatchMax;
@@ -3806,6 +3850,21 @@ declare class WorkflowEngine {
3806
3850
  * {@link redriveSettledSteps}).
3807
3851
  */
3808
3852
  private readonly awaitedRemoteSteps;
3853
+ /**
3854
+ * When THIS instance settled a remote step from its result, by `runId:seq`. That result's resume
3855
+ * runs here, and `execute` lets it into a lease this instance holds, so its wake is never the
3856
+ * dropped one {@link redriveSettledSteps} recovers. Pruned by age (see {@link noteSettledHere}).
3857
+ */
3858
+ private readonly settledHere;
3859
+ /**
3860
+ * The step fans (`ctx.all` over a `@Step`) a turn suspended on, by run, while that turn executes on
3861
+ * THIS instance — re-checked once its lease is released (see {@link redriveSettledStepFans}).
3862
+ */
3863
+ private readonly awaitedStepFans;
3864
+ /** Step fans whose join barrier this instance opened, by `runId:firstSeq` — see {@link settledHere}. */
3865
+ private readonly stepFansFiredHere;
3866
+ /** The tail of each run's queue of results being handled on this instance — see {@link serializedPerRun}. */
3867
+ private readonly resultChains;
3809
3868
  /** Flow-control admission backend for remote steps (see {@link registerQueue}). */
3810
3869
  private readonly admission;
3811
3870
  /** Runs on THIS instance blocked on admission, by queue — woken early on a freed-slot signal. */
@@ -4326,6 +4385,13 @@ declare class WorkflowEngine {
4326
4385
  * checkpoint that is already settled, which the next turn replays past — so it cannot loop.
4327
4386
  */
4328
4387
  private redriveSettledSteps;
4388
+ /**
4389
+ * {@link redriveSettledSteps} for a step fan: once the turn that suspended on it released its lease,
4390
+ * re-drive the run if no step of the fan is still `pending` — the last result landed on another
4391
+ * instance while this one held the lease, and its wake was dropped there. A fan whose barrier this
4392
+ * instance opened is skipped, for the reason {@link settledHere} gives.
4393
+ */
4394
+ private redriveSettledStepFans;
4329
4395
  private redriveSettledChildren;
4330
4396
  /**
4331
4397
  * Deliver an external signal to the run waiting on `token`, resume it with `payload`, and return
@@ -4843,6 +4909,24 @@ declare class WorkflowEngine {
4843
4909
  * capable+compatible worker has appeared, else re-parks with a fresh `wakeAt` (design §7.5). */
4844
4910
  private dueBlockedRuns;
4845
4911
  private callRemote;
4912
+ /**
4913
+ * `ctx.all` over a `@Step`: one durable step per input, dispatched together, joined once. The ctx
4914
+ * reserves the whole position block up front, so replay re-derives the same seqs.
4915
+ *
4916
+ * Each turn reads the fan's checkpoints fresh, hands every step that already has one to
4917
+ * {@link callRemote} (which owns the completed / pending-lease / failed-retry rules), and sends
4918
+ * the steps nobody has sent yet: all of them, or with `concurrency`, the next wave once the last
4919
+ * one has drained. New steps are written `pending` BEFORE any is dispatched, so a turn that runs
4920
+ * concurrently with this one finds them already sent instead of sending them again. The join
4921
+ * barrier ({@link stepFanStillRunning}) then wakes the parent once per wave, not once per result.
4922
+ */
4923
+ private callRemoteAll;
4924
+ /** Write the `pending` checkpoints of a step fan's new steps, then dispatch them. */
4925
+ private sendStepFan;
4926
+ /** Remember a step settled here, forgetting entries older than a lease so the map stays small. */
4927
+ private noteSettledHere;
4928
+ /** Record `key` in a "happened here recently" map, pruning entries older than a lease. */
4929
+ private noteRecent;
4846
4930
  /** {@link StateStore.saveCheckpointIfPending}, or a plain save on a store without it. */
4847
4931
  private savePendingCheckpoint;
4848
4932
  /** Enqueue a remote step task to its worker group via the transport pool. Shared by the initial
@@ -4850,11 +4934,26 @@ declare class WorkflowEngine {
4850
4934
  * {@link redispatchPending}. Carries the current trace/context so a re-dispatch is traceable. */
4851
4935
  private dispatchRemoteTask;
4852
4936
  /**
4853
- * Complete a durable remote step from its worker result and resume the run — runs on whichever
4854
- * instance receives the result (the dispatching one may be gone), so the run is crash/scale-safe.
4855
- * A no-op if the checkpoint isn't `pending` (a duplicate or late delivery).
4937
+ * Run `work` after every earlier `work` for the same run on this instance has settled. A result
4938
+ * resumes its run inline, and `execute` lets this instance into a lease it already holds — so two
4939
+ * results of one run handled at once here would run two turns of it concurrently. Results of
4940
+ * different runs still go in parallel, which is what a results consumer with concurrency > 1 is for.
4941
+ */
4942
+ private serializedPerRun;
4943
+ /**
4944
+ * Complete a durable remote step from its worker result — runs on whichever instance receives the
4945
+ * result (the dispatching one may be gone), so the run is crash/scale-safe. Resolves whether the
4946
+ * run should now be resumed: not for a duplicate or late delivery (the checkpoint isn't `pending`),
4947
+ * a run already finished, or a step fan whose barrier is still closed.
4856
4948
  */
4857
4949
  private completeRemoteResult;
4950
+ /**
4951
+ * The join barrier of a step fan: a result for one of its steps resumes the parent only once no
4952
+ * step of the fan is still `pending` (a settled wave), or on a failure (failFast surfaces it, and a
4953
+ * retry needs the parent to schedule it). Without it every result would replay the whole parent,
4954
+ * which makes a fan of N steps cost O(N²) checkpoint reads.
4955
+ */
4956
+ private stepFanStillRunning;
4858
4957
  /**
4859
4958
  * Apply a remote workflow-turn {@link WorkflowDecision} durably — runs on WHATEVER instance receives
4860
4959
  * it over the broker (the dispatching one may be gone, or a point-to-point broker handed it to a
@@ -5523,6 +5622,8 @@ declare class CodecStateStore implements StateStore {
5523
5622
  /** Encodes like {@link saveCheckpoint}. Bound only when the inner store has it, so the engine's
5524
5623
  * plain-save fallback still kicks in through the wrapper. */
5525
5624
  readonly saveCheckpointIfPending?: (checkpoint: StepCheckpoint) => Promise<boolean>;
5625
+ /** Forwarded verbatim — a count reads no payload. Bound only when the inner store has it. */
5626
+ readonly countCheckpoints?: (runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]) => Promise<number>;
5526
5627
  /** Forwarded verbatim — retention selects by status/updatedAt/scope, never by payload. Bound only
5527
5628
  * when the inner store prunes, so the retention poller still sees (and warns about) its absence. */
5528
5629
  readonly pruneTerminalRuns?: (policy: RetentionPolicy, nowMs: number, limit: number) => Promise<number>;
@@ -5567,7 +5668,7 @@ declare class CodecStateStore implements StateStore {
5567
5668
  }) => Promise<T>): Promise<T>;
5568
5669
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
5569
5670
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
5570
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
5671
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
5571
5672
  tryLockRun(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<boolean>;
5572
5673
  releaseRunLock(runId: string): Promise<void>;
5573
5674
  renewRunLock(runId: string, owner: string, leaseUntilMs: number): Promise<boolean>;
@@ -5995,7 +6096,7 @@ declare class InMemoryStateStore implements StateStore {
5995
6096
  saveCheckpointIfPending(checkpoint: StepCheckpoint): Promise<boolean>;
5996
6097
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
5997
6098
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
5998
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
6099
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
5999
6100
  tryLockRun(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<boolean>;
6000
6101
  releaseRunLock(runId: string): Promise<void>;
6001
6102
  renewRunLock(runId: string, owner: string, leaseUntilMs: number): Promise<boolean>;
@@ -6055,6 +6156,7 @@ declare class InMemoryStateStore implements StateStore {
6055
6156
  listSchedules(query: ScheduleQuery): Promise<ScheduleRecord[]>;
6056
6157
  listCheckpoints(runId: string): Promise<StepCheckpoint[]>;
6057
6158
  getLatestCheckpointByName(runId: string, name: string): Promise<StepCheckpoint | undefined>;
6159
+ countCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
6058
6160
  listCheckpointsByNamePrefix(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
6059
6161
  }
6060
6162
 
@@ -6098,4 +6200,4 @@ declare function singletonAdmissionDenialPatch(runs: WorkflowRun[], runId: strin
6098
6200
  updatedAt: Date;
6099
6201
  } | undefined;
6100
6202
 
6101
- export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, type ChildWait, CodecStateStore, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, 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, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, type FanJoin, type FanWait, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, 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 RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, STATE_STORE, STATE_STORE_CANONICAL, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, WORKFLOW_NAME_KEY, 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 WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, assertConcurrency, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, listSignalWaitersOfRuns, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, parentRunIdOf, parseDuration, partitionOfToken, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduledRunId, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };
6203
+ export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllStepsOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, type ChildWait, CodecStateStore, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, 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, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, type FanJoin, type FanWait, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, 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 RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, STATE_STORE, STATE_STORE_CANONICAL, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, WORKFLOW_NAME_KEY, 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 WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, assertConcurrency, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, listSignalWaitersOfRuns, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, parentRunIdOf, parseDuration, partitionOfToken, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduledRunId, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };
package/dist/index.d.ts CHANGED
@@ -983,8 +983,12 @@ interface StateStore {
983
983
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
984
984
  /** The oldest `pending` runs awaiting dispatch (FIFO, by `createdAt`), capped at `limit`. */
985
985
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
986
- /** Suspended runs whose durable timer is due (`wakeAt <= nowMs`), ready to resume. */
987
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
986
+ /**
987
+ * Suspended runs whose durable timer is due (`wakeAt <= nowMs`), ready to resume — the most
988
+ * overdue first, at most `limit` of them when it is given. Every driving instance polls this each
989
+ * tick, so a recovery wave of thousands of due runs must come back in batches, not all at once.
990
+ */
991
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
988
992
  /**
989
993
  * Atomically acquire the recovery lease on a run for `owner` until `leaseUntilMs`, but only if
990
994
  * it is currently unlocked or its lease has expired (`<= nowMs`). Returns whether it was
@@ -1175,6 +1179,15 @@ interface StateStore {
1175
1179
  * plus an in-JS prefix scan that produces the identical result.
1176
1180
  */
1177
1181
  listCheckpointsByNamePrefix?(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
1182
+ /**
1183
+ * How many of the run's checkpoints with `fromSeq <= seq <= toSeq` have one of `statuses`. The join
1184
+ * barrier of a step fan (`ctx.all` over a `@Step`) asks this on every result — "is any step of the
1185
+ * fan still `pending`?" — so it must be a count, not a load of the fan.
1186
+ *
1187
+ * Optional: a store that omits it still works — the engine falls back to {@link listCheckpoints}
1188
+ * and counts in JS, which loads the whole run on every result of a fan.
1189
+ */
1190
+ countCheckpoints?(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
1178
1191
  }
1179
1192
  /**
1180
1193
  * A persisted schedule as the STORE sees it: a handful of queryable columns plus two JSON documents
@@ -1485,6 +1498,21 @@ interface AllOptions {
1485
1498
  */
1486
1499
  concurrency?: number;
1487
1500
  }
1501
+ /**
1502
+ * Options for `ctx.all` over a `@Step` — one durable step per input instead of one child workflow
1503
+ * per input. The per-call step policy (`retries`, `backoff`, …) applies to every step of the fan.
1504
+ * Flow-control `queue`s and a liveness `timeoutMs` are not supported on a fan.
1505
+ */
1506
+ interface AllStepsOptions extends Omit<StepDispatchOpts, 'queue' | 'timeoutMs'> {
1507
+ /** `waitAll` (default) or `failFast` — see {@link WorkflowCtx.all}. */
1508
+ mode?: 'waitAll' | 'failFast';
1509
+ /**
1510
+ * The most steps in flight at once. Unset sends the whole fan immediately. When set, steps go out
1511
+ * in waves of `concurrency`, the next once the previous has settled; each wave costs the parent one
1512
+ * turn. Part of the fan's identity, like `inputs`.
1513
+ */
1514
+ concurrency?: number;
1515
+ }
1488
1516
  /** One child of a fan as {@link StateStore.registerChildWaits} writes it. */
1489
1517
  interface ChildWait {
1490
1518
  waiter: SignalWaiter;
@@ -2360,6 +2388,14 @@ interface WorkflowCtx<A extends SearchAttributes = SearchAttributes> {
2360
2388
  * `concurrency` caps how many children run at once (see {@link AllOptions.concurrency}).
2361
2389
  */
2362
2390
  all<C extends WorkflowClass>(workflow: C, inputs: WorkflowInputOf<C>[], opts?: AllOptions): Promise<WorkflowOutputOf<C>[]>;
2391
+ /**
2392
+ * Run one durable **step** per entry in `inputs` in parallel and wait for all of them — the same
2393
+ * fan as above with a `@Step` instead of a child workflow, so each item costs a step instead of a
2394
+ * whole run. The steps share a `parallelGroup` (the dashboard renders them as one fan), the parent
2395
+ * replays once per settled wave rather than once per result, and outputs come back in input order;
2396
+ * failures surface as a {@link GatherError}, like the child fan.
2397
+ */
2398
+ all<TInput, TOutput>(step: StepRef<TInput, TOutput>, inputs: TInput[], opts?: AllStepsOptions): Promise<TOutput[]>;
2363
2399
  all<TOutput = unknown>(workflow: string, inputs: unknown[], opts?: AllOptions): Promise<TOutput[]>;
2364
2400
  /**
2365
2401
  * Pause the run at this point until a human resumes it from the dashboard (or
@@ -3628,6 +3664,13 @@ interface WorkflowEngineDeps {
3628
3664
  * for a genuinely-orphaned run. Default 5min; set `0` to disable (the prior wake-forever behavior).
3629
3665
  */
3630
3666
  reconcileMs?: number | undefined;
3667
+ /**
3668
+ * The most due timers one {@link WorkflowEngine.resumeDueTimers} pass loads and drives, most
3669
+ * overdue first. Every driving instance runs that pass each tick, so a wave of thousands of due
3670
+ * runs (a recovery after an outage, a fan's children waking together) is worked through in
3671
+ * batches instead of every instance loading and walking all of it. Default 500.
3672
+ */
3673
+ timerBatchSize?: number | undefined;
3631
3674
  /**
3632
3675
  * Retention for a BUFFERED event that no `waitForEvent` ever claims (see
3633
3676
  * {@link WorkflowEngine.publishEvent}'s buffering — a publish matching no live waiter keeps ONE
@@ -3746,6 +3789,7 @@ declare class WorkflowEngine {
3746
3789
  private readonly maxRecoveryAttempts?;
3747
3790
  private readonly remoteAdvanceSilenceMs?;
3748
3791
  private readonly reconcileMs;
3792
+ private readonly timerBatchSize;
3749
3793
  private readonly eventBufferTtlMs;
3750
3794
  private readonly remoteRedispatchMs;
3751
3795
  private readonly remoteRedispatchMax;
@@ -3806,6 +3850,21 @@ declare class WorkflowEngine {
3806
3850
  * {@link redriveSettledSteps}).
3807
3851
  */
3808
3852
  private readonly awaitedRemoteSteps;
3853
+ /**
3854
+ * When THIS instance settled a remote step from its result, by `runId:seq`. That result's resume
3855
+ * runs here, and `execute` lets it into a lease this instance holds, so its wake is never the
3856
+ * dropped one {@link redriveSettledSteps} recovers. Pruned by age (see {@link noteSettledHere}).
3857
+ */
3858
+ private readonly settledHere;
3859
+ /**
3860
+ * The step fans (`ctx.all` over a `@Step`) a turn suspended on, by run, while that turn executes on
3861
+ * THIS instance — re-checked once its lease is released (see {@link redriveSettledStepFans}).
3862
+ */
3863
+ private readonly awaitedStepFans;
3864
+ /** Step fans whose join barrier this instance opened, by `runId:firstSeq` — see {@link settledHere}. */
3865
+ private readonly stepFansFiredHere;
3866
+ /** The tail of each run's queue of results being handled on this instance — see {@link serializedPerRun}. */
3867
+ private readonly resultChains;
3809
3868
  /** Flow-control admission backend for remote steps (see {@link registerQueue}). */
3810
3869
  private readonly admission;
3811
3870
  /** Runs on THIS instance blocked on admission, by queue — woken early on a freed-slot signal. */
@@ -4326,6 +4385,13 @@ declare class WorkflowEngine {
4326
4385
  * checkpoint that is already settled, which the next turn replays past — so it cannot loop.
4327
4386
  */
4328
4387
  private redriveSettledSteps;
4388
+ /**
4389
+ * {@link redriveSettledSteps} for a step fan: once the turn that suspended on it released its lease,
4390
+ * re-drive the run if no step of the fan is still `pending` — the last result landed on another
4391
+ * instance while this one held the lease, and its wake was dropped there. A fan whose barrier this
4392
+ * instance opened is skipped, for the reason {@link settledHere} gives.
4393
+ */
4394
+ private redriveSettledStepFans;
4329
4395
  private redriveSettledChildren;
4330
4396
  /**
4331
4397
  * Deliver an external signal to the run waiting on `token`, resume it with `payload`, and return
@@ -4843,6 +4909,24 @@ declare class WorkflowEngine {
4843
4909
  * capable+compatible worker has appeared, else re-parks with a fresh `wakeAt` (design §7.5). */
4844
4910
  private dueBlockedRuns;
4845
4911
  private callRemote;
4912
+ /**
4913
+ * `ctx.all` over a `@Step`: one durable step per input, dispatched together, joined once. The ctx
4914
+ * reserves the whole position block up front, so replay re-derives the same seqs.
4915
+ *
4916
+ * Each turn reads the fan's checkpoints fresh, hands every step that already has one to
4917
+ * {@link callRemote} (which owns the completed / pending-lease / failed-retry rules), and sends
4918
+ * the steps nobody has sent yet: all of them, or with `concurrency`, the next wave once the last
4919
+ * one has drained. New steps are written `pending` BEFORE any is dispatched, so a turn that runs
4920
+ * concurrently with this one finds them already sent instead of sending them again. The join
4921
+ * barrier ({@link stepFanStillRunning}) then wakes the parent once per wave, not once per result.
4922
+ */
4923
+ private callRemoteAll;
4924
+ /** Write the `pending` checkpoints of a step fan's new steps, then dispatch them. */
4925
+ private sendStepFan;
4926
+ /** Remember a step settled here, forgetting entries older than a lease so the map stays small. */
4927
+ private noteSettledHere;
4928
+ /** Record `key` in a "happened here recently" map, pruning entries older than a lease. */
4929
+ private noteRecent;
4846
4930
  /** {@link StateStore.saveCheckpointIfPending}, or a plain save on a store without it. */
4847
4931
  private savePendingCheckpoint;
4848
4932
  /** Enqueue a remote step task to its worker group via the transport pool. Shared by the initial
@@ -4850,11 +4934,26 @@ declare class WorkflowEngine {
4850
4934
  * {@link redispatchPending}. Carries the current trace/context so a re-dispatch is traceable. */
4851
4935
  private dispatchRemoteTask;
4852
4936
  /**
4853
- * Complete a durable remote step from its worker result and resume the run — runs on whichever
4854
- * instance receives the result (the dispatching one may be gone), so the run is crash/scale-safe.
4855
- * A no-op if the checkpoint isn't `pending` (a duplicate or late delivery).
4937
+ * Run `work` after every earlier `work` for the same run on this instance has settled. A result
4938
+ * resumes its run inline, and `execute` lets this instance into a lease it already holds — so two
4939
+ * results of one run handled at once here would run two turns of it concurrently. Results of
4940
+ * different runs still go in parallel, which is what a results consumer with concurrency > 1 is for.
4941
+ */
4942
+ private serializedPerRun;
4943
+ /**
4944
+ * Complete a durable remote step from its worker result — runs on whichever instance receives the
4945
+ * result (the dispatching one may be gone), so the run is crash/scale-safe. Resolves whether the
4946
+ * run should now be resumed: not for a duplicate or late delivery (the checkpoint isn't `pending`),
4947
+ * a run already finished, or a step fan whose barrier is still closed.
4856
4948
  */
4857
4949
  private completeRemoteResult;
4950
+ /**
4951
+ * The join barrier of a step fan: a result for one of its steps resumes the parent only once no
4952
+ * step of the fan is still `pending` (a settled wave), or on a failure (failFast surfaces it, and a
4953
+ * retry needs the parent to schedule it). Without it every result would replay the whole parent,
4954
+ * which makes a fan of N steps cost O(N²) checkpoint reads.
4955
+ */
4956
+ private stepFanStillRunning;
4858
4957
  /**
4859
4958
  * Apply a remote workflow-turn {@link WorkflowDecision} durably — runs on WHATEVER instance receives
4860
4959
  * it over the broker (the dispatching one may be gone, or a point-to-point broker handed it to a
@@ -5523,6 +5622,8 @@ declare class CodecStateStore implements StateStore {
5523
5622
  /** Encodes like {@link saveCheckpoint}. Bound only when the inner store has it, so the engine's
5524
5623
  * plain-save fallback still kicks in through the wrapper. */
5525
5624
  readonly saveCheckpointIfPending?: (checkpoint: StepCheckpoint) => Promise<boolean>;
5625
+ /** Forwarded verbatim — a count reads no payload. Bound only when the inner store has it. */
5626
+ readonly countCheckpoints?: (runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]) => Promise<number>;
5526
5627
  /** Forwarded verbatim — retention selects by status/updatedAt/scope, never by payload. Bound only
5527
5628
  * when the inner store prunes, so the retention poller still sees (and warns about) its absence. */
5528
5629
  readonly pruneTerminalRuns?: (policy: RetentionPolicy, nowMs: number, limit: number) => Promise<number>;
@@ -5567,7 +5668,7 @@ declare class CodecStateStore implements StateStore {
5567
5668
  }) => Promise<T>): Promise<T>;
5568
5669
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
5569
5670
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
5570
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
5671
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
5571
5672
  tryLockRun(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<boolean>;
5572
5673
  releaseRunLock(runId: string): Promise<void>;
5573
5674
  renewRunLock(runId: string, owner: string, leaseUntilMs: number): Promise<boolean>;
@@ -5995,7 +6096,7 @@ declare class InMemoryStateStore implements StateStore {
5995
6096
  saveCheckpointIfPending(checkpoint: StepCheckpoint): Promise<boolean>;
5996
6097
  listIncompleteRuns(namespace?: string): Promise<WorkflowRun[]>;
5997
6098
  listPendingRuns(limit: number, namespace?: string): Promise<WorkflowRun[]>;
5998
- listDueTimers(nowMs: number, namespace?: string): Promise<WorkflowRun[]>;
6099
+ listDueTimers(nowMs: number, namespace?: string, limit?: number): Promise<WorkflowRun[]>;
5999
6100
  tryLockRun(runId: string, owner: string, leaseUntilMs: number, nowMs: number): Promise<boolean>;
6000
6101
  releaseRunLock(runId: string): Promise<void>;
6001
6102
  renewRunLock(runId: string, owner: string, leaseUntilMs: number): Promise<boolean>;
@@ -6055,6 +6156,7 @@ declare class InMemoryStateStore implements StateStore {
6055
6156
  listSchedules(query: ScheduleQuery): Promise<ScheduleRecord[]>;
6056
6157
  listCheckpoints(runId: string): Promise<StepCheckpoint[]>;
6057
6158
  getLatestCheckpointByName(runId: string, name: string): Promise<StepCheckpoint | undefined>;
6159
+ countCheckpoints(runId: string, fromSeq: number, toSeq: number, statuses: StepCheckpoint['status'][]): Promise<number>;
6058
6160
  listCheckpointsByNamePrefix(runId: string, prefixes: string[]): Promise<StepCheckpoint[]>;
6059
6161
  }
6060
6162
 
@@ -6098,4 +6200,4 @@ declare function singletonAdmissionDenialPatch(runs: WorkflowRun[], runId: strin
6098
6200
  updatedAt: Date;
6099
6201
  } | undefined;
6100
6202
 
6101
- export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, type ChildWait, CodecStateStore, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, 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, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, type FanJoin, type FanWait, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, 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 RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, STATE_STORE, STATE_STORE_CANONICAL, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, WORKFLOW_NAME_KEY, 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 WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, assertConcurrency, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, listSignalWaitersOfRuns, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, parentRunIdOf, parseDuration, partitionOfToken, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduledRunId, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };
6203
+ export { type AccumulatorHost, type Admission, type AdmissionBackend, type AdmissionItem, type AllOptions, type AllStepsOptions, type AnnouncedWorkflow, type AnnouncementEvidence, type AttributeFilter, type AttributeOp, type AttributePredicateOperand, type AttributeValue, type BackoffStrategy, type BlockedDispatch, type BlockedResolution, CONTROL_FLOW_SIGNAL, CURRENT_PROTOCOL_VERSION, type CapabilityRequirement, type ChildCallOptions, type ChildWait, CodecStateStore, type ConcurrencyConfig, ConcurrencyLimitError, type ConcurrencyQuota, ContinueAsNew, type ControlMessage, type ControlPlane, DEFAULT_CONCURRENCY_STATUSES, DEFAULT_PARTITION, 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, EVENT_BUFFER_SCAN_LIMIT, EVENT_TOKEN_PREFIX, type EngineEvent, type EngineEventType, type EngineListener, Entities, type EntityConfig, type EntityHandler, type EntityHost, EventAccumulators, type EventBatchConfig, type FanJoin, type FanWait, FatalError, GatherError, type GroupHealth, type Heartbeat, type HeartbeatSighting, type HeartbeatStatus, type HistoryEvent, InMemoryAdmissionBackend, InMemoryStateStore, InMemoryTransport, type InferSearchAttributes, LEGACY_V1_CAPABILITIES, LEGACY_V1_PROTOCOL, type MetricsCollector, type MetricsSnapshot, type NamedTransport, type NegotiateOptions, type NegotiationOutcome, type NegotiationReason, type NegotiationResult, NestedWorkflowCallError, NonDeterminismError, type PartitionSighting, type PayloadCodec, type QueueConfig, QueueController, RUN_VALUE_FACET_LIMIT, RUN_VALUE_FACET_SCAN, type RawWorkerDescriptor, RemoteStepError, RemoteStepTimeout, type RemoteTask, RemoteWorkflowExecutor, RemoteWorkflowTimeout, type RetentionPolicy, type RoutableDispatch, type RoutableResolution, type RoutingResolution, type RunAttributeRow, type RunDetail, type RunDispatcher, type RunFacetQuery, type RunFacetRow, RunGateway, type RunListItem, type RunQuery, 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 RunWaiting, SINGLETON_ACTIVE_STATUSES, SINGLETON_ADMITTED_TAG, STATE_STORE, STATE_STORE_CANONICAL, type ScalarAttributeFilter, ScheduleAlreadyExistsError, ScheduleClient, type ScheduleClientOptions, type ScheduleDescription, type ScheduleHost, type ScheduleListQuery, ScheduleNotFoundError, type ScheduleOptions, type ScheduleQuery, type ScheduleRecord, type ScheduledWorkflow, type SearchAttributes, type SearchAttributesSchema, SignalTimeoutError, type SignalWaiter, type SingletonConfig, SingletonQueueFullError, 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 StepScope, type StepUndo, type StoreTransaction, type SubProcessHandle, TERMINAL_RUN_STATUSES, TRANSPORT, TRANSPORT_CANONICAL, type TenantEvent, type Transport, type UndoOf, type UpdateResult, type UpdateValidator, VERSION_UNDECLARED_TAG, WORKFLOW_NAME_KEY, 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 WorkflowOutputOf, type WorkflowRef, type WorkflowRegistration, type WorkflowRun, type WorkflowStartClient, type WorkflowStepEvent, WorkflowSuspended, type WorkflowTask, aggregateAnnouncements, announcementsOf, applyAttributeQuery, assertConcurrency, attributeColumnFor, attributeOperand, attributePredicateOperands, axisIsRunColumn, bindWorkflowClass, breakpointToken, buildWorkflowDirectory, canRoute, capableWorkers, classifyWaiterToken, clearDurableExecutionWrappers, clearTerminalSingletonAdmission, collectMetrics, concurrencyTag, controlPlaneDescriptor, countRuns, coveredTokens, createStepLogger, currentStep, currentStepScope, currentWorkflowCtx, debug, describeWorker, descriptorHash, error, eventMatchOf, eventMatches, eventNameOf, eventPrefix, eventToken, facetOrigin, hasDurableExecutionWrappers, heartbeatStatus, indexWaitersByRun, info, isEngineMintedTag, isEventToken, isLegacyDescriptor, isNonEmptyRunScope, isWorkflowControlFlowSignal, listSignalWaitersOfRuns, log, matchesAttributes, mergeRunFacetRows, mergeRunValueFacetRows, missingCapabilities, negotiate, nextCronFireMs, normalizeAttributeRows, normalizeDescriptor, observedAnnouncements, parentRunIdOf, parseDuration, partitionOfToken, planDispatch, prevCronFireMs, readSearchAttributes, requiredCapabilities, resolveConcurrency, resolveRouting, resolveRunWaiting, runDurableExecution, runInStepLogger, runInStepScope, runInWorkflowCtx, runOutsideWorkflowCtx, runSchedules, runStepHandler, runValueFacetsFromRuns, sanitizeQueueToken, scheduledRunId, singletonAdmissionDenialPatch, singletonAdmissionTags, sqlComparator, stepConfigOf, stepId, stepNameOf, sub, subEvent, subProcess, tenantGroup, useDurableExecution, warn, workflowName };