@mastra/inngest 0.0.0-fix-generate-title-20250616171351 → 0.0.0-fix-fetching-workflow-snapshots-20250625000954
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 +92 -3
- package/dist/_tsup-dts-rollup.d.cts +51 -17
- package/dist/_tsup-dts-rollup.d.ts +51 -17
- package/dist/index.cjs +225 -18
- package/dist/index.js +225 -18
- package/package.json +8 -8
- package/src/index.test.ts +1478 -132
- package/src/index.ts +305 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-fetching-workflow-snapshots-20250625000954
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8a3bfd2: Update peerdeps to latest core
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 8e1b6e9: dependencies updates:
|
|
12
|
+
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
13
|
+
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
14
|
+
- 4fb0cc2: Type safe variable mapping
|
|
15
|
+
- 502fe05: createRun() -> createRunAsync()
|
|
16
|
+
- 4efcfa0: Added bail() method and more ergonomic suspend function return value
|
|
17
|
+
- Updated dependencies [15e9d26]
|
|
18
|
+
- Updated dependencies [d1baedb]
|
|
19
|
+
- Updated dependencies [d8f2d19]
|
|
20
|
+
- Updated dependencies [4d21bf2]
|
|
21
|
+
- Updated dependencies [07d6d88]
|
|
22
|
+
- Updated dependencies [9d52b17]
|
|
23
|
+
- Updated dependencies [2097952]
|
|
24
|
+
- Updated dependencies [792c4c0]
|
|
25
|
+
- Updated dependencies [5d74aab]
|
|
26
|
+
- Updated dependencies [a8b194f]
|
|
27
|
+
- Updated dependencies [4fb0cc2]
|
|
28
|
+
- Updated dependencies [d2a7a31]
|
|
29
|
+
- Updated dependencies [502fe05]
|
|
30
|
+
- Updated dependencies [144eb0b]
|
|
31
|
+
- Updated dependencies [8ba1b51]
|
|
32
|
+
- Updated dependencies [4efcfa0]
|
|
33
|
+
- Updated dependencies [0e17048]
|
|
34
|
+
- @mastra/core@0.0.0-fix-fetching-workflow-snapshots-20250625000954
|
|
35
|
+
|
|
36
|
+
## 0.11.0-alpha.3
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- 8a3bfd2: Update peerdeps to latest core
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- 502fe05: createRun() -> createRunAsync()
|
|
45
|
+
- 4efcfa0: Added bail() method and more ergonomic suspend function return value
|
|
46
|
+
- Updated dependencies [792c4c0]
|
|
47
|
+
- Updated dependencies [502fe05]
|
|
48
|
+
- Updated dependencies [4efcfa0]
|
|
49
|
+
- @mastra/core@0.10.7-alpha.3
|
|
50
|
+
|
|
51
|
+
## 0.10.6-alpha.2
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- 8e1b6e9: dependencies updates:
|
|
56
|
+
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
57
|
+
- Updated dependencies [15e9d26]
|
|
58
|
+
- Updated dependencies [07d6d88]
|
|
59
|
+
- Updated dependencies [5d74aab]
|
|
60
|
+
- Updated dependencies [144eb0b]
|
|
61
|
+
- @mastra/core@0.10.7-alpha.2
|
|
62
|
+
|
|
63
|
+
## 0.10.6-alpha.1
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- 4fb0cc2: Type safe variable mapping
|
|
68
|
+
- Updated dependencies [d1baedb]
|
|
69
|
+
- Updated dependencies [4d21bf2]
|
|
70
|
+
- Updated dependencies [2097952]
|
|
71
|
+
- Updated dependencies [4fb0cc2]
|
|
72
|
+
- Updated dependencies [d2a7a31]
|
|
73
|
+
- Updated dependencies [0e17048]
|
|
74
|
+
- @mastra/core@0.10.7-alpha.1
|
|
75
|
+
|
|
76
|
+
## 0.10.6-alpha.0
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
81
|
+
- Updated dependencies [d8f2d19]
|
|
82
|
+
- Updated dependencies [9d52b17]
|
|
83
|
+
- Updated dependencies [8ba1b51]
|
|
84
|
+
- @mastra/core@0.10.7-alpha.0
|
|
85
|
+
|
|
86
|
+
## 0.10.5
|
|
4
87
|
|
|
5
88
|
### Patch Changes
|
|
6
89
|
|
|
@@ -9,15 +92,21 @@
|
|
|
9
92
|
- Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
|
|
10
93
|
- ee9af57: Add api for polling run execution result and get run by id
|
|
11
94
|
- Updated dependencies [63f6b7d]
|
|
12
|
-
- Updated dependencies [
|
|
95
|
+
- Updated dependencies [12a95fc]
|
|
96
|
+
- Updated dependencies [4b0f8a6]
|
|
97
|
+
- Updated dependencies [51264a5]
|
|
98
|
+
- Updated dependencies [8e6f677]
|
|
99
|
+
- Updated dependencies [d70c420]
|
|
13
100
|
- Updated dependencies [ee9af57]
|
|
14
101
|
- Updated dependencies [36f1c36]
|
|
102
|
+
- Updated dependencies [2a16996]
|
|
15
103
|
- Updated dependencies [10d352e]
|
|
104
|
+
- Updated dependencies [9589624]
|
|
16
105
|
- Updated dependencies [53d3c37]
|
|
17
106
|
- Updated dependencies [751c894]
|
|
18
107
|
- Updated dependencies [577ce3a]
|
|
19
108
|
- Updated dependencies [9260b3a]
|
|
20
|
-
- @mastra/core@0.
|
|
109
|
+
- @mastra/core@0.10.6
|
|
21
110
|
|
|
22
111
|
## 0.10.5-alpha.1
|
|
23
112
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Agent } from '@mastra/core';
|
|
1
|
+
import type { Agent } from '@mastra/core';
|
|
2
2
|
import type { BaseContext } from 'inngest';
|
|
3
3
|
import { ClientOptions } from 'inngest';
|
|
4
4
|
import { DefaultExecutionEngine } from '@mastra/core/workflows';
|
|
5
|
+
import type { Emitter } from '@mastra/core/workflows';
|
|
5
6
|
import type { ExecuteFunction } from '@mastra/core/workflows';
|
|
6
7
|
import type { ExecutionContext } from '@mastra/core/workflows';
|
|
7
8
|
import type { ExecutionEngine } from '@mastra/core/workflows';
|
|
@@ -11,6 +12,7 @@ import type { Inngest } from 'inngest';
|
|
|
11
12
|
import { InngestFunction } from 'inngest';
|
|
12
13
|
import { InngestMiddleware } from 'inngest';
|
|
13
14
|
import type { Mastra } from '@mastra/core';
|
|
15
|
+
import type { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
14
16
|
import { Run } from '@mastra/core/workflows';
|
|
15
17
|
import { RuntimeContext } from '@mastra/core/di';
|
|
16
18
|
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
@@ -19,7 +21,8 @@ import type { Span } from '@opentelemetry/api';
|
|
|
19
21
|
import type { Step } from '@mastra/core/workflows';
|
|
20
22
|
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
21
23
|
import type { StepResult } from '@mastra/core/workflows';
|
|
22
|
-
import {
|
|
24
|
+
import type { StreamEvent } from '@mastra/core/workflows';
|
|
25
|
+
import { Tool } from '@mastra/core/tools';
|
|
23
26
|
import type { ToolExecutionContext } from '@mastra/core';
|
|
24
27
|
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
28
|
import { Workflow } from '@mastra/core/workflows';
|
|
@@ -57,9 +60,9 @@ export declare function init(inngest: Inngest): {
|
|
|
57
60
|
cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
|
|
58
61
|
id: TStepId;
|
|
59
62
|
}): 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,
|
|
63
|
+
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>[], TPrevSchema extends z.ZodType<any> = TInput>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TPrevSchema>, opts: {
|
|
61
64
|
id: TWorkflowId;
|
|
62
|
-
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput,
|
|
65
|
+
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema>;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
export declare type InngestEngineType = {
|
|
@@ -70,9 +73,26 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
70
73
|
private inngestStep;
|
|
71
74
|
private inngestAttempts;
|
|
72
75
|
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
execute<TInput, TOutput>(params: {
|
|
77
|
+
workflowId: string;
|
|
78
|
+
runId: string;
|
|
79
|
+
graph: ExecutionGraph;
|
|
80
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
81
|
+
input?: TInput;
|
|
82
|
+
resume?: {
|
|
83
|
+
steps: string[];
|
|
84
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
85
|
+
resumePayload: any;
|
|
86
|
+
resumePath: number[];
|
|
87
|
+
};
|
|
88
|
+
emitter: Emitter;
|
|
89
|
+
retryConfig?: {
|
|
90
|
+
attempts?: number;
|
|
91
|
+
delay?: number;
|
|
92
|
+
};
|
|
93
|
+
runtimeContext: RuntimeContext;
|
|
94
|
+
}): Promise<TOutput>;
|
|
95
|
+
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: Emitter, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
76
96
|
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
77
97
|
workflowId: string;
|
|
78
98
|
runId: string;
|
|
@@ -84,15 +104,17 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
84
104
|
resumePayload: any;
|
|
85
105
|
};
|
|
86
106
|
prevOutput: any;
|
|
87
|
-
emitter:
|
|
88
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
89
|
-
};
|
|
107
|
+
emitter: Emitter;
|
|
90
108
|
runtimeContext: RuntimeContext;
|
|
91
109
|
}): Promise<StepResult<any, any, any, any>>;
|
|
92
110
|
executeSleep({ id, duration }: {
|
|
93
111
|
id: string;
|
|
94
112
|
duration: number;
|
|
95
113
|
}): Promise<void>;
|
|
114
|
+
executeWaitForEvent({ event, timeout }: {
|
|
115
|
+
event: string;
|
|
116
|
+
timeout?: number;
|
|
117
|
+
}): Promise<any>;
|
|
96
118
|
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
119
|
step: Step<string, any, any>;
|
|
98
120
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
@@ -112,9 +134,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
112
134
|
runId?: string;
|
|
113
135
|
};
|
|
114
136
|
prevOutput: any;
|
|
115
|
-
emitter:
|
|
116
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
117
|
-
};
|
|
137
|
+
emitter: Emitter;
|
|
118
138
|
runtimeContext: RuntimeContext;
|
|
119
139
|
}): Promise<StepResult<any, any, any, any>>;
|
|
120
140
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -146,9 +166,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
146
166
|
resumePath: number[];
|
|
147
167
|
};
|
|
148
168
|
executionContext: ExecutionContext;
|
|
149
|
-
emitter:
|
|
150
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
151
|
-
};
|
|
169
|
+
emitter: Emitter;
|
|
152
170
|
runtimeContext: RuntimeContext;
|
|
153
171
|
}): Promise<StepResult<any, any, any, any>>;
|
|
154
172
|
}
|
|
@@ -172,6 +190,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
172
190
|
}, inngest: Inngest);
|
|
173
191
|
getRuns(eventId: string): Promise<any>;
|
|
174
192
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
|
+
sendEvent(event: string, data: any): Promise<void>;
|
|
175
194
|
start({ inputData, }: {
|
|
176
195
|
inputData?: z.infer<TInput>;
|
|
177
196
|
runtimeContext?: RuntimeContext;
|
|
@@ -181,7 +200,19 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
181
200
|
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
182
201
|
runtimeContext?: RuntimeContext;
|
|
183
202
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
184
|
-
|
|
203
|
+
_resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
204
|
+
resumeData?: z.infer<TResumeSchema>;
|
|
205
|
+
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
206
|
+
runtimeContext?: RuntimeContext;
|
|
207
|
+
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
208
|
+
watch(cb: (event: WatchEvent) => void, type?: 'watch' | 'watch-v2'): () => void;
|
|
209
|
+
stream({ inputData, runtimeContext }?: {
|
|
210
|
+
inputData?: z.infer<TInput>;
|
|
211
|
+
runtimeContext?: RuntimeContext;
|
|
212
|
+
}): {
|
|
213
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
214
|
+
getWorkflowState: () => Promise<WorkflowResult<TOutput, TSteps>>;
|
|
215
|
+
};
|
|
185
216
|
}
|
|
186
217
|
|
|
187
218
|
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> {
|
|
@@ -202,6 +233,9 @@ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps ext
|
|
|
202
233
|
createRun(options?: {
|
|
203
234
|
runId?: string;
|
|
204
235
|
}): Run<TEngineType, TSteps, TInput, TOutput>;
|
|
236
|
+
createRunAsync(options?: {
|
|
237
|
+
runId?: string;
|
|
238
|
+
}): Promise<Run<TEngineType, TSteps, TInput, TOutput>>;
|
|
205
239
|
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
206
240
|
cron: string;
|
|
207
241
|
} & Partial<Record<"event" | "if", never>>] | [{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Agent } from '@mastra/core';
|
|
1
|
+
import type { Agent } from '@mastra/core';
|
|
2
2
|
import type { BaseContext } from 'inngest';
|
|
3
3
|
import { ClientOptions } from 'inngest';
|
|
4
4
|
import { DefaultExecutionEngine } from '@mastra/core/workflows';
|
|
5
|
+
import type { Emitter } from '@mastra/core/workflows';
|
|
5
6
|
import type { ExecuteFunction } from '@mastra/core/workflows';
|
|
6
7
|
import type { ExecutionContext } from '@mastra/core/workflows';
|
|
7
8
|
import type { ExecutionEngine } from '@mastra/core/workflows';
|
|
@@ -11,6 +12,7 @@ import type { Inngest } from 'inngest';
|
|
|
11
12
|
import { InngestFunction } from 'inngest';
|
|
12
13
|
import { InngestMiddleware } from 'inngest';
|
|
13
14
|
import type { Mastra } from '@mastra/core';
|
|
15
|
+
import type { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
14
16
|
import { Run } from '@mastra/core/workflows';
|
|
15
17
|
import { RuntimeContext } from '@mastra/core/di';
|
|
16
18
|
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
@@ -19,7 +21,8 @@ import type { Span } from '@opentelemetry/api';
|
|
|
19
21
|
import type { Step } from '@mastra/core/workflows';
|
|
20
22
|
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
21
23
|
import type { StepResult } from '@mastra/core/workflows';
|
|
22
|
-
import {
|
|
24
|
+
import type { StreamEvent } from '@mastra/core/workflows';
|
|
25
|
+
import { Tool } from '@mastra/core/tools';
|
|
23
26
|
import type { ToolExecutionContext } from '@mastra/core';
|
|
24
27
|
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
28
|
import { Workflow } from '@mastra/core/workflows';
|
|
@@ -57,9 +60,9 @@ export declare function init(inngest: Inngest): {
|
|
|
57
60
|
cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
|
|
58
61
|
id: TStepId;
|
|
59
62
|
}): 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,
|
|
63
|
+
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>[], TPrevSchema extends z.ZodType<any> = TInput>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TPrevSchema>, opts: {
|
|
61
64
|
id: TWorkflowId;
|
|
62
|
-
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput,
|
|
65
|
+
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema>;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
export declare type InngestEngineType = {
|
|
@@ -70,9 +73,26 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
70
73
|
private inngestStep;
|
|
71
74
|
private inngestAttempts;
|
|
72
75
|
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
execute<TInput, TOutput>(params: {
|
|
77
|
+
workflowId: string;
|
|
78
|
+
runId: string;
|
|
79
|
+
graph: ExecutionGraph;
|
|
80
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
81
|
+
input?: TInput;
|
|
82
|
+
resume?: {
|
|
83
|
+
steps: string[];
|
|
84
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
85
|
+
resumePayload: any;
|
|
86
|
+
resumePath: number[];
|
|
87
|
+
};
|
|
88
|
+
emitter: Emitter;
|
|
89
|
+
retryConfig?: {
|
|
90
|
+
attempts?: number;
|
|
91
|
+
delay?: number;
|
|
92
|
+
};
|
|
93
|
+
runtimeContext: RuntimeContext;
|
|
94
|
+
}): Promise<TOutput>;
|
|
95
|
+
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: Emitter, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
76
96
|
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
77
97
|
workflowId: string;
|
|
78
98
|
runId: string;
|
|
@@ -84,15 +104,17 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
84
104
|
resumePayload: any;
|
|
85
105
|
};
|
|
86
106
|
prevOutput: any;
|
|
87
|
-
emitter:
|
|
88
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
89
|
-
};
|
|
107
|
+
emitter: Emitter;
|
|
90
108
|
runtimeContext: RuntimeContext;
|
|
91
109
|
}): Promise<StepResult<any, any, any, any>>;
|
|
92
110
|
executeSleep({ id, duration }: {
|
|
93
111
|
id: string;
|
|
94
112
|
duration: number;
|
|
95
113
|
}): Promise<void>;
|
|
114
|
+
executeWaitForEvent({ event, timeout }: {
|
|
115
|
+
event: string;
|
|
116
|
+
timeout?: number;
|
|
117
|
+
}): Promise<any>;
|
|
96
118
|
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
119
|
step: Step<string, any, any>;
|
|
98
120
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
@@ -112,9 +134,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
112
134
|
runId?: string;
|
|
113
135
|
};
|
|
114
136
|
prevOutput: any;
|
|
115
|
-
emitter:
|
|
116
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
117
|
-
};
|
|
137
|
+
emitter: Emitter;
|
|
118
138
|
runtimeContext: RuntimeContext;
|
|
119
139
|
}): Promise<StepResult<any, any, any, any>>;
|
|
120
140
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -146,9 +166,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
146
166
|
resumePath: number[];
|
|
147
167
|
};
|
|
148
168
|
executionContext: ExecutionContext;
|
|
149
|
-
emitter:
|
|
150
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
151
|
-
};
|
|
169
|
+
emitter: Emitter;
|
|
152
170
|
runtimeContext: RuntimeContext;
|
|
153
171
|
}): Promise<StepResult<any, any, any, any>>;
|
|
154
172
|
}
|
|
@@ -172,6 +190,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
172
190
|
}, inngest: Inngest);
|
|
173
191
|
getRuns(eventId: string): Promise<any>;
|
|
174
192
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
|
+
sendEvent(event: string, data: any): Promise<void>;
|
|
175
194
|
start({ inputData, }: {
|
|
176
195
|
inputData?: z.infer<TInput>;
|
|
177
196
|
runtimeContext?: RuntimeContext;
|
|
@@ -181,7 +200,19 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
181
200
|
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
182
201
|
runtimeContext?: RuntimeContext;
|
|
183
202
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
184
|
-
|
|
203
|
+
_resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
204
|
+
resumeData?: z.infer<TResumeSchema>;
|
|
205
|
+
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
206
|
+
runtimeContext?: RuntimeContext;
|
|
207
|
+
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
208
|
+
watch(cb: (event: WatchEvent) => void, type?: 'watch' | 'watch-v2'): () => void;
|
|
209
|
+
stream({ inputData, runtimeContext }?: {
|
|
210
|
+
inputData?: z.infer<TInput>;
|
|
211
|
+
runtimeContext?: RuntimeContext;
|
|
212
|
+
}): {
|
|
213
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
214
|
+
getWorkflowState: () => Promise<WorkflowResult<TOutput, TSteps>>;
|
|
215
|
+
};
|
|
185
216
|
}
|
|
186
217
|
|
|
187
218
|
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> {
|
|
@@ -202,6 +233,9 @@ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps ext
|
|
|
202
233
|
createRun(options?: {
|
|
203
234
|
runId?: string;
|
|
204
235
|
}): Run<TEngineType, TSteps, TInput, TOutput>;
|
|
236
|
+
createRunAsync(options?: {
|
|
237
|
+
runId?: string;
|
|
238
|
+
}): Promise<Run<TEngineType, TSteps, TInput, TOutput>>;
|
|
205
239
|
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
206
240
|
cron: string;
|
|
207
241
|
} & Partial<Record<"event" | "if", never>>] | [{
|