@mastra/inngest 0.0.0-course-20250527170450 → 0.0.0-fix-generate-title-20250616171351

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,12 +1,165 @@
1
1
  # @mastra/inngest
2
2
 
3
- ## 0.0.0-course-20250527170450
3
+ ## 0.0.0-fix-generate-title-20250616171351
4
+
5
+ ### Patch Changes
6
+
7
+ - 63f6b7d: dependencies updates:
8
+ - Updated dependency [`inngest@^3.39.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.1) (from `^3.35.1`, in `dependencies`)
9
+ - Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
10
+ - ee9af57: Add api for polling run execution result and get run by id
11
+ - Updated dependencies [63f6b7d]
12
+ - Updated dependencies [9d56287]
13
+ - Updated dependencies [ee9af57]
14
+ - Updated dependencies [36f1c36]
15
+ - Updated dependencies [10d352e]
16
+ - Updated dependencies [53d3c37]
17
+ - Updated dependencies [751c894]
18
+ - Updated dependencies [577ce3a]
19
+ - Updated dependencies [9260b3a]
20
+ - @mastra/core@0.0.0-fix-generate-title-20250616171351
21
+
22
+ ## 0.10.5-alpha.1
23
+
24
+ ### Patch Changes
25
+
26
+ - ee9af57: Add api for polling run execution result and get run by id
27
+ - Updated dependencies [ee9af57]
28
+ - Updated dependencies [751c894]
29
+ - Updated dependencies [577ce3a]
30
+ - Updated dependencies [9260b3a]
31
+ - @mastra/core@0.10.6-alpha.1
32
+
33
+ ## 0.10.5-alpha.0
34
+
35
+ ### Patch Changes
36
+
37
+ - 63f6b7d: dependencies updates:
38
+ - Updated dependency [`inngest@^3.39.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.1) (from `^3.35.1`, in `dependencies`)
39
+ - Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
40
+ - Updated dependencies [63f6b7d]
41
+ - Updated dependencies [36f1c36]
42
+ - Updated dependencies [10d352e]
43
+ - Updated dependencies [53d3c37]
44
+ - @mastra/core@0.10.6-alpha.0
45
+
46
+ ## 0.10.4
47
+
48
+ ### Patch Changes
49
+
50
+ - 13c97f9: Save run status, result and error in storage snapshot
51
+ - Updated dependencies [13c97f9]
52
+ - @mastra/core@0.10.5
53
+
54
+ ## 0.10.3
55
+
56
+ ### Patch Changes
57
+
58
+ - 1ccccff: dependencies updates:
59
+ - Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
60
+ - 1ccccff: dependencies updates:
61
+ - Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
62
+ - Updated dependencies [d1ed912]
63
+ - Updated dependencies [f6fd25f]
64
+ - Updated dependencies [dffb67b]
65
+ - Updated dependencies [f1f1f1b]
66
+ - Updated dependencies [925ab94]
67
+ - Updated dependencies [f9816ae]
68
+ - Updated dependencies [82090c1]
69
+ - Updated dependencies [1b443fd]
70
+ - Updated dependencies [ce97900]
71
+ - Updated dependencies [f1309d3]
72
+ - Updated dependencies [14a2566]
73
+ - Updated dependencies [f7f8293]
74
+ - Updated dependencies [48eddb9]
75
+ - @mastra/core@0.10.4
76
+
77
+ ## 0.10.3-alpha.0
78
+
79
+ ### Patch Changes
80
+
81
+ - 1ccccff: dependencies updates:
82
+ - Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
83
+ - 1ccccff: dependencies updates:
84
+ - Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
85
+ - Updated dependencies [f6fd25f]
86
+ - Updated dependencies [dffb67b]
87
+ - Updated dependencies [f1309d3]
88
+ - Updated dependencies [f7f8293]
89
+ - @mastra/core@0.10.4-alpha.1
90
+
91
+ ## 0.10.2
92
+
93
+ ### Patch Changes
94
+
95
+ - 195c428: Add runId to step execute fn
96
+ - 12b7002: Add serializedStepGraph to workflow run snapshot in storage
97
+ - f0d559f: Fix peerdeps for alpha channel
98
+ - 1ee6894: inngest production url fix
99
+ - Updated dependencies [ee77e78]
100
+ - Updated dependencies [592a2db]
101
+ - Updated dependencies [e5dc18d]
102
+ - Updated dependencies [ab5adbe]
103
+ - Updated dependencies [1e8bb40]
104
+ - Updated dependencies [1b5fc55]
105
+ - Updated dependencies [195c428]
106
+ - Updated dependencies [f73e11b]
107
+ - Updated dependencies [37643b8]
108
+ - Updated dependencies [99fd6cf]
109
+ - Updated dependencies [c5bf1ce]
110
+ - Updated dependencies [add596e]
111
+ - Updated dependencies [8dc94d8]
112
+ - Updated dependencies [ecebbeb]
113
+ - Updated dependencies [79d5145]
114
+ - Updated dependencies [12b7002]
115
+ - Updated dependencies [2901125]
116
+ - @mastra/core@0.10.2
117
+
118
+ ## 0.10.2-alpha.3
119
+
120
+ ### Patch Changes
121
+
122
+ - 1ee6894: inngest production url fix
123
+ - Updated dependencies [1b5fc55]
124
+ - Updated dependencies [add596e]
125
+ - Updated dependencies [ecebbeb]
126
+ - @mastra/core@0.10.2-alpha.5
127
+
128
+ ## 0.10.2-alpha.2
129
+
130
+ ### Patch Changes
131
+
132
+ - 12b7002: Add serializedStepGraph to workflow run snapshot in storage
133
+ - Updated dependencies [c5bf1ce]
134
+ - Updated dependencies [12b7002]
135
+ - @mastra/core@0.10.2-alpha.4
136
+
137
+ ## 0.10.2-alpha.1
138
+
139
+ ### Patch Changes
140
+
141
+ - 195c428: Add runId to step execute fn
142
+ - Updated dependencies [ab5adbe]
143
+ - Updated dependencies [195c428]
144
+ - Updated dependencies [f73e11b]
145
+ - @mastra/core@0.10.2-alpha.3
146
+
147
+ ## 0.10.2-alpha.0
148
+
149
+ ### Patch Changes
150
+
151
+ - f0d559f: Fix peerdeps for alpha channel
152
+ - Updated dependencies [1e8bb40]
153
+ - @mastra/core@0.10.2-alpha.2
154
+
155
+ ## 0.10.1
4
156
 
