@trigger.dev/sdk 3.0.0-beta.44 → 3.0.0-beta.46

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.
@@ -1,4 +1,4 @@
1
- import { RetryOptions, FetchRetryOptions, ListProjectRunsQueryParams, CursorPagePromise, ListRunResponseItem, ListRunsQueryParams, ApiPromise, ReplayRunResponse, CanceledRunResponse, RetrieveRunResponse, TaskRunContext, QueueOptions, InitOutput, MachineCpu, MachineMemory, RunFnParams, InitFnParams, HandleErrorFnParams, HandleErrorResult, MiddlewareFnParams, StartFnParams, SuccessFnParams, FailureFnParams, ScheduledTaskPayload, CreateScheduleOptions, ScheduleObject, UpdateScheduleOptions, DeletedScheduleObject, ListScheduleOptions, OffsetLimitPagePromise, ImportEnvironmentVariablesParams, EnvironmentVariableResponseBody, EnvironmentVariables, CreateEnvironmentVariableParams, EnvironmentVariableValue, UpdateEnvironmentVariableParams, ApiClientConfiguration } from '@trigger.dev/core/v3';
1
+ import { RetryOptions, FetchRetryOptions, ListProjectRunsQueryParams, CursorPagePromise, ListRunResponseItem, ListRunsQueryParams, ApiPromise, ReplayRunResponse, CanceledRunResponse, RescheduleRunRequestBody, RetrieveRunResponse, TaskRunContext, QueueOptions, InitOutput, MachineCpu, MachineMemory, RunFnParams, InitFnParams, HandleErrorFnParams, HandleErrorResult, MiddlewareFnParams, StartFnParams, SuccessFnParams, FailureFnParams, ScheduledTaskPayload, CreateScheduleOptions, ScheduleObject, UpdateScheduleOptions, DeletedScheduleObject, ListScheduleOptions, OffsetLimitPagePromise, ImportEnvironmentVariablesParams, EnvironmentVariableResponseBody, EnvironmentVariables, CreateEnvironmentVariableParams, EnvironmentVariableValue, UpdateEnvironmentVariableParams, ApiClientConfiguration } from '@trigger.dev/core/v3';
2
2
  export { ApiClientConfiguration, ApiError, AuthenticationError, BadRequestError, ConflictError, HandleErrorArgs, HandleErrorFunction, ImportEnvironmentVariablesParams, InternalServerError, LogLevel, NotFoundError, PermissionDeniedError, RateLimitError, ResolveEnvironmentVariablesFunction, ResolveEnvironmentVariablesParams, ResolveEnvironmentVariablesResult, RetryOptions, ProjectConfig as TriggerConfig, UnprocessableEntityError, logger } from '@trigger.dev/core/v3';
3
3
  import { HttpHandler } from 'msw';
4
4
 
@@ -58,6 +58,7 @@ declare const runs: {
58
58
  cancel: typeof cancelRun;
59
59
  retrieve: typeof retrieveRun;
60
60
  list: typeof listRuns;
61
+ reschedule: typeof rescheduleRun;
61
62
  poll: typeof poll;
62
63
  };
63
64
  declare function listRuns(projectRef: string, params?: ListProjectRunsQueryParams): CursorPagePromise<typeof ListRunResponseItem>;
@@ -65,13 +66,14 @@ declare function listRuns(params?: ListRunsQueryParams): CursorPagePromise<typeo
65
66
  declare function retrieveRun<TRunId extends RunHandle<any> | string>(runId: TRunId): ApiPromise<RetrieveRunResult<TRunId>>;
66
67
  declare function replayRun(runId: string): ApiPromise<ReplayRunResponse>;
67
68
  declare function cancelRun(runId: string): ApiPromise<CanceledRunResponse>;
69
+ declare function rescheduleRun(runId: string, body: RescheduleRunRequestBody): ApiPromise<RetrieveRunResponse>;
68
70
  type PollOptions = {
69
71
  pollIntervalMs?: number;
70
72
  };
