@upstash/workflow 0.2.11 → 0.2.13

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/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  makeNotifyRequest,
11
11
  serve,
12
12
  triggerFirstInvocation
13
- } from "./chunk-WQAJ2RSZ.mjs";
13
+ } from "./chunk-XVNSBBDC.mjs";
14
14
 
15
15
  // src/client/index.ts
16
16
  import { Client as QStashClient } from "@upstash/qstash";
@@ -166,6 +166,11 @@ var Client = class {
166
166
  * with `wfr_`.
167
167
  * @param retries retry to use in the initial request. in the rest of
168
168
  * the workflow, `retries` option of the `serve` will be used.
169
+ * @param flowControl Settings for controlling the number of active requests
170
+ * and number of requests per second with the same key.
171
+ * @param delay Delay for the workflow run. This is used to delay the
172
+ * execution of the workflow run. The delay is in seconds or can be passed
173
+ * as a string with a time unit (e.g. "1h", "30m", "15s").
169
174
  * @returns workflow run id
170
175
  */
171
176
  async trigger({
@@ -174,7 +179,8 @@ var Client = class {
174
179
  headers,
175
180
  workflowRunId,
176
181
  retries,
177
- flowControl
182
+ flowControl,
183
+ delay
178
184
  }) {
179
185
  const finalWorkflowRunId = getWorkflowRunId(workflowRunId);
180
186
  const context = new WorkflowContext({
@@ -192,8 +198,9 @@ var Client = class {
192
198
  });
193
199
  const result = await triggerFirstInvocation({
194
200
  workflowContext: context,
195
- telemetry: void 0
201
+ telemetry: void 0,
196
202
  // can't know workflow telemetry here
203
+ delay
197
204
  });
198
205
  if (result.isOk()) {
199
206
  return { workflowRunId: finalWorkflowRunId };
package/nextjs.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
2
- import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
3
- import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
2
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-C1WIgVLA.mjs';
3
+ import { s as serveManyBase } from './serve-many-BF71QZHQ.mjs';
4
4
  import '@upstash/qstash';
5
5
  import 'zod';
6
6
  import 'ai';
package/nextjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
2
- import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
3
- import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
2
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-C1WIgVLA.js';
3
+ import { s as serveManyBase } from './serve-many-BMlN2PAB.js';
4
4
  import '@upstash/qstash';
5
5
  import 'zod';
6
6
  import 'ai';