5
157
  ### Patch Changes
6
158
 
7
159
  - 200d0da: Return payload data, start time, end time, resume time and suspend time for each step in workflow state
8
160
  Return error stack for failed workflow runs
9
161
  - 5343f93: Move emitter to symbol to make private
162
+ - Updated dependencies [d70b807]
10
163
  - Updated dependencies [6d16390]
11
164
  - Updated dependencies [1e4a421]
12
165
  - Updated dependencies [200d0da]
@@ -16,7 +169,7 @@
16
169
  - Updated dependencies [5c41100]
17
170
  - Updated dependencies [d6a759b]
18
171
  - Updated dependencies [6015bdf]
19
- - @mastra/core@0.0.0-course-20250527170450
172
+ - @mastra/core@0.10.1
20
173
 
21
174
  ## 0.10.1-alpha.0
22
175
 
@@ -1,7 +1,6 @@
1
+ import { Agent } from '@mastra/core';
1
2
  import type { BaseContext } from 'inngest';
2
3
  import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows';
4
- import { createStep } from '@mastra/core/workflows';
5
4
  import { DefaultExecutionEngine } from '@mastra/core/workflows';
6
5
  import type { ExecuteFunction } from '@mastra/core/workflows';
7
6
  import type { ExecutionContext } from '@mastra/core/workflows';
@@ -14,27 +13,57 @@ import { InngestMiddleware } from 'inngest';
14
13
  import type { Mastra } from '@mastra/core';
15
14
  import { Run } from '@mastra/core/workflows';
16
15
  import { RuntimeContext } from '@mastra/core/di';
16
+ import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
17
17
  import { serve as serve_2 } from 'inngest/hono';
18
18
  import type { Span } from '@opentelemetry/api';