71
73
  declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHandle, options?: {
72
74
  pollIntervalMs?: number;
73
75
  }): Promise<(TRunHandle extends RunHandle<infer THandleOutput> ? Omit<{
74
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
76
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
75
77
  id: string;
76
78
  isTest: boolean;
77
79
  createdAt: Date;
@@ -114,10 +116,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
114
116
  version?: string | undefined;
115
117
  startedAt?: Date | undefined;
116
118
  finishedAt?: Date | undefined;
119
+ delayedUntil?: Date | undefined;
120
+ ttl?: string | undefined;
121
+ expiredAt?: Date | undefined;
117
122
  }, "output"> & {
118
123
  output?: THandleOutput | undefined;
119
124
  } : Omit<{
120
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
125
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
121
126
  id: string;
122
127
  isTest: boolean;
123
128
  createdAt: Date;
@@ -160,10 +165,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
160
165
  version?: string | undefined;
161
166
  startedAt?: Date | undefined;
162
167
  finishedAt?: Date | undefined;
168
+ delayedUntil?: Date | undefined;
169
+ ttl?: string | undefined;
170
+ expiredAt?: Date | undefined;
163
171
  }, "output"> & {
164
172
  output?: TRunHandle | undefined;
165
173
  }) extends infer T ? { [K in keyof T]: (TRunHandle extends RunHandle<infer THandleOutput> ? Omit<{
166
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
174
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
167
175
  id: string;
168
176
  isTest: boolean;
169
177
  createdAt: Date;
@@ -206,10 +214,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
206
214
  version?: string | undefined;
207
215
  startedAt?: Date | undefined;
208
216
  finishedAt?: Date | undefined;
217
+ delayedUntil?: Date | undefined;
218
+ ttl?: string | undefined;
219
+ expiredAt?: Date | undefined;
209
220
  }, "output"> & {
210
221
  output?: THandleOutput | undefined;
211
222
  } : Omit<{
212
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
223
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
213
224
  id: string;
214
225
  isTest: boolean;
215
226
  createdAt: Date;
@@ -252,6 +263,9 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
252
263
  version?: string | undefined;
253
264
  startedAt?: Date | undefined;
254
265
  finishedAt?: Date | undefined;
266
+ delayedUntil?: Date | undefined;
267
+ ttl?: string | undefined;
268
+ expiredAt?: Date | undefined;
255
269
  }, "output"> & {
256
270
  output?: TRunHandle | undefined;
257
271
  })[K]; } : never>;
@@ -507,10 +521,35 @@ type TaskIdentifier<TTask extends AnyTask> = TTask extends Task<infer TIdentifie
507
521
  type TaskRunOptions = {
508
522
  idempotencyKey?: string;
509
523
  maxAttempts?: number;
510
- startAt?: Date;
511
- startAfter?: number;
512
524
  queue?: TaskRunConcurrencyOptions;
513
525
  concurrencyKey?: string;
526
+ /**
527
+ * The delay before the task is executed. This can be a string like "1h" or a Date object.
528
+ *
529
+ * @example
530
+ * "1h" - 1 hour
531
+ * "30d" - 30 days
532
+ * "15m" - 15 minutes
533
+ * "2w" - 2 weeks
534
+ * "60s" - 60 seconds
535
+ * new Date("2025-01-01T00:00:00Z")
536
+ */
537
+ delay?: string | Date;
538
+ /**
539
+ * Set a time-to-live for this run. If the run is not executed within this time, it will be removed from the queue and never execute.
540
+ *
541
+ * @example
542
+ *
543
+ * ```ts
544
+ * await myTask.trigger({ foo: "bar" }, { ttl: "1h" });
545
+ * await myTask.trigger({ foo: "bar" }, { ttl: 60 * 60 }); // 1 hour
546
+ * ```
547
+ *
548
+ * The minimum value is 1 second. Setting the `ttl` to `0` will disable the TTL and the run will never expire.
549
+ *
550
+ * **Note:** Runs in development have a default `ttl` of 10 minutes. You can override this by setting the `ttl` option.
551
+ */
552
+ ttl?: string | number;
514
553
  };
515
554
  type TaskRunConcurrencyOptions = Queue;
