@upstash/workflow 0.2.14 → 0.2.16

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/h3.js CHANGED
@@ -403,7 +403,7 @@ var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
403
403
  var DEFAULT_CONTENT_TYPE = "application/json";
404
404
  var NO_CONCURRENCY = 1;
405
405
  var DEFAULT_RETRIES = 3;
406
- var VERSION = "v0.2.14";
406
+ var VERSION = "v0.2.15";
407
407
  var SDK_TELEMETRY = `@upstash/workflow@${VERSION}`;
408
408
  var TELEMETRY_HEADER_SDK = "Upstash-Telemetry-Sdk";
409
409
  var TELEMETRY_HEADER_FRAMEWORK = "Upstash-Telemetry-Framework";
@@ -441,6 +441,16 @@ var WorkflowAbort = class extends Error {
441
441
  this.cancelWorkflow = cancelWorkflow;
442
442
  }
443
443
  };
444
+ var WorkflowNonRetryableError = class extends WorkflowAbort {
445
+ /**
446
+ * @param message error message to be displayed
447
+ */
448
+ constructor(message) {
449
+ super("fail", void 0, false);
450
+ this.name = "WorkflowNonRetryableError";
451
+ if (message) this.message = message;
452
+ }
453
+ };
444
454
  var formatWorkflowError = (error) => {
445
455
  return error instanceof Error ? {
446
456
  error: error.name,
@@ -1005,6 +1015,8 @@ var triggerRouteFunction = async ({
1005
1015
  return ok("workflow-was-finished");
1006
1016
  } else if (!(error_ instanceof WorkflowAbort)) {
1007
1017
  return err(error_);
1018
+ } else if (error_ instanceof WorkflowNonRetryableError) {
1019
+ return ok(error_);
1008
1020
  } else if (error_.cancelWorkflow) {
1009
1021
  await onCancel();
1010
1022
  return ok("workflow-finished");
@@ -1166,7 +1178,7 @@ ${atob(callbackMessage.body ?? "")}`
1166
1178
  var getTelemetryHeaders = (telemetry2) => {
1167
1179
  return {
1168
1180
  [TELEMETRY_HEADER_SDK]: telemetry2.sdk,
1169
- [TELEMETRY_HEADER_FRAMEWORK]: telemetry2.framework,
1181
+ [TELEMETRY_HEADER_FRAMEWORK]: telemetry2.framework ?? "unknown",
1170
1182
  [TELEMETRY_HEADER_RUNTIME]: telemetry2.runtime ?? "unknown"
1171
1183
  };
1172
1184
  };
@@ -3278,10 +3290,10 @@ var DisabledWorkflowContext = class _DisabledWorkflowContext extends WorkflowCon
3278
3290
  throw new WorkflowAbort(_DisabledWorkflowContext.disabledMessage);
3279
3291
  }
3280
3292
  /**
3281
- * overwrite cancel method to do nothing
3293
+ * overwrite cancel method to throw WorkflowAbort with the disabledMessage
3282
3294
  */
3283
3295
  async cancel() {
3284
- return;
3296
+ throw new WorkflowAbort(_DisabledWorkflowContext.disabledMessage);
3285
3297
  }
3286
3298
  /**
3287
3299
  * copies the passed context to create a DisabledWorkflowContext. Then, runs the
@@ -3313,7 +3325,7 @@ var DisabledWorkflowContext = class _DisabledWorkflowContext extends WorkflowCon
3313
3325
  try {
3314
3326
  await routeFunction(disabledContext);
3315
3327
  } catch (error) {
3316
- if (error instanceof WorkflowAbort && error.stepName === this.disabledMessage) {
3328
+ if (error instanceof WorkflowAbort && error.stepName === this.disabledMessage || error instanceof WorkflowNonRetryableError) {
3317
3329
  return ok("step-found");
3318
3330
  }
3319
3331
  return err(error);
@@ -3471,7 +3483,17 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
3471
3483
  try {
3472
3484
  const { status, header, body, url, sourceBody, workflowRunId } = JSON.parse(requestPayload);
3473
3485
  const decodedBody = body ? decodeBase64(body) : "{}";
3474
- const errorPayload = JSON.parse(decodedBody);
3486
+ let errorMessage = "";
3487
+ try {
3488
+ const errorPayload = JSON.parse(decodedBody);
3489
+ if (errorPayload.message) {
3490
+ errorMessage = errorPayload.message;
3491
+ }
3492
+ } catch {
3493
+ }
3494
+ if (!errorMessage) {
3495
+ errorMessage = `Couldn't parse 'failResponse' in 'failureFunction', received: '${decodedBody}'`;
3496
+ }
3475
3497
  const workflowContext = new WorkflowContext({
3476
3498
  qstashClient,
3477
3499
  workflowRunId,
@@ -3500,7 +3522,7 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
3500
3522
  await failureFunction({
3501
3523
  context: workflowContext,
3502
3524
  failStatus: status,
3503
- failResponse: errorPayload.message,
3525
+ failResponse: errorMessage,
3504
3526
  failHeaders: header
3505
3527
  });
3506
3528
  } catch (error) {
@@ -3534,6 +3556,13 @@ var processOptions = (options) => {
3534
3556
  status: 400
3535
3557
  }
3536
3558
  );
3559
+ } else if (finishCondition instanceof WorkflowNonRetryableError) {
3560
+ return new Response(JSON.stringify(formatWorkflowError(finishCondition)), {
3561
+ headers: {
3562
+ "Upstash-NonRetryable-Error": "true"
3563
+ },
3564
+ status: 489
3565
+ });
3537
3566
  }
3538
3567
  return new Response(JSON.stringify({ workflowRunId }), {
3539
3568
  status: 200
@@ -3726,6 +3755,9 @@ var serveBase = (routeFunction, telemetry2, options) => {
3726
3755
  },
3727
3756
  debug
3728
3757
  });
3758
+ if (result.isOk() && result.value instanceof WorkflowNonRetryableError) {
3759
+ return onStepFinish(workflowRunId, result.value);
3760
+ }
3729
3761
  if (result.isErr()) {
3730
3762
  await debug?.log("ERROR", "ERROR", { error: result.error.message });
3731
3763
  throw result.error;
package/h3.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase,
4
4
  serveManyBase
5
- } from "./chunk-RMS2NQ3K.mjs";
5
+ } from "./chunk-TGEGSOSN.mjs";
6
6
 
7
7
  // node_modules/defu/dist/defu.mjs
8
8
  function isPlainObject(value) {
package/hono.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-C1WIgVLA.mjs';
2
+ import { R as RouteFunction, n as PublicServeOptions, w as InvokableWorkflow } from './types-Dd-3bPoU.mjs';
3
3
  import { Variables } from 'hono/types';
4
- import { s as serveManyBase } from './serve-many-BF71QZHQ.mjs';
4
+ import { s as serveManyBase } from './serve-many-AFwJPR3S.mjs';
5
5
  import '@upstash/qstash';
6
6
  import 'zod';
7
7
  import 'ai';
package/hono.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-C1WIgVLA.js';
2
+ import { R as RouteFunction, n as PublicServeOptions, w as InvokableWorkflow } from './types-Dd-3bPoU.js';
3
3
  import { Variables } from 'hono/types';
4
- import { s as serveManyBase } from './serve-many-BMlN2PAB.js';
4
+ import { s as serveManyBase } from './serve-many-AaKSQyi7.js';
5
5
  import '@upstash/qstash';
6
6
  import 'zod';
7
7
  import 'ai';
package/hono.js CHANGED
@@ -91,7 +91,7 @@ var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
91
91
  var DEFAULT_CONTENT_TYPE = "application/json";
92
92
  var NO_CONCURRENCY = 1;
93
93
  var DEFAULT_RETRIES = 3;
94
- var VERSION = "v0.2.14";
94
+ var VERSION = "v0.2.15";
95
95
  var SDK_TELEMETRY = `@upstash/workflow@${VERSION}`;
96
96
  var TELEMETRY_HEADER_SDK = "Upstash-Telemetry-Sdk";
97
97
  var TELEMETRY_HEADER_FRAMEWORK = "Upstash-Telemetry-Framework";
@@ -129,6 +129,16 @@ var WorkflowAbort = class extends Error {
129
129
  this.cancelWorkflow = cancelWorkflow;
130
130
  }
131
131
  };
132
+ var WorkflowNonRetryableError = class extends WorkflowAbort {
133
+ /**
134
+ * @param message error message to be displayed
135
+ */
136
+ constructor(message) {
137
+ super("fail", void 0, false);
138
+ this.name = "WorkflowNonRetryableError";
139
+ if (message) this.message = message;
140
+ }
141
+ };
132
142
  var formatWorkflowError = (error) => {
133
143
  return error instanceof Error ? {
134
144
  error: error.name,
@@ -693,6 +703,8 @@ var triggerRouteFunction = async ({
693
703
  return ok("workflow-was-finished");
694
704
  } else if (!(error_ instanceof WorkflowAbort)) {
695
705
  return err(error_);
706
+ } else if (error_ instanceof WorkflowNonRetryableError) {
707
+ return ok(error_);
696
708
  } else if (error_.cancelWorkflow) {
697
709
  await onCancel();
698
710
  return ok("workflow-finished");
@@ -854,7 +866,7 @@ ${atob(callbackMessage.body ?? "")}`
854
866
  var getTelemetryHeaders = (telemetry2) => {
855
867
  return {
856
868
  [TELEMETRY_HEADER_SDK]: telemetry2.sdk,
857
- [TELEMETRY_HEADER_FRAMEWORK]: telemetry2.framework,
869
+ [TELEMETRY_HEADER_FRAMEWORK]: telemetry2.framework ?? "unknown",
858
870
  [TELEMETRY_HEADER_RUNTIME]: telemetry2.runtime ?? "unknown"
859
871
  };
860
872
  };
@@ -2966,10 +2978,10 @@ var DisabledWorkflowContext = class _DisabledWorkflowContext extends WorkflowCon
2966
2978
  throw new WorkflowAbort(_DisabledWorkflowContext.disabledMessage);
2967
2979
  }
2968
2980
  /**
2969
- * overwrite cancel method to do nothing
2981
+ * overwrite cancel method to throw WorkflowAbort with the disabledMessage
2970
2982
  */
2971
2983
  async cancel() {
2972
- return;
2984
+ throw new WorkflowAbort(_DisabledWorkflowContext.disabledMessage);
2973
2985
  }
2974
2986
  /**
2975
2987
  * copies the passed context to create a DisabledWorkflowContext. Then, runs the
@@ -3001,7 +3013,7 @@ var DisabledWorkflowContext = class _DisabledWorkflowContext extends WorkflowCon
3001
3013
  try {
3002
3014
  await routeFunction(disabledContext);
3003
3015
  } catch (error) {
3004
- if (error instanceof WorkflowAbort && error.stepName === this.disabledMessage) {
3016
+ if (error instanceof WorkflowAbort && error.stepName === this.disabledMessage || error instanceof WorkflowNonRetryableError) {
3005
3017
  return ok("step-found");
3006
3018
  }
3007
3019
  return err(error);
@@ -3159,7 +3171,17 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
3159
3171
  try {
3160
3172
  const { status, header, body, url, sourceBody, workflowRunId } = JSON.parse(requestPayload);
3161
3173
  const decodedBody = body ? decodeBase64(body) : "{}";
3162
- const errorPayload = JSON.parse(decodedBody);
3174
+ let errorMessage = "";
3175
+ try {
3176
+ const errorPayload = JSON.parse(decodedBody);
3177
+ if (errorPayload.message) {
3178
+ errorMessage = errorPayload.message;
3179
+ }
3180
+ } catch {
3181
+ }
3182
+ if (!errorMessage) {
3183
+ errorMessage = `Couldn't parse 'failResponse' in 'failureFunction', received: '${decodedBody}'`;
3184
+ }
3163
3185
  const workflowContext = new WorkflowContext({
3164
3186
  qstashClient,
3165
3187
  workflowRunId,
@@ -3188,7 +3210,7 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
3188
3210
  await failureFunction({
3189
3211
  context: workflowContext,
3190
3212
  failStatus: status,
3191
- failResponse: errorPayload.message,
3213
+ failResponse: errorMessage,
3192
3214
  failHeaders: header
3193
3215
  });
3194
3216
  } catch (error) {
@@ -3222,6 +3244,13 @@ var processOptions = (options) => {
3222
3244
  status: 400
3223
3245
  }
3224
3246
  );
3247
+ } else if (finishCondition instanceof WorkflowNonRetryableError) {
3248
+ return new Response(JSON.stringify(formatWorkflowError(finishCondition)), {
3249
+ headers: {
3250
+ "Upstash-NonRetryable-Error": "true"
3251
+ },
3252
+ status: 489
3253
+ });
3225
3254
  }
3226
3255
  return new Response(JSON.stringify({ workflowRunId }), {
3227
3256
  status: 200
@@ -3414,6 +3443,9 @@ var serveBase = (routeFunction, telemetry2, options) => {
3414
3443
  },
3415
3444
  debug
3416
3445
  });
3446
+ if (result.isOk() && result.value instanceof WorkflowNonRetryableError) {
3447
+ return onStepFinish(workflowRunId, result.value);
3448
+ }
3417
3449
  if (result.isErr()) {
3418
3450
  await debug?.log("ERROR", "ERROR", { error: result.error.message });
3419
3451
  throw result.error;
package/hono.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase,
4
4
  serveManyBase
5
- } from "./chunk-RMS2NQ3K.mjs";
5
+ } from "./chunk-TGEGSOSN.mjs";
6
6
 
7
7
  // platforms/hono.ts
8
8
  var telemetry = {
package/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-C1WIgVLA.mjs';
2
- export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-C1WIgVLA.mjs';
3
- import { FlowControl, PublishRequest, HTTPMethods, State, Client as Client$1, QstashError } from '@upstash/qstash';
1
+ import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter } from './types-Dd-3bPoU.mjs';
2
+ export { A as AsyncStepFunction, C as CallResponse, u as CallSettings, D as Duration, o as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, w as InvokableWorkflow, v as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, x as LogLevel, s as NotifyStepResponse, P as ParallelCallState, n as PublicServeOptions, p as RequiredExceptFields, k as Step, m as StepFunction, j as StepTypes, l as SyncStepFunction, t as WaitEventOptions, q as WaitRequest, r as WaitStepResponse, d as WorkflowAbort, h as WorkflowClient, g as WorkflowContext, c as WorkflowError, z as WorkflowLogger, y as WorkflowLoggerOptions, e as WorkflowNonRetryableError, i as WorkflowReceiver, f as WorkflowTool } from './types-Dd-3bPoU.mjs';
3
+ import { FlowControl, PublishRequest, HTTPMethods, State, Client as Client$1 } from '@upstash/qstash';
4
4
  import 'zod';
5
5
  import 'ai';
6
6
  import '@ai-sdk/openai';
@@ -60,6 +60,10 @@ type BaseStepLog = {
60
60
  * will be undefined for an unfinished parallel step.
61
61
  */
62
62
  out: unknown;
63
+ /**
64
+ * number of retries for the step
65
+ */
66
+ retries: number;
63
67
  /**
64
68
  * number of parallel steps
65
69
  *
@@ -78,10 +82,6 @@ type BaseStepLog = {
78
82
  * headers
79
83
  */
80
84
  headers: Record<string, string[]>;
81
- /**
82
- * retries
83
- */
84
- retries: number;
85
85
  };
86
86
  type CallUrlGroup = {
87
87
  /**
@@ -368,6 +368,156 @@ type TriggerOptions = {
368
368
  */
369
369
  useFailureFunction?: never;
370
370
  });
371
+ type DLQResumeRestartOptions<TDLQId extends string | string[] = string | string[]> = {
372
+ dlqId: TDLQId;
373
+ } & Pick<TriggerOptions, "flowControl" | "retries">;
374
+ type DLQResumeRestartResponse = {
375
+ /**
376
+ * id of the workflow run created to resume or restart the DLQ message
377
+ */
378
+ workflowRunId: string;
379
+ /**
380
+ * Time when the new workflow run was created
381
+ */
382
+ workflowCreatedAt: string;
383
+ };
384
+
385
+ type QStashDLQFilterOptions = NonNullable<Required<Parameters<Client$1["dlq"]["listMessages"]>[0]>>["filter"];
386
+ type DLQFilterOptions = Pick<QStashDLQFilterOptions, "fromDate" | "toDate" | "url" | "responseStatus">;
387
+ type DLQMessage = {
388
+ messageId: string;
389
+ url: string;
390
+ method: string;
391
+ header: Record<string, string[]>;
392
+ body: string;
393
+ maxRetries: number;
394
+ notBefore: number;
395
+ createdAt: number;
396
+ callerIP: string;
397
+ workflowRunId: string;
398
+ workflowCreatedAt: number;
399
+ workflowUrl: string;
400
+ responseStatus: number;
401
+ responseHeader: Record<string, string[]>;
402
+ responseBody: string;
403
+ dlqId: string;
404
+ };
405
+ type PublicDLQMessage = Pick<DLQMessage, "header" | "body" | "maxRetries" | "notBefore" | "createdAt" | "callerIP" | "workflowRunId" | "workflowCreatedAt" | "workflowUrl" | "responseStatus" | "responseHeader" | "responseBody" | "dlqId">;
406
+ declare class DLQ {
407
+ private client;
408
+ constructor(client: Client$1);
409
+ /**
410
+ * list the items in the DLQ
411
+ *
412
+ * @param cursor - Optional cursor for pagination.
413
+ * @param count - Optional number of items to return.
414
+ * @param filter - Optional filter options to apply to the DLQ items.
415
+ * The available filter options are:
416
+ * - `fromDate`: Filter items which entered the DLQ after this date.
417
+ * - `toDate`: Filter items which entered the DLQ before this date.
418
+ * - `url`: Filter items by the URL they were sent to.
419
+ * - `responseStatus`: Filter items by the response status code.
420
+ * @returns
421
+ */
422
+ list(parameters?: {
423
+ cursor?: string;
424
+ count?: number;
425
+ filter?: DLQFilterOptions;
426
+ }): Promise<{
427
+ messages: PublicDLQMessage[];
428
+ cursor?: string;
429
+ }>;
430
+ /**
431
+ * Resumes the workflow run for the given DLQ message(s).
432
+ *
433
+ * Resuming means that the new workflow run will start executing from where
434
+ * the original workflow run failed, using the same input and context.
435
+ *
436
+ * If you want to restart the workflow run from the beginning, use
437
+ * `restart` method instead.
438
+ *
439
+ * Example with a single DLQ ID:
440
+ * ```ts
441
+ * const response = await client.dlq.resume({
442
+ * dlqId: "dlq-12345",
443
+ * flowControl: {
444
+ * key: "my-flow-control-key",
445
+ * value: "my-flow-control-value",
446
+ * },
447
+ * retries: 3,
448
+ * });
449
+ *
450
+ * console.log(response.workflowRunId); // ID of the new workflow run
451
+ * ```
452
+ *
453
+ * Example with multiple DLQ IDs:
454
+ * ```ts
455
+ * const response = await client.dlq.resume({
456
+ * dlqId: ["dlq-12345", "dlq-67890"],
457
+ * // other parameters...
458
+ * });
459
+ * console.log(response[0].workflowRunId); // ID of the first workflow run
460
+ * console.log(response[1].workflowRunId); // ID of the second workflow run
461
+ * ```
462
+ *
463
+ * if the dlqId is not found, throws an error.
464
+ *
465
+ * @param dlqId - The ID(s) of the DLQ message(s) to resume.
466
+ * @param flowControl - Optional flow control parameters. If not passed, flow
467
+ * control of the failing workflow will be used
468
+ * @param retries - Optional number of retries to perform if the request fails.
469
+ * If not passed, retries settings of the failing workflow will be used.
470
+ * @returns run id and creation time of the new workflow run(s).
471
+ */
472
+ resume(parameters: DLQResumeRestartOptions<string>): Promise<DLQResumeRestartResponse>;
473
+ resume(parameters: DLQResumeRestartOptions<string[]>): Promise<DLQResumeRestartResponse[]>;
474
+ /**
475
+ * Restarts the workflow run for the given DLQ message(s).
476
+ *
477
+ * Restarting means that the new workflow run will start executing from the
478
+ * beginning with the same initial payload and configuration.
479
+ *
480
+ * If you want to resume the workflow run from where it failed, use
481
+ * `resume` method instead.
482
+ *
483
+ * Example with a single DLQ ID:
484
+ * ```ts
485
+ * const response = await client.dlq.restart({
486
+ * dlqId: "dlq-12345",
487
+ * flowControl: {
488
+ * key: "my-flow-control-key",
489
+ * value: "my-flow-control-value",
490
+ * },
491
+ * retries: 3,
492
+ * });
493
+ *
494
+ * console.log(response.workflowRunId); // ID of the new workflow run
495
+ * ```
496
+ *
497
+ * Example with multiple DLQ IDs:
498
+ * ```ts
499
+ * const response = await client.dlq.restart({
500
+ * dlqId: ["dlq-12345", "dlq-67890"],
501
+ * // other parameters...
502
+ * });
503
+ * console.log(response[0].workflowRunId); // ID of the first workflow run
504
+ * console.log(response[1].workflowRunId); // ID of the second workflow run
505
+ * ```
506
+ *
507
+ * if the dlqId is not found, throws an error.
508
+ *
509
+ * @param dlqId - The ID(s) of the DLQ message(s) to restart.
510
+ * @param flowControl - Optional flow control parameters. If not passed, flow
511
+ * control of the failing workflow will be used
512
+ * @param retries - Optional number of retries to perform if the request fails.
513
+ * If not passed, retries settings of the failing workflow will be used.
514
+ * @returns run id and creation time of the new workflow run(s).
515
+ */
516
+ restart(parameters: DLQResumeRestartOptions<string>): Promise<DLQResumeRestartResponse>;
517
+ restart(parameters: DLQResumeRestartOptions<string[]>): Promise<DLQResumeRestartResponse[]>;
518
+ private static handleDLQOptions;
519
+ private static getDlqIdQueryParameter;
520
+ }
371
521
 
372
522
  type ClientConfig = ConstructorParameters<typeof Client$1>[0];
373
523
  /**
@@ -579,32 +729,7 @@ declare class Client {
579
729
  workflowUrl?: WorkflowRunLog["workflowUrl"];
580
730
  workflowCreatedAt?: WorkflowRunLog["workflowRunCreatedAt"];
581
731
  }): Promise<WorkflowRunLogs>;
732
+ get dlq(): DLQ;
582
733
  }
583
734
 
584
- /**
585
- * Error raised during Workflow execution
586
- */
587
- declare class WorkflowError extends QstashError {
588
- constructor(message: string);
589
- }
590
- /**
591
- * Raised when the workflow executes a function successfully
592
- * and aborts to end the execution
593
- */
594
- declare class WorkflowAbort extends Error {
595
- stepInfo?: Step;
596
- stepName: string;
597
- /**
598
- * whether workflow is to be canceled on abort
599
- */
600
- cancelWorkflow: boolean;
601
- /**
602
- *
603
- * @param stepName name of the aborting step
604
- * @param stepInfo step information
605
- * @param cancelWorkflow
606
- */
607
- constructor(stepName: string, stepInfo?: Step, cancelWorkflow?: boolean);
608
- }
609
-
610
- export { Client, ExclusiveValidationOptions, NotifyResponse, RawStep, RouteFunction, Step, type StepLog, StepType, Telemetry, type TriggerOptions, Waiter, WorkflowAbort, WorkflowError, type WorkflowRunLog, type WorkflowRunLogs, WorkflowServeOptions, serve };
735
+ export { Client, type DLQResumeRestartOptions, type DLQResumeRestartResponse, ExclusiveValidationOptions, NotifyResponse, RawStep, RouteFunction, type StepLog, StepType, Telemetry, type TriggerOptions, Waiter, type WorkflowRunLog, type WorkflowRunLogs, WorkflowServeOptions, serve };