19
19
  import type { Step } from '@mastra/core/workflows';
20
20
  import type { StepFlowEntry } from '@mastra/core/workflows';
21
21
  import type { StepResult } from '@mastra/core/workflows';
22
+ import { Tool } from '@mastra/core';
23
+ import type { ToolExecutionContext } from '@mastra/core';
24
+ import type { WatchEvent } from '@mastra/core/workflows';
22
25
  import { Workflow } from '@mastra/core/workflows';
23
26
  import type { WorkflowConfig } from '@mastra/core/workflows';
24
27
  import type { WorkflowResult } from '@mastra/core/workflows';
25
28
  import type { WorkflowRun } from '@mastra/core';
26
29
  import type { WorkflowRuns } from '@mastra/core';
27
- import type { z } from 'zod';
30
+ import { z } from 'zod';
28
31
 
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
- id: TWorkflowId;
31
- }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
+ export declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(params: {
33
+ id: TStepId;
34
+ description?: string;
35
+ inputSchema: TStepInput;
36
+ outputSchema: TStepOutput;
37
+ resumeSchema?: TResumeSchema;
38
+ suspendSchema?: TSuspendSchema;
39
+ execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, InngestEngineType>;
40
+ }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
41
+
42
+ export declare function createStep<TStepId extends string, TStepInput extends z.ZodObject<{
43
+ prompt: z.ZodString;
44
+ }>, TStepOutput extends z.ZodObject<{
45
+ text: z.ZodString;
46
+ }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
47
+
48
+ export declare function createStep<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn>>(tool: Tool<TSchemaIn, TSchemaOut, TContext> & {
49
+ inputSchema: TSchemaIn;
50
+ outputSchema: TSchemaOut;
51
+ execute: (context: TContext) => Promise<any>;
52
+ }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, InngestEngineType>;
32
53
 
33
54
  export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any>[] = Step<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
55
+ createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
56
  createStep: typeof createStep;
36
- cloneStep: typeof cloneStep;
37
- cloneWorkflow: typeof cloneWorkflow;
57
+ cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
58
+ id: TStepId;
59
+ }): Step<TStepId, any, any, any, any, InngestEngineType>;
60
+ cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TInput>, opts: {
61
+ id: TWorkflowId;
62
+ }): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
63
+ };
64
+
65
+ export declare type InngestEngineType = {
66
+ step: any;
38
67
  };
39
68
 
40
69
  export declare class InngestExecutionEngine extends DefaultExecutionEngine {
@@ -60,6 +89,10 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
60
89
  };
61
90
  runtimeContext: RuntimeContext;
62
91
  }): Promise<StepResult<any, any, any, any>>;
92
+ executeSleep({ id, duration }: {
93
+ id: string;
94
+ duration: number;
95
+ }): Promise<void>;
63
96
  executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
97
  step: Step<string, any, any>;
65
98
  stepResults: Record<string, StepResult<any, any, any, any>>;
@@ -84,21 +117,26 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
84
117
  };
85
118
  runtimeContext: RuntimeContext;
86
119
  }): Promise<StepResult<any, any, any, any>>;
87
- persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
120
+ persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
88
121
  workflowId: string;
89
122
  runId: string;
90
123
  stepResults: Record<string, StepResult<any, any, any, any>>;
124
+ serializedStepGraph: SerializedStepFlowEntry[];
91
125
  executionContext: ExecutionContext;
126
+ workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
127
+ result?: Record<string, any>;
128
+ error?: string | Error;
92
129
  }): Promise<void>;
93
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
130
+ executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
94
131
  workflowId: string;
95
132
  runId: string;
96
133
  entry: {
97
134
  type: 'conditional';
98
135
  steps: StepFlowEntry[];
99
- conditions: ExecuteFunction<any, any, any, any>[];
136
+ conditions: ExecuteFunction<any, any, any, any, InngestEngineType>[];
100
137
  };
101
138
  prevStep: StepFlowEntry;
139
+ serializedStepGraph: SerializedStepFlowEntry[];
102
140
  prevOutput: any;
103
141
  stepResults: Record<string, StepResult<any, any, any, any>>;
