@mastra/client-js 1.21.2-alpha.2 → 1.22.0-alpha.3

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.js CHANGED
@@ -3180,6 +3180,35 @@ var Run = class extends BaseResource {
3180
3180
  }
3181
3181
  }).then(deserializeWorkflowError);
3182
3182
  }
3183
+ /**
3184
+ * Resumes a suspended workflow step without waiting for the workflow to complete (fire-and-forget)
3185
+ * and returns immediately with the runId. The workflow continues executing in the background.
3186
+ *
3187
+ * Use this when you want to dispatch a resume and return immediately (e.g. an HTTP handler that
3188
+ * never needs the resolved result inline). For Inngest-backed workflows this also avoids the
3189
+ * `getRunOutput()` polling race that `resumeAsync()` can hit.
3190
+ *
3191
+ * TODO(v2): in Mastra v2 this fire-and-forget behavior should become the behavior of
3192
+ * `resumeAsync()` (to mirror `start`/`resume` fire-and-forget semantics), and this method
3193
+ * should be removed. Kept as a separate method in v1 to avoid a breaking contract change.
3194
+ *
3195
+ * @param params - Object containing the step, resumeData and requestContext
3196
+ * @returns Promise containing the runId of the resumed workflow run
3197
+ */
3198
+ resumeNoWait(params) {
3199
+ const requestContext = parseClientRequestContext(params.requestContext);
3200
+ return this.request(`/workflows/${this.workflowId}/resume-no-wait?runId=${this.runId}`, {
3201
+ method: "POST",
3202
+ body: {
3203
+ step: params.step,
3204
+ resumeData: params.resumeData,
3205
+ requestContext,
3206
+ tracingOptions: params.tracingOptions,
3207
+ perStep: params.perStep,
3208
+ forEachIndex: params.forEachIndex
3209
+ }
3210
+ });
3211
+ }
3183
3212
  /**
3184
3213
  * Resumes a suspended workflow step that uses stream asynchronously and returns a promise that resolves when the workflow is complete
3185
3214
  * @param params - Object containing the step, resumeData and requestContext