@mastra/inngest 0.0.0-tool-call-parts-20250630193309 → 0.0.0-transpile-packages-20250724123433
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 +177 -3
- package/LICENSE.md +11 -42
- package/dist/_tsup-dts-rollup.d.cts +57 -16
- package/dist/_tsup-dts-rollup.d.ts +57 -16
- package/dist/index.cjs +171 -18
- package/dist/index.js +171 -18
- package/docker-compose.yaml +3 -3
- package/package.json +12 -11
- package/src/index.test.ts +1021 -199
- package/src/index.ts +230 -20
- package/vitest.config.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,195 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-transpile-packages-20250724123433
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- a723d69: Pass workflowId through
|
|
8
|
+
- Updated dependencies [f248d53]
|
|
9
|
+
- Updated dependencies [2affc57]
|
|
10
|
+
- Updated dependencies [66e13e3]
|
|
11
|
+
- Updated dependencies [18344d7]
|
|
12
|
+
- Updated dependencies [40c2525]
|
|
13
|
+
- Updated dependencies [e473f27]
|
|
14
|
+
- Updated dependencies [703ac71]
|
|
15
|
+
- Updated dependencies [a723d69]
|
|
16
|
+
- Updated dependencies [7827943]
|
|
17
|
+
- Updated dependencies [5889a31]
|
|
18
|
+
- Updated dependencies [bf1e7e7]
|
|
19
|
+
- Updated dependencies [4933192]
|
|
20
|
+
- Updated dependencies [d1c77a4]
|
|
21
|
+
- Updated dependencies [dcd4802]
|
|
22
|
+
- Updated dependencies [cbddd18]
|
|
23
|
+
- Updated dependencies [7ba91fa]
|
|
24
|
+
- @mastra/core@0.0.0-transpile-packages-20250724123433
|
|
25
|
+
|
|
26
|
+
## 0.11.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 0b56518: Ensure removed runtimeContext values are not saved in snapshot
|
|
31
|
+
- Updated dependencies [0b56518]
|
|
32
|
+
- Updated dependencies [db5cc15]
|
|
33
|
+
- Updated dependencies [2ba5b76]
|
|
34
|
+
- Updated dependencies [5237998]
|
|
35
|
+
- Updated dependencies [c3a30de]
|
|
36
|
+
- Updated dependencies [37c1acd]
|
|
37
|
+
- Updated dependencies [1aa60b1]
|
|
38
|
+
- Updated dependencies [89ec9d4]
|
|
39
|
+
- Updated dependencies [cf3a184]
|
|
40
|
+
- Updated dependencies [d6bfd60]
|
|
41
|
+
- Updated dependencies [626b0f4]
|
|
42
|
+
- Updated dependencies [c22a91f]
|
|
43
|
+
- Updated dependencies [f7403ab]
|
|
44
|
+
- Updated dependencies [6c89d7f]
|
|
45
|
+
- @mastra/core@0.10.15
|
|
46
|
+
|
|
47
|
+
## 0.11.4-alpha.0
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- 0b56518: Ensure removed runtimeContext values are not saved in snapshot
|
|
52
|
+
- Updated dependencies [0b56518]
|
|
53
|
+
- Updated dependencies [2ba5b76]
|
|
54
|
+
- Updated dependencies [c3a30de]
|
|
55
|
+
- Updated dependencies [cf3a184]
|
|
56
|
+
- Updated dependencies [d6bfd60]
|
|
57
|
+
- @mastra/core@0.10.15-alpha.1
|
|
58
|
+
|
|
59
|
+
## 0.11.3
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- 515488a: dependencies updates:
|
|
64
|
+
- Updated dependency [`inngest@^3.39.2` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.2) (from `^3.39.1`, in `dependencies`)
|
|
65
|
+
- defb5ae: dependencies updates:
|
|
66
|
+
- Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
|
|
67
|
+
- b790fd1: Ability to pass a function to .sleep()/.sleepUntil()
|
|
68
|
+
- c1cceea: Bump peerdeps of @matra/core
|
|
69
|
+
- Updated dependencies [2873c7f]
|
|
70
|
+
- Updated dependencies [1c1c6a1]
|
|
71
|
+
- Updated dependencies [f8ce2cc]
|
|
72
|
+
- Updated dependencies [8c846b6]
|
|
73
|
+
- Updated dependencies [c7bbf1e]
|
|
74
|
+
- Updated dependencies [8722d53]
|
|
75
|
+
- Updated dependencies [565cc0c]
|
|
76
|
+
- Updated dependencies [b790fd1]
|
|
77
|
+
- Updated dependencies [132027f]
|
|
78
|
+
- Updated dependencies [0c85311]
|
|
79
|
+
- Updated dependencies [d7ed04d]
|
|
80
|
+
- Updated dependencies [cb16baf]
|
|
81
|
+
- Updated dependencies [f36e4f1]
|
|
82
|
+
- Updated dependencies [7f6e403]
|
|
83
|
+
- @mastra/core@0.10.11
|
|
84
|
+
|
|
85
|
+
## 0.11.3-alpha.3
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- c1cceea: Bump peerdeps of @matra/core
|
|
90
|
+
- @mastra/core@0.10.11-alpha.4
|
|
91
|
+
|
|
92
|
+
## 0.11.3-alpha.2
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- defb5ae: dependencies updates:
|
|
97
|
+
- Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
|
|
98
|
+
- Updated dependencies [c7bbf1e]
|
|
99
|
+
- Updated dependencies [8722d53]
|
|
100
|
+
- Updated dependencies [132027f]
|
|
101
|
+
- Updated dependencies [0c85311]
|
|
102
|
+
- Updated dependencies [cb16baf]
|
|
103
|
+
- @mastra/core@0.10.11-alpha.3
|
|
104
|
+
|
|
105
|
+
## 0.11.3-alpha.1
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- 515488a: dependencies updates:
|
|
110
|
+
- Updated dependency [`inngest@^3.39.2` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.2) (from `^3.39.1`, in `dependencies`)
|
|
111
|
+
- Updated dependencies [7f6e403]
|
|
112
|
+
- @mastra/core@0.10.11-alpha.1
|
|
113
|
+
|
|
114
|
+
## 0.11.3-alpha.0
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- b790fd1: Ability to pass a function to .sleep()/.sleepUntil()
|
|
119
|
+
- Updated dependencies [f8ce2cc]
|
|
120
|
+
- Updated dependencies [8c846b6]
|
|
121
|
+
- Updated dependencies [b790fd1]
|
|
122
|
+
- Updated dependencies [d7ed04d]
|
|
123
|
+
- Updated dependencies [f36e4f1]
|
|
124
|
+
- @mastra/core@0.10.11-alpha.0
|
|
125
|
+
|
|
126
|
+
## 0.11.2
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- 48d9738: Fix inngest sleep stream events
|
|
131
|
+
- Updated dependencies [4d3fbdf]
|
|
132
|
+
- @mastra/core@0.10.10
|
|
133
|
+
|
|
134
|
+
## 0.11.2-alpha.0
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- 48d9738: Fix inngest sleep stream events
|
|
139
|
+
- Updated dependencies [4d3fbdf]
|
|
140
|
+
- @mastra/core@0.10.10-alpha.0
|
|
141
|
+
|
|
142
|
+
## 0.11.1
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- e423a31: Fix bug where nested workflows would cause Inngest duplicate key error
|
|
147
|
+
- 764f86a: Introduces the runCount property in the execution parameters for the steps execute function
|
|
148
|
+
- 1760a1c: Use workflow stream in playground instead of watch
|
|
149
|
+
- 038e5ae: Add cancel workflow run
|
|
150
|
+
- 81a1b3b: Update peerdeps
|
|
151
|
+
- Updated dependencies [9dda1ac]
|
|
152
|
+
- Updated dependencies [c984582]
|
|
153
|
+
- Updated dependencies [7e801dd]
|
|
154
|
+
- Updated dependencies [a606c75]
|
|
155
|
+
- Updated dependencies [7aa70a4]
|
|
156
|
+
- Updated dependencies [764f86a]
|
|
157
|
+
- Updated dependencies [1760a1c]
|
|
158
|
+
- Updated dependencies [038e5ae]
|
|
159
|
+
- Updated dependencies [7dda16a]
|
|
160
|
+
- Updated dependencies [5ebfcdd]
|
|
161
|
+
- Updated dependencies [b2d0c91]
|
|
162
|
+
- Updated dependencies [4e809ad]
|
|
163
|
+
- Updated dependencies [57929df]
|
|
164
|
+
- Updated dependencies [b7852ed]
|
|
165
|
+
- Updated dependencies [6320a61]
|
|
166
|
+
- @mastra/core@0.10.9
|
|
167
|
+
|
|
168
|
+
## 0.11.1-alpha.0
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- e423a31: Fix bug where nested workflows would cause Inngest duplicate key error
|
|
7
173
|
- 764f86a: Introduces the runCount property in the execution parameters for the steps execute function
|
|
8
174
|
- 1760a1c: Use workflow stream in playground instead of watch
|
|
175
|
+
- 038e5ae: Add cancel workflow run
|
|
176
|
+
- 81a1b3b: Update peerdeps
|
|
9
177
|
- Updated dependencies [9dda1ac]
|
|
178
|
+
- Updated dependencies [c984582]
|
|
10
179
|
- Updated dependencies [7e801dd]
|
|
180
|
+
- Updated dependencies [a606c75]
|
|
11
181
|
- Updated dependencies [7aa70a4]
|
|
12
182
|
- Updated dependencies [764f86a]
|
|
13
183
|
- Updated dependencies [1760a1c]
|
|
184
|
+
- Updated dependencies [038e5ae]
|
|
14
185
|
- Updated dependencies [7dda16a]
|
|
15
|
-
- Updated dependencies [
|
|
186
|
+
- Updated dependencies [5ebfcdd]
|
|
187
|
+
- Updated dependencies [b2d0c91]
|
|
188
|
+
- Updated dependencies [4e809ad]
|
|
16
189
|
- Updated dependencies [57929df]
|
|
190
|
+
- Updated dependencies [b7852ed]
|
|
17
191
|
- Updated dependencies [6320a61]
|
|
18
|
-
- @mastra/core@0.
|
|
192
|
+
- @mastra/core@0.10.9-alpha.0
|
|
19
193
|
|
|
20
194
|
## 0.11.0
|
|
21
195
|
|
package/LICENSE.md
CHANGED
|
@@ -1,46 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Apache License 2.0
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
|
17
|
-
|
|
18
|
-
**Patents**
|
|
19
|
-
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
20
|
-
|
|
21
|
-
**Notices**
|
|
22
|
-
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
|
23
|
-
|
|
24
|
-
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
|
25
|
-
|
|
26
|
-
**No Other Rights**
|
|
27
|
-
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
28
|
-
|
|
29
|
-
**Termination**
|
|
30
|
-
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
|
31
|
-
|
|
32
|
-
**No Liability**
|
|
33
|
-
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
34
|
-
|
|
35
|
-
**Definitions**
|
|
36
|
-
The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
|
|
37
|
-
|
|
38
|
-
_you_ refers to the individual or entity agreeing to these terms.
|
|
39
|
-
|
|
40
|
-
_your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
41
|
-
|
|
42
|
-
_your licenses_ are all the licenses granted to you for the software under these terms.
|
|
43
|
-
|
|
44
|
-
_use_ means anything you do with the software requiring one of your licenses.
|
|
45
|
-
|
|
46
|
-
_trademark_ means trademarks, service marks, and similar rights.
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
@@ -91,9 +91,10 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
91
91
|
delay?: number;
|
|
92
92
|
};
|
|
93
93
|
runtimeContext: RuntimeContext;
|
|
94
|
+
abortController: AbortController;
|
|
94
95
|
}): Promise<TOutput>;
|
|
95
96
|
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>;
|
|
96
|
-
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
|
+
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, abortController, runtimeContext, }: {
|
|
97
98
|
workflowId: string;
|
|
98
99
|
runId: string;
|
|
99
100
|
step: Step<string, any, any>;
|
|
@@ -105,29 +106,65 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
105
106
|
};
|
|
106
107
|
prevOutput: any;
|
|
107
108
|
emitter: Emitter;
|
|
109
|
+
abortController: AbortController;
|
|
108
110
|
runtimeContext: RuntimeContext;
|
|
109
111
|
}): Promise<StepResult<any, any, any, any>>;
|
|
110
|
-
executeSleep({
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
executeSleep({ workflowId, runId, entry, prevOutput, stepResults, emitter, abortController, runtimeContext, }: {
|
|
113
|
+
workflowId: string;
|
|
114
|
+
runId: string;
|
|
115
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
116
|
+
entry: {
|
|
117
|
+
type: 'sleep';
|
|
118
|
+
id: string;
|
|
119
|
+
duration?: number;
|
|
120
|
+
fn?: ExecuteFunction<any, any, any, any, InngestEngineType>;
|
|
121
|
+
};
|
|
122
|
+
prevStep: StepFlowEntry;
|
|
123
|
+
prevOutput: any;
|
|
124
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
125
|
+
resume?: {
|
|
126
|
+
steps: string[];
|
|
127
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
128
|
+
resumePayload: any;
|
|
129
|
+
resumePath: number[];
|
|
130
|
+
};
|
|
131
|
+
executionContext: ExecutionContext;
|
|
132
|
+
emitter: Emitter;
|
|
133
|
+
abortController: AbortController;
|
|
134
|
+
runtimeContext: RuntimeContext;
|
|
135
|
+
}): Promise<void>;
|
|
136
|
+
executeSleepUntil({ workflowId, runId, entry, prevOutput, stepResults, emitter, abortController, runtimeContext, }: {
|
|
137
|
+
workflowId: string;
|
|
138
|
+
runId: string;
|
|
139
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
140
|
+
entry: {
|
|
141
|
+
type: 'sleepUntil';
|
|
142
|
+
id: string;
|
|
143
|
+
date?: Date;
|
|
144
|
+
fn?: ExecuteFunction<any, any, any, any, InngestEngineType>;
|
|
145
|
+
};
|
|
146
|
+
prevStep: StepFlowEntry;
|
|
147
|
+
prevOutput: any;
|
|
148
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
149
|
+
resume?: {
|
|
150
|
+
steps: string[];
|
|
151
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
152
|
+
resumePayload: any;
|
|
153
|
+
resumePath: number[];
|
|
154
|
+
};
|
|
155
|
+
executionContext: ExecutionContext;
|
|
156
|
+
emitter: Emitter;
|
|
157
|
+
abortController: AbortController;
|
|
158
|
+
runtimeContext: RuntimeContext;
|
|
113
159
|
}): Promise<void>;
|
|
114
160
|
executeWaitForEvent({ event, timeout }: {
|
|
115
161
|
event: string;
|
|
116
162
|
timeout?: number;
|
|
117
163
|
}): Promise<any>;
|
|
118
|
-
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
164
|
+
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, abortController, runtimeContext, }: {
|
|
119
165
|
step: Step<string, any, any>;
|
|
120
166
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
121
|
-
executionContext:
|
|
122
|
-
workflowId: string;
|
|
123
|
-
runId: string;
|
|
124
|
-
executionPath: number[];
|
|
125
|
-
suspendedPaths: Record<string, number[]>;
|
|
126
|
-
retryConfig: {
|
|
127
|
-
attempts: number;
|
|
128
|
-
delay: number;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
167
|
+
executionContext: ExecutionContext;
|
|
131
168
|
resume?: {
|
|
132
169
|
steps: string[];
|
|
133
170
|
resumePayload: any;
|
|
@@ -135,6 +172,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
135
172
|
};
|
|
136
173
|
prevOutput: any;
|
|
137
174
|
emitter: Emitter;
|
|
175
|
+
abortController: AbortController;
|
|
138
176
|
runtimeContext: RuntimeContext;
|
|
139
177
|
}): Promise<StepResult<any, any, any, any>>;
|
|
140
178
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -146,8 +184,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
146
184
|
workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
|
|
147
185
|
result?: Record<string, any>;
|
|
148
186
|
error?: string | Error;
|
|
187
|
+
runtimeContext: RuntimeContext;
|
|
149
188
|
}): Promise<void>;
|
|
150
|
-
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
|
|
189
|
+
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, abortController, runtimeContext, }: {
|
|
151
190
|
workflowId: string;
|
|
152
191
|
runId: string;
|
|
153
192
|
entry: {
|
|
@@ -167,6 +206,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
167
206
|
};
|
|
168
207
|
executionContext: ExecutionContext;
|
|
169
208
|
emitter: Emitter;
|
|
209
|
+
abortController: AbortController;
|
|
170
210
|
runtimeContext: RuntimeContext;
|
|
171
211
|
}): Promise<StepResult<any, any, any, any>>;
|
|
172
212
|
}
|
|
@@ -191,6 +231,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
191
231
|
getRuns(eventId: string): Promise<any>;
|
|
192
232
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
233
|
sendEvent(event: string, data: any): Promise<void>;
|
|
234
|
+
cancel(): Promise<void>;
|
|
194
235
|
start({ inputData, }: {
|
|
195
236
|
inputData?: z.infer<TInput>;
|
|
196
237
|
runtimeContext?: RuntimeContext;
|
|
@@ -91,9 +91,10 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
91
91
|
delay?: number;
|
|
92
92
|
};
|
|
93
93
|
runtimeContext: RuntimeContext;
|
|
94
|
+
abortController: AbortController;
|
|
94
95
|
}): Promise<TOutput>;
|
|
95
96
|
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>;
|
|
96
|
-
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
|
+
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, abortController, runtimeContext, }: {
|
|
97
98
|
workflowId: string;
|
|
98
99
|
runId: string;
|
|
99
100
|
step: Step<string, any, any>;
|
|
@@ -105,29 +106,65 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
105
106
|
};
|
|
106
107
|
prevOutput: any;
|
|
107
108
|
emitter: Emitter;
|
|
109
|
+
abortController: AbortController;
|
|
108
110
|
runtimeContext: RuntimeContext;
|
|
109
111
|
}): Promise<StepResult<any, any, any, any>>;
|
|
110
|
-
executeSleep({
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
executeSleep({ workflowId, runId, entry, prevOutput, stepResults, emitter, abortController, runtimeContext, }: {
|
|
113
|
+
workflowId: string;
|
|
114
|
+
runId: string;
|
|
115
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
116
|
+
entry: {
|
|
117
|
+
type: 'sleep';
|
|
118
|
+
id: string;
|
|
119
|
+
duration?: number;
|
|
120
|
+
fn?: ExecuteFunction<any, any, any, any, InngestEngineType>;
|
|
121
|
+
};
|
|
122
|
+
prevStep: StepFlowEntry;
|
|
123
|
+
prevOutput: any;
|
|
124
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
125
|
+
resume?: {
|
|
126
|
+
steps: string[];
|
|
127
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
128
|
+
resumePayload: any;
|
|
129
|
+
resumePath: number[];
|
|
130
|
+
};
|
|
131
|
+
executionContext: ExecutionContext;
|
|
132
|
+
emitter: Emitter;
|
|
133
|
+
abortController: AbortController;
|
|
134
|
+
runtimeContext: RuntimeContext;
|
|
135
|
+
}): Promise<void>;
|
|
136
|
+
executeSleepUntil({ workflowId, runId, entry, prevOutput, stepResults, emitter, abortController, runtimeContext, }: {
|
|
137
|
+
workflowId: string;
|
|
138
|
+
runId: string;
|
|
139
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
140
|
+
entry: {
|
|
141
|
+
type: 'sleepUntil';
|
|
142
|
+
id: string;
|
|
143
|
+
date?: Date;
|
|
144
|
+
fn?: ExecuteFunction<any, any, any, any, InngestEngineType>;
|
|
145
|
+
};
|
|
146
|
+
prevStep: StepFlowEntry;
|
|
147
|
+
prevOutput: any;
|
|
148
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
149
|
+
resume?: {
|
|
150
|
+
steps: string[];
|
|
151
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
152
|
+
resumePayload: any;
|
|
153
|
+
resumePath: number[];
|
|
154
|
+
};
|
|
155
|
+
executionContext: ExecutionContext;
|
|
156
|
+
emitter: Emitter;
|
|
157
|
+
abortController: AbortController;
|
|
158
|
+
runtimeContext: RuntimeContext;
|
|
113
159
|
}): Promise<void>;
|
|
114
160
|
executeWaitForEvent({ event, timeout }: {
|
|
115
161
|
event: string;
|
|
116
162
|
timeout?: number;
|
|
117
163
|
}): Promise<any>;
|
|
118
|
-
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
164
|
+
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, abortController, runtimeContext, }: {
|
|
119
165
|
step: Step<string, any, any>;
|
|
120
166
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
121
|
-
executionContext:
|
|
122
|
-
workflowId: string;
|
|
123
|
-
runId: string;
|
|
124
|
-
executionPath: number[];
|
|
125
|
-
suspendedPaths: Record<string, number[]>;
|
|
126
|
-
retryConfig: {
|
|
127
|
-
attempts: number;
|
|
128
|
-
delay: number;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
167
|
+
executionContext: ExecutionContext;
|
|
131
168
|
resume?: {
|
|
132
169
|
steps: string[];
|
|
133
170
|
resumePayload: any;
|
|
@@ -135,6 +172,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
135
172
|
};
|
|
136
173
|
prevOutput: any;
|
|
137
174
|
emitter: Emitter;
|
|
175
|
+
abortController: AbortController;
|
|
138
176
|
runtimeContext: RuntimeContext;
|
|
139
177
|
}): Promise<StepResult<any, any, any, any>>;
|
|
140
178
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -146,8 +184,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
146
184
|
workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
|
|
147
185
|
result?: Record<string, any>;
|
|
148
186
|
error?: string | Error;
|
|
187
|
+
runtimeContext: RuntimeContext;
|
|
149
188
|
}): Promise<void>;
|
|
150
|
-
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
|
|
189
|
+
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, abortController, runtimeContext, }: {
|
|
151
190
|
workflowId: string;
|
|
152
191
|
runId: string;
|
|
153
192
|
entry: {
|
|
@@ -167,6 +206,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
167
206
|
};
|
|
168
207
|
executionContext: ExecutionContext;
|
|
169
208
|
emitter: Emitter;
|
|
209
|
+
abortController: AbortController;
|
|
170
210
|
runtimeContext: RuntimeContext;
|
|
171
211
|
}): Promise<StepResult<any, any, any, any>>;
|
|
172
212
|
}
|
|
@@ -191,6 +231,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
191
231
|
getRuns(eventId: string): Promise<any>;
|
|
192
232
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
233
|
sendEvent(event: string, data: any): Promise<void>;
|
|
234
|
+
cancel(): Promise<void>;
|
|
194
235
|
start({ inputData, }: {
|
|
195
236
|
inputData?: z.infer<TInput>;
|
|
196
237
|
runtimeContext?: RuntimeContext;
|