104
142
  resume?: {
@@ -115,14 +153,16 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
115
153
  }): Promise<StepResult<any, any, any, any>>;
116
154
  }
117
155
 
118
- export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
156
+ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TEngineType, TSteps, TInput, TOutput> {
119
157
  #private;
120
158
  private inngest;
159
+ serializedStepGraph: SerializedStepFlowEntry[];
121
160
  constructor(params: {
122
161
  workflowId: string;
123
162
  runId: string;
124
163
  executionEngine: ExecutionEngine;
125
164
  executionGraph: ExecutionGraph;
165
+ serializedStepGraph: SerializedStepFlowEntry[];
126
166
  mastra?: Mastra;
127
167
  retryConfig?: {
128
168
  attempts?: number;
@@ -144,7 +184,7 @@ export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<s
144
184
  watch(cb: (event: any) => void): () => void;
145
185
  }
146
186
 
147
- export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
187
+ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
188
  #private;
149
189
  inngest: Inngest;
150
190
  private function;
@@ -157,10 +197,11 @@ export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = S
157
197
  resourceId?: string;
158
198
  }): Promise<WorkflowRuns>;
159
199
  getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
200
+ getWorkflowRunExecutionResult(runId: string): Promise<WatchEvent['payload']['workflowState'] | null>;
160
201
  __registerMastra(mastra: Mastra): void;
161
202
  createRun(options?: {
162
203
  runId?: string;
163
- }): Run<TSteps, TInput, TOutput>;
204
+ }): Run<TEngineType, TSteps, TInput, TOutput>;
164
205
  getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
165
206
  cron: string;
166
207
  } & Partial<Record<"event" | "if", never>>] | [{
@@ -1,7 +1,6 @@
1
+ import { Agent } from '@mastra/core';
1
2
  import type { BaseContext } from 'inngest';
2
3
  import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows';
4
- import { createStep } from '@mastra/core/workflows';
5
4
  import { DefaultExecutionEngine } from '@mastra/core/workflows';
6
5
  import type { ExecuteFunction } from '@mastra/core/workflows';
7
6
  import type { ExecutionContext } from '@mastra/core/workflows';
@@ -14,27 +13,57 @@ import { InngestMiddleware } from 'inngest';
14
13
  import type { Mastra } from '@mastra/core';
15
14
  import { Run } from '@mastra/core/workflows';
16
15
  import { RuntimeContext } from '@mastra/core/di';
16
+ import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
17
17
  import { serve as serve_2 } from 'inngest/hono';
18
18
  import type { Span } from '@opentelemetry/api';
19
19
  import type { Step } from '@mastra/core/workflows';
20
20
  import type { StepFlowEntry } from '@mastra/core/workflows';
21
21
  import type { StepResult } from '@mastra/core/workflows';
22
+ import { Tool } from '@mastra/core';
23
+ import type { ToolExecutionContext } from '@mastra/core';
24
+ import type { WatchEvent } from '@mastra/core/workflows';
22
25
  import { Workflow } from '@mastra/core/workflows';
23
26
  import type { WorkflowConfig } from '@mastra/core/workflows';
24
27
  import type { WorkflowResult } from '@mastra/core/workflows';
25
28
  import type { WorkflowRun } from '@mastra/core';
26
29
  import type { WorkflowRuns } from '@mastra/core';
27
- import type { z } from 'zod';
30
+ import { z } from 'zod';
28
31
 
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
- id: TWorkflowId;
31
- }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
+ export declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(params: {
33
+ id: TStepId;
34
+ description?: string;
35
+ inputSchema: TStepInput;
36
+ outputSchema: TStepOutput;
37
+ resumeSchema?: TResumeSchema;
38
+ suspendSchema?: TSuspendSchema;
39
+ execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, InngestEngineType>;
40
+ }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
41
+
42
+ export declare function createStep<TStepId extends string, TStepInput extends z.ZodObject<{
43
+ prompt: z.ZodString;
44
+ }>, TStepOutput extends z.ZodObject<{
45
+ text: z.ZodString;
46
+ }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
47
+
48
+ export declare function createStep<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn>>(tool: Tool<TSchemaIn, TSchemaOut, TContext> & {
49
+ inputSchema: TSchemaIn;
50
+ outputSchema: TSchemaOut;
51
+ execute: (context: TContext) => Promise<any>;
52
+ }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, InngestEngineType>;
32
53
 
33
54
  export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any>[] = Step<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
55
+ createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
56
  createStep: typeof createStep;
36
- cloneStep: typeof cloneStep;
37
- cloneWorkflow: typeof cloneWorkflow;
57
+ cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
58
+ id: TStepId;
59
+ }): Step<TStepId, any, any, any, any, InngestEngineType>;
60
+ cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TInput>, opts: {
61
+ id: TWorkflowId;
62
+ }): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
63
+ };
64
+
65
+ export declare type InngestEngineType = {
66
+ step: any;
38
67
  };
