@rivetkit/workflow-engine 2.3.0-rc.8 → 2.3.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.
@@ -1963,7 +1963,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
1963
1963
  * Throws HistoryDivergedError if duplicate detected.
1964
1964
  */
1965
1965
  checkDuplicateName(name) {
1966
- const fullKey = locationToKey(this.storage, this.currentLocation) + "/" + name;
1966
+ const fullKey = `${locationToKey(this.storage, this.currentLocation)}/${name}`;
1967
1967
  if (this.usedNamesInExecution.has(fullKey)) {
1968
1968
  throw new HistoryDivergedError(
1969
1969
  `Duplicate entry name "${name}" at location "${locationToKey(this.storage, this.currentLocation)}". Each step/loop/sleep/queue.next/join/race must have a unique name within its scope.`
@@ -2017,7 +2017,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
2017
2017
  validateComplete() {
2018
2018
  const prefix = locationToKey(this.storage, this.currentLocation);
2019
2019
  for (const key of this.storage.history.entries.keys()) {
2020
- const isUnderPrefix = prefix === "" ? true : key.startsWith(prefix + "/") || key === prefix;
2020
+ const isUnderPrefix = prefix === "" ? true : key.startsWith(`${prefix}/`) || key === prefix;
2021
2021
  if (isUnderPrefix) {
2022
2022
  if (!this.visitedKeys.has(key)) {
2023
2023
  throw new HistoryDivergedError(
@@ -2294,7 +2294,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
2294
2294
  entry.kind.data.error = String(error);
2295
2295
  }
2296
2296
  entry.dirty = true;
2297
- if (error instanceof StepTimeoutError) {
2297
+ if (error instanceof StepTimeoutError && !config2.retryOnTimeout) {
2298
2298
  metadata.status = "exhausted";
2299
2299
  metadata.error = String(error);
2300
2300
  await this.notifyStepError(config2, metadata.attempts, error, {
@@ -2350,7 +2350,7 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
2350
2350
  attachTryStepFailure(
2351
2351
  new StepExhaustedError(config2.name, String(error)),
2352
2352
  {
2353
- kind: "exhausted",
2353
+ kind: error instanceof StepTimeoutError ? "timeout" : "exhausted",
2354
2354
  stepName: config2.name,
2355
2355
  attempts: metadata.attempts,
2356
2356
  error: extractErrorInfo(error)
@@ -2368,7 +2368,9 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
2368
2368
  *
2369
2369
  * Note: This does NOT cancel the underlying operation. JavaScript Promises
2370
2370
  * cannot be cancelled once started. When a timeout occurs:
2371
- * - The step is marked as failed with StepTimeoutError
2371
+ * - The step is rejected with StepTimeoutError. By default this is treated
2372
+ * as a critical failure with no retry. Set retryOnTimeout: true on the
2373
+ * step config to retry timeouts like any other error.
2372
2374
  * - The underlying async operation continues running in the background
2373
2375
  * - Any side effects from the operation may still occur
2374
2376
  *
@@ -4199,4 +4201,4 @@ export {
4199
4201
  runWorkflow,
4200
4202
  replayWorkflowFromStep
4201
4203
  };
4202
- //# sourceMappingURL=chunk-EAAPMGGE.js.map
4204
+ //# sourceMappingURL=chunk-DFNXCZ47.js.map