@dudousxd/nestjs-durable-core 0.40.1 → 0.41.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
@@ -683,13 +683,17 @@ interface HistoryEvent {
683
683
  }
684
684
  /** A decision the workflow function produced at a `seq` that was not yet in history. */
685
685
  type WorkflowCommand =
686
- /** `ctx.call(remoteStep, input)` — dispatch a remote step and await it. */
686
+ /** `ctx.call(remoteStep, input)` — dispatch a remote step and await it. A worker's
687
+ * `ctx.gather_calls([...])` fan-out tags every dispatched call with the same `parallelGroup` so the
688
+ * dashboard renders the remote steps as one parallel fan (parity with the gathered `recordStep` /
689
+ * `startChild` tags). Undefined for a lone sequential `ctx.call`. */
687
690
  {
688
691
  kind: 'call';
689
692
  seq: number;
690
693
  name: string;
691
694
  group: string;
692
695
  input: unknown;
696
+ parallelGroup?: string;
693
697
  }
694
698
  /** `ctx.step(name, body)` — a LOCAL step the worker already ran this turn; the engine persists its
695
699
  * result so replay returns it instead of re-running (durability for side-effectful work).
package/dist/index.d.ts CHANGED
@@ -683,13 +683,17 @@ interface HistoryEvent {
683
683
  }
684
684
  /** A decision the workflow function produced at a `seq` that was not yet in history. */
685
685
  type WorkflowCommand =
686
- /** `ctx.call(remoteStep, input)` — dispatch a remote step and await it. */
686
+ /** `ctx.call(remoteStep, input)` — dispatch a remote step and await it. A worker's
687
+ * `ctx.gather_calls([...])` fan-out tags every dispatched call with the same `parallelGroup` so the
688
+ * dashboard renders the remote steps as one parallel fan (parity with the gathered `recordStep` /
689
+ * `startChild` tags). Undefined for a lone sequential `ctx.call`. */
687
690
  {
688
691
  kind: 'call';
689
692
  seq: number;
690
693
  name: string;
691
694
  group: string;
692
695
  input: unknown;
696
+ parallelGroup?: string;
693
697
  }
694
698
  /** `ctx.step(name, body)` — a LOCAL step the worker already ran this turn; the engine persists its
695
699
  * result so replay returns it instead of re-running (durability for side-effectful work).
package/dist/index.js CHANGED
@@ -2990,6 +2990,7 @@ var WorkflowEngine = class {
2990
2990
  error: cmd.error
2991
2991
  });
2992
2992
  } else if (cmd.kind === "call") {
2993
+ if (await this.store.getCheckpoint(run.id, cmd.seq)) continue;
2993
2994
  await this.store.saveCheckpoint(stepCheckpoint({
2994
2995
  runId: run.id,
2995
2996
  seq: cmd.seq,
@@ -3001,7 +3002,11 @@ var WorkflowEngine = class {
3001
3002
  workerGroup: cmd.group,
3002
3003
  enqueuedAt: at,
3003
3004
  startedAt: at,
3004
- finishedAt: at
3005
+ finishedAt: at,
3006
+ // A `ctx.gather_calls([...])` fan-out stamps every dispatched `call` in the fan with the
3007
+ // same group, so the dashboard renders the remote steps as one parallel fan (parity with
3008
+ // the gathered `recordStep`/`startChild` tags). Undefined for a lone sequential `ctx.call`.
3009
+ parallelGroup: cmd.parallelGroup
3005
3010
  }));
3006
3011
  await this.pool.dispatch({
3007
3012
  runId: run.id,