39
68
 
40
69
  export declare class InngestExecutionEngine extends DefaultExecutionEngine {
@@ -60,6 +89,10 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
60
89
  };
61
90
  runtimeContext: RuntimeContext;
62
91
  }): Promise<StepResult<any, any, any, any>>;
92
+ executeSleep({ id, duration }: {
93
+ id: string;
94
+ duration: number;
95
+ }): Promise<void>;
63
96
  executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
97
  step: Step<string, any, any>;
65
98
  stepResults: Record<string, StepResult<any, any, any, any>>;
@@ -84,21 +117,26 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
84
117
  };
85
118
  runtimeContext: RuntimeContext;
86
119
  }): Promise<StepResult<any, any, any, any>>;
87
- persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
120
+ persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
88
121
  workflowId: string;
89
122
  runId: string;
90
123
  stepResults: Record<string, StepResult<any, any, any, any>>;
124
+ serializedStepGraph: SerializedStepFlowEntry[];
91
125
  executionContext: ExecutionContext;
126
+ workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
127
+ result?: Record<string, any>;
128
+ error?: string | Error;
92
129
  }): Promise<void>;
93
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
130
+ executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
94
131
  workflowId: string;
95
132
  runId: string;
96
133
  entry: {
97
134
  type: 'conditional';
98
135
  steps: StepFlowEntry[];
99
- conditions: ExecuteFunction<any, any, any, any>[];
136
+ conditions: ExecuteFunction<any, any, any, any, InngestEngineType>[];
100
137
  };
101
138
  prevStep: StepFlowEntry;
139
+ serializedStepGraph: SerializedStepFlowEntry[];
102
140
  prevOutput: any;
103
141
  stepResults: Record<string, StepResult<any, any, any, any>>;
104
142
  resume?: {
@@ -115,14 +153,16 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
115
153
  }): Promise<StepResult<any, any, any, any>>;
116
154
  }
117
155
 
118
- export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
156
+ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TEngineType, TSteps, TInput, TOutput> {
119
157
  #private;
120
158
  private inngest;
159
+ serializedStepGraph: SerializedStepFlowEntry[];
121
160
  constructor(params: {
122
161
  workflowId: string;
123
162
  runId: string;
124
163
  executionEngine: ExecutionEngine;
125
164
  executionGraph: ExecutionGraph;
165
+ serializedStepGraph: SerializedStepFlowEntry[];
126
166
  mastra?: Mastra;
127
167
  retryConfig?: {
128
168
  attempts?: number;
@@ -144,7 +184,7 @@ export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<s
144
184
  watch(cb: (event: any) => void): () => void;
145
185
  }
146
186
 
147
- export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
187
+ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
188
  #private;
149
189
  inngest: Inngest;
150
190
  private function;
@@ -157,10 +197,11 @@ export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = S
157
197
  resourceId?: string;
158
198
  }): Promise<WorkflowRuns>;
159
199
  getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
200
+ getWorkflowRunExecutionResult(runId: string): Promise<WatchEvent['payload']['workflowState'] | null>;
160
201
  __registerMastra(mastra: Mastra): void;
161
202
  createRun(options?: {
162
203
  runId?: string;
163
- }): Run<TSteps, TInput, TOutput>;
204
+ }): Run<TEngineType, TSteps, TInput, TOutput>;
164
205
  getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
165
206
  cron: string;
166
207
  } & Partial<Record<"event" | "if", never>>] | [{