@mastra/inngest 1.0.0-beta.8 → 1.0.0-beta.9
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 +91 -0
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/workflow.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
|
|
8
|
+
|
|
9
|
+
Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
|
|
10
|
+
- `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
|
|
11
|
+
- `withNestedWorkflows`: Control whether to fetch nested workflow data
|
|
12
|
+
|
|
13
|
+
This significantly reduces response payload size and improves response times for large workflows.
|
|
14
|
+
|
|
15
|
+
## Server Endpoint Usage
|
|
16
|
+
|
|
17
|
+
```http
|
|
18
|
+
# Get only status (minimal payload - fastest)
|
|
19
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
|
|
20
|
+
|
|
21
|
+
# Get status and result
|
|
22
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
|
|
23
|
+
|
|
24
|
+
# Get all fields but without nested workflow data (faster)
|
|
25
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
|
|
26
|
+
|
|
27
|
+
# Get only specific fields without nested workflow data
|
|
28
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
|
|
29
|
+
|
|
30
|
+
# Get full data (default behavior)
|
|
31
|
+
GET /api/workflows/:workflowId/runs/:runId/execution-result
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Client SDK Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { MastraClient } from '@mastra/client-js';
|
|
38
|
+
|
|
39
|
+
const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
40
|
+
const workflow = client.getWorkflow('myWorkflow');
|
|
41
|
+
|
|
42
|
+
// Get only status (minimal payload - fastest)
|
|
43
|
+
const statusOnly = await workflow.runExecutionResult(runId, {
|
|
44
|
+
fields: ['status'],
|
|
45
|
+
});
|
|
46
|
+
console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
|
|
47
|
+
|
|
48
|
+
// Get status and result
|
|
49
|
+
const statusAndResult = await workflow.runExecutionResult(runId, {
|
|
50
|
+
fields: ['status', 'result'],
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Get all fields but without nested workflow data (faster)
|
|
54
|
+
const resultWithoutNested = await workflow.runExecutionResult(runId, {
|
|
55
|
+
withNestedWorkflows: false,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Get specific fields without nested workflow data
|
|
59
|
+
const optimized = await workflow.runExecutionResult(runId, {
|
|
60
|
+
fields: ['status', 'steps'],
|
|
61
|
+
withNestedWorkflows: false,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Get full execution result (default behavior)
|
|
65
|
+
const fullResult = await workflow.runExecutionResult(runId);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Core API Changes
|
|
69
|
+
|
|
70
|
+
The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
await workflow.getWorkflowRunExecutionResult(runId, {
|
|
74
|
+
withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
|
|
75
|
+
fields: ['status', 'result'], // optional field filtering
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Inngest Compatibility
|
|
80
|
+
|
|
81
|
+
The `@mastra/inngest` package has been updated to use the new options object API. This is a non-breaking internal change - no action required from inngest workflow users.
|
|
82
|
+
|
|
83
|
+
## Performance Impact
|
|
84
|
+
|
|
85
|
+
For workflows with large step outputs:
|
|
86
|
+
- Requesting only `status`: ~99% reduction in payload size
|
|
87
|
+
- Requesting `status,result,error`: ~95% reduction in payload size
|
|
88
|
+
- Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
|
|
89
|
+
- Combining both: Maximum performance optimization
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [[`4f94ed8`](https://github.com/mastra-ai/mastra/commit/4f94ed8177abfde3ec536e3574883e075423350c), [`ac3cc23`](https://github.com/mastra-ai/mastra/commit/ac3cc2397d1966bc0fc2736a223abc449d3c7719), [`a86f4df`](https://github.com/mastra-ai/mastra/commit/a86f4df0407311e0d2ea49b9a541f0938810d6a9), [`029540c`](https://github.com/mastra-ai/mastra/commit/029540ca1e582fc2dd8d288ecd4a9b0f31a954ef), [`66741d1`](https://github.com/mastra-ai/mastra/commit/66741d1a99c4f42cf23a16109939e8348ac6852e), [`01b20fe`](https://github.com/mastra-ai/mastra/commit/01b20fefb7c67c2b7d79417598ef4e60256d1225), [`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119), [`a7ce182`](https://github.com/mastra-ai/mastra/commit/a7ce1822a8785ce45d62dd5c911af465e144f7d7)]:
|
|
92
|
+
- @mastra/core@1.0.0-beta.14
|
|
93
|
+
|
|
3
94
|
## 1.0.0-beta.8
|
|
4
95
|
|
|
5
96
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1146,7 +1146,9 @@ var InngestWorkflow = class _InngestWorkflow extends workflows.Workflow {
|
|
|
1146
1146
|
workflowStatus: run.workflowRunStatus,
|
|
1147
1147
|
stepResults: {}
|
|
1148
1148
|
});
|
|
1149
|
-
const workflowSnapshotInStorage = await this.getWorkflowRunExecutionResult(runIdToUse,
|
|
1149
|
+
const workflowSnapshotInStorage = await this.getWorkflowRunExecutionResult(runIdToUse, {
|
|
1150
|
+
withNestedWorkflows: false
|
|
1151
|
+
});
|
|
1150
1152
|
if (!workflowSnapshotInStorage && shouldPersistSnapshot) {
|
|
1151
1153
|
await this.mastra?.getStorage()?.persistWorkflowSnapshot({
|
|
1152
1154
|
workflowName: this.id,
|