@mastra/inngest 0.0.0-vnext-inngest-20250508121018 → 0.0.0-vnext-inngest-20250508122351

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mastra/inngest
2
2
 
3
- ## 0.0.0-vnext-inngest-20250508121018
3
+ ## 0.0.0-vnext-inngest-20250508122351
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -9,4 +9,4 @@
9
9
  - Updated dependencies [b5d2de0]
10
10
  - Updated dependencies [644f8ad]
11
11
  - Updated dependencies [70dbf51]
12
- - @mastra/core@0.0.0-vnext-inngest-20250508121018
12
+ - @mastra/core@0.0.0-vnext-inngest-20250508122351
package/dist/index.cjs CHANGED
@@ -166,17 +166,19 @@ var InngestWorkflow = class _InngestWorkflow extends vNext.NewWorkflow {
166
166
  }
167
167
  createRun(options) {
168
168
  const runIdToUse = options?.runId || crypto.randomUUID();
169
- const run = new InngestRun(
169
+ const run = this.runs.get(runIdToUse) ?? new InngestRun(
170
170
  {
171
171
  workflowId: this.id,
172
172
  runId: runIdToUse,
173
173
  executionEngine: this.executionEngine,
174
174
  executionGraph: this.executionGraph,
175
175
  mastra: this.#mastra,
176
- retryConfig: this.retryConfig
176
+ retryConfig: this.retryConfig,
177
+ cleanup: () => this.runs.delete(runIdToUse)
177
178
  },
178
179
  this.inngest
179
180
  );
181
+ this.runs.set(runIdToUse, run);
180
182
  return run;
181
183
  }
182
184
  getFunction() {
package/dist/index.js CHANGED
@@ -164,17 +164,19 @@ var InngestWorkflow = class _InngestWorkflow extends NewWorkflow {
164
164
  }
165
165
  createRun(options) {
166
166
  const runIdToUse = options?.runId || randomUUID();
167
- const run = new InngestRun(
167
+ const run = this.runs.get(runIdToUse) ?? new InngestRun(
168
168
  {
169
169
  workflowId: this.id,
170
170
  runId: runIdToUse,
171
171
  executionEngine: this.executionEngine,
172
172
  executionGraph: this.executionGraph,
173
173
  mastra: this.#mastra,
174
- retryConfig: this.retryConfig
174
+ retryConfig: this.retryConfig,
175
+ cleanup: () => this.runs.delete(runIdToUse)
175
176
  },
176
177
  this.inngest
177
178
  );
179
+ this.runs.set(runIdToUse, run);
178
180
  return run;
179
181
  }
180
182
  getFunction() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/inngest",
3
- "version": "0.0.0-vnext-inngest-20250508121018",
3
+ "version": "0.0.0-vnext-inngest-20250508122351",
4
4
  "description": "Mastra Inngest integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "inngest": "^3.35.1",
24
24
  "zod": "^3.24.2",
25
25
  "@opentelemetry/api": "^1.9.0",
26
- "@mastra/core": "0.0.0-vnext-inngest-20250508121018"
26
+ "@mastra/core": "0.0.0-vnext-inngest-20250508122351"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@ai-sdk/openai": "^1.2.1",
@@ -38,8 +38,8 @@
38
38
  "tsup": "^8.4.0",
39
39
  "typescript": "^5.8.2",
40
40
  "vitest": "^2.1.9",
41
- "@internal/lint": "0.0.0-vnext-inngest-20250508121018",
42
- "@mastra/deployer": "0.0.0-vnext-inngest-20250508121018"
41
+ "@internal/lint": "0.0.0-vnext-inngest-20250508122351",
42
+ "@mastra/deployer": "0.0.0-vnext-inngest-20250508122351"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
package/src/index.ts CHANGED
@@ -240,18 +240,22 @@ export class InngestWorkflow<
240
240
  const runIdToUse = options?.runId || randomUUID();
241
241
 
242
242
  // Return a new Run instance with object parameters
243
- const run: Run<TSteps, TInput, TOutput> = new InngestRun(
244
- {
245
- workflowId: this.id,
246
- runId: runIdToUse,
247
- executionEngine: this.executionEngine,
248
- executionGraph: this.executionGraph,
249
- mastra: this.#mastra,
250
- retryConfig: this.retryConfig,
251
- },
252
- this.inngest,
253
- );
243
+ const run: Run<TSteps, TInput, TOutput> =
244
+ this.runs.get(runIdToUse) ??
245
+ new InngestRun(
246
+ {
247
+ workflowId: this.id,
248
+ runId: runIdToUse,
249
+ executionEngine: this.executionEngine,
250
+ executionGraph: this.executionGraph,
251
+ mastra: this.#mastra,
252
+ retryConfig: this.retryConfig,
253
+ cleanup: () => this.runs.delete(runIdToUse),
254
+ },
255
+ this.inngest,
256
+ );
254
257
 
258
+ this.runs.set(runIdToUse, run);
255
259
  return run;
256
260
  }
257
261