516
555
  type Prettify<T> = {
@@ -1,4 +1,4 @@
1
- import { RetryOptions, FetchRetryOptions, ListProjectRunsQueryParams, CursorPagePromise, ListRunResponseItem, ListRunsQueryParams, ApiPromise, ReplayRunResponse, CanceledRunResponse, RetrieveRunResponse, TaskRunContext, QueueOptions, InitOutput, MachineCpu, MachineMemory, RunFnParams, InitFnParams, HandleErrorFnParams, HandleErrorResult, MiddlewareFnParams, StartFnParams, SuccessFnParams, FailureFnParams, ScheduledTaskPayload, CreateScheduleOptions, ScheduleObject, UpdateScheduleOptions, DeletedScheduleObject, ListScheduleOptions, OffsetLimitPagePromise, ImportEnvironmentVariablesParams, EnvironmentVariableResponseBody, EnvironmentVariables, CreateEnvironmentVariableParams, EnvironmentVariableValue, UpdateEnvironmentVariableParams, ApiClientConfiguration } from '@trigger.dev/core/v3';
1
+ import { RetryOptions, FetchRetryOptions, ListProjectRunsQueryParams, CursorPagePromise, ListRunResponseItem, ListRunsQueryParams, ApiPromise, ReplayRunResponse, CanceledRunResponse, RescheduleRunRequestBody, RetrieveRunResponse, TaskRunContext, QueueOptions, InitOutput, MachineCpu, MachineMemory, RunFnParams, InitFnParams, HandleErrorFnParams, HandleErrorResult, MiddlewareFnParams, StartFnParams, SuccessFnParams, FailureFnParams, ScheduledTaskPayload, CreateScheduleOptions, ScheduleObject, UpdateScheduleOptions, DeletedScheduleObject, ListScheduleOptions, OffsetLimitPagePromise, ImportEnvironmentVariablesParams, EnvironmentVariableResponseBody, EnvironmentVariables, CreateEnvironmentVariableParams, EnvironmentVariableValue, UpdateEnvironmentVariableParams, ApiClientConfiguration } from '@trigger.dev/core/v3';
2
2
  export { ApiClientConfiguration, ApiError, AuthenticationError, BadRequestError, ConflictError, HandleErrorArgs, HandleErrorFunction, ImportEnvironmentVariablesParams, InternalServerError, LogLevel, NotFoundError, PermissionDeniedError, RateLimitError, ResolveEnvironmentVariablesFunction, ResolveEnvironmentVariablesParams, ResolveEnvironmentVariablesResult, RetryOptions, ProjectConfig as TriggerConfig, UnprocessableEntityError, logger } from '@trigger.dev/core/v3';
3
3
  import { HttpHandler } from 'msw';
4
4
 
@@ -58,6 +58,7 @@ declare const runs: {
58
58
  cancel: typeof cancelRun;
59
59
  retrieve: typeof retrieveRun;
60
60
  list: typeof listRuns;
61
+ reschedule: typeof rescheduleRun;
61
62
  poll: typeof poll;
62
63
  };
63
64
  declare function listRuns(projectRef: string, params?: ListProjectRunsQueryParams): CursorPagePromise<typeof ListRunResponseItem>;
@@ -65,13 +66,14 @@ declare function listRuns(params?: ListRunsQueryParams): CursorPagePromise<typeo
65
66
  declare function retrieveRun<TRunId extends RunHandle<any> | string>(runId: TRunId): ApiPromise<RetrieveRunResult<TRunId>>;
66
67
  declare function replayRun(runId: string): ApiPromise<ReplayRunResponse>;
67
68
  declare function cancelRun(runId: string): ApiPromise<CanceledRunResponse>;
69
+ declare function rescheduleRun(runId: string, body: RescheduleRunRequestBody): ApiPromise<RetrieveRunResponse>;
68
70
  type PollOptions = {
69
71
  pollIntervalMs?: number;
70
72
  };
71
73
  declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHandle, options?: {
72
74
  pollIntervalMs?: number;
73
75
  }): Promise<(TRunHandle extends RunHandle<infer THandleOutput> ? Omit<{
74
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
76
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
75
77
  id: string;
76
78
  isTest: boolean;
77
79
  createdAt: Date;
@@ -114,10 +116,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
114
116
  version?: string | undefined;
115
117
  startedAt?: Date | undefined;
116
118
  finishedAt?: Date | undefined;
119
+ delayedUntil?: Date | undefined;
120
+ ttl?: string | undefined;
121
+ expiredAt?: Date | undefined;
117
122
  }, "output"> & {
118
123
  output?: THandleOutput | undefined;
119
124
  } : Omit<{
120
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
125
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
121
126
  id: string;
122
127
  isTest: boolean;
123
128
  createdAt: Date;
@@ -160,10 +165,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
160
165
  version?: string | undefined;
161
166
  startedAt?: Date | undefined;
162
167
  finishedAt?: Date | undefined;
168
+ delayedUntil?: Date | undefined;
169
+ ttl?: string | undefined;
170
+ expiredAt?: Date | undefined;
163
171
  }, "output"> & {
164
172
  output?: TRunHandle | undefined;
165
173
  }) extends infer T ? { [K in keyof T]: (TRunHandle extends RunHandle<infer THandleOutput> ? Omit<{
166
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
174
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
167
175
  id: string;
168
176
  isTest: boolean;
169
177
  createdAt: Date;
@@ -206,10 +214,13 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
206
214
  version?: string | undefined;
207
215
  startedAt?: Date | undefined;
208
216
  finishedAt?: Date | undefined;
217
+ delayedUntil?: Date | undefined;
218
+ ttl?: string | undefined;
219
+ expiredAt?: Date | undefined;
209
220
  }, "output"> & {
210
221
  output?: THandleOutput | undefined;
211
222
  } : Omit<{
212
- status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE";
223
+ status: "CANCELED" | "COMPLETED" | "FAILED" | "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
213
224
  id: string;
214
225
  isTest: boolean;
215
226
  createdAt: Date;
@@ -252,6 +263,9 @@ declare function poll<TRunHandle extends RunHandle<any> | string>(handle: TRunHa
252
263
  version?: string | undefined;
253
264
  startedAt?: Date | undefined;
254
265
  finishedAt?: Date | undefined;
266
+ delayedUntil?: Date | undefined;
267
+ ttl?: string | undefined;
268
+ expiredAt?: Date | undefined;
255
269
  }, "output"> & {
256
270
  output?: TRunHandle | undefined;
257
271
  })[K]; } : never>;
@@ -507,10 +521,35 @@ type TaskIdentifier<TTask extends AnyTask> = TTask extends Task<infer TIdentifie
507
521
  type TaskRunOptions = {
508
522
  idempotencyKey?: string;
509
523
  maxAttempts?: number;
510
- startAt?: Date;
511
- startAfter?: number;
512
524
  queue?: TaskRunConcurrencyOptions;
513
525
  concurrencyKey?: string;
526
+ /**
527
+ * The delay before the task is executed. This can be a string like "1h" or a Date object.
528
+ *
529
+ * @example
530
+ * "1h" - 1 hour
531
+ * "30d" - 30 days
532
+ * "15m" - 15 minutes
533
+ * "2w" - 2 weeks
534
+ * "60s" - 60 seconds
535
+ * new Date("2025-01-01T00:00:00Z")
536
+ */
537
+ delay?: string | Date;
538
+ /**
539
+ * Set a time-to-live for this run. If the run is not executed within this time, it will be removed from the queue and never execute.
540
+ *
541
+ * @example
542
+ *
543
+ * ```ts
544
+ * await myTask.trigger({ foo: "bar" }, { ttl: "1h" });
545
+ * await myTask.trigger({ foo: "bar" }, { ttl: 60 * 60 }); // 1 hour
546
+ * ```
547
+ *
548
+ * The minimum value is 1 second. Setting the `ttl` to `0` will disable the TTL and the run will never expire.
549
+ *
550
+ * **Note:** Runs in development have a default `ttl` of 10 minutes. You can override this by setting the `ttl` option.
551
+ */
552
+ ttl?: string | number;
514
553
  };
515
554
  type TaskRunConcurrencyOptions = Queue;
516
555
  type Prettify<T> = {
package/dist/v3/index.js CHANGED
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
19
19
  };
20
20
 
21
21
  // package.json
22
- var version = "3.0.0-beta.44";
22
+ var version = "3.0.0-beta.46";
23
23
 
24
24
  // src/v3/tracer.ts
25
25
  var tracer = new v3.TriggerTracer({
@@ -507,6 +507,7 @@ var runs = {
507
507
  cancel: cancelRun,
508
508
  retrieve: retrieveRun,
509
509
  list: listRuns,
510
+ reschedule: rescheduleRun,
510
511
  poll
511
512
  };
512
513
  function listRuns(paramsOrProjectRef, params) {
@@ -548,6 +549,14 @@ function cancelRun(runId) {
548
549
  return apiClient.cancelRun(runId);
549
550
  }
550
551
  __name(cancelRun, "cancelRun");
552
+ function rescheduleRun(runId, body) {
553
+ const apiClient = v3.apiClientManager.client;
554
+ if (!apiClient) {
555
+ throw apiClientMissingError();
556
+ }
557
+ return apiClient.rescheduleRun(runId, body);
558
+ }
559
+ __name(rescheduleRun, "rescheduleRun");
551
560
  async function poll(handle, options) {
552
561
  while (true) {
553
562
  const run = await runs.retrieve(handle);
@@ -582,7 +591,9 @@ function createTask(params) {
582
591
  concurrencyKey: options?.concurrencyKey,
583
592
  test: v3.taskContext.ctx?.run.isTest,
584
593
  payloadType: payloadPacket.dataType,
585
- idempotencyKey: options?.idempotencyKey
594
+ idempotencyKey: options?.idempotencyKey,
595
+ delay: options?.delay,
596
+ ttl: options?.ttl
586
597
  }
587
598
  }, {
588
599
  spanParentAsLink: true
@@ -627,7 +638,9 @@ function createTask(params) {
627
638
  concurrencyKey: item.options?.concurrencyKey,
628
639
  test: v3.taskContext.ctx?.run.isTest,
629
640
  payloadType: payloadPacket.dataType,
630
- idempotencyKey: item.options?.idempotencyKey
641
+ idempotencyKey: item.options?.idempotencyKey,
642
+ delay: item.options?.delay,
643
+ ttl: item.options?.ttl
631
644
  }
632
645
  };
633
646
  }))
@@ -685,7 +698,9 @@ function createTask(params) {
685
698
  concurrencyKey: options?.concurrencyKey,
686
699
  test: v3.taskContext.ctx?.run.isTest,
687
700
  payloadType: payloadPacket.dataType,
688
- idempotencyKey: options?.idempotencyKey
701
+ idempotencyKey: options?.idempotencyKey,
702
+ delay: options?.delay,
703
+ ttl: options?.ttl
689
704
  }
690
705
  });
691
706
  span.setAttribute("messaging.message.id", response.id);
@@ -746,7 +761,9 @@ function createTask(params) {
746
761
  concurrencyKey: item.options?.concurrencyKey,
747
762
  test: v3.taskContext.ctx?.run.isTest,
748
763
  payloadType: payloadPacket.dataType,
749
- idempotencyKey: item.options?.idempotencyKey
764
+ idempotencyKey: item.options?.idempotencyKey,
765
+ delay: item.options?.delay,
766
+ ttl: item.options?.ttl
750
767
  }
751
768
  };
752
769
  })),
@@ -856,7 +873,9 @@ async function trigger(id, payload, options) {
856
873
  concurrencyKey: options?.concurrencyKey,
857
874
  test: v3.taskContext.ctx?.run.isTest,
858
875
  payloadType: payloadPacket.dataType,
859
- idempotencyKey: options?.idempotencyKey
876
+ idempotencyKey: options?.idempotencyKey,
877
+ delay: options?.delay,
878
+ ttl: options?.ttl
860
879
  }
861
880
  });
862
881
  return handle;
@@ -882,7 +901,9 @@ async function batchTrigger(id, items) {
882
901
  concurrencyKey: item.options?.concurrencyKey,
883
902
  test: v3.taskContext.ctx?.run.isTest,
884
903
  payloadType: payloadPacket.dataType,
885
- idempotencyKey: item.options?.idempotencyKey
904
+ idempotencyKey: item.options?.idempotencyKey,
905
+ delay: item.options?.delay,
906
+ ttl: item.options?.ttl
886
907
  }
887
908
  };
888
909
  }))