@mastra/mcp-docs-server 1.0.0-beta.5 → 1.0.0-beta.7

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.
Files changed (163) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +67 -67
  3. package/.docs/organized/changelogs/%40mastra%2Fastra.md +10 -10
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +12 -12
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +57 -57
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +110 -110
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +57 -57
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +57 -57
  9. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +60 -0
  11. package/.docs/organized/changelogs/%40mastra%2Fcore.md +358 -358
  12. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +24 -24
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +12 -12
  15. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +79 -79
  16. package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
  17. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +57 -57
  18. package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +61 -0
  19. package/.docs/organized/changelogs/%40mastra%2Fevals.md +12 -12
  20. package/.docs/organized/changelogs/%40mastra%2Flance.md +57 -57
  21. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +55 -55
  22. package/.docs/organized/changelogs/%40mastra%2Floggers.md +12 -12
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
  24. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +125 -125
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +36 -36
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +57 -57
  27. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +57 -57
  28. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
  29. package/.docs/organized/changelogs/%40mastra%2Fpg.md +59 -59
  30. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
  31. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +77 -77
  32. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +10 -10
  33. package/.docs/organized/changelogs/%40mastra%2Frag.md +43 -43
  34. package/.docs/organized/changelogs/%40mastra%2Freact.md +16 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
  36. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  37. package/.docs/organized/changelogs/%40mastra%2Fserver.md +113 -113
  38. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
  39. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +57 -57
  40. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +19 -19
  42. package/.docs/organized/changelogs/create-mastra.md +15 -15
  43. package/.docs/organized/changelogs/mastra.md +30 -30
  44. package/.docs/organized/code-examples/agui.md +1 -0
  45. package/.docs/organized/code-examples/ai-elements.md +1 -1
  46. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  47. package/.docs/organized/code-examples/ai-sdk-v5.md +2 -1
  48. package/.docs/organized/code-examples/assistant-ui.md +1 -1
  49. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
  50. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
  51. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  52. package/.docs/organized/code-examples/mcp-server-adapters.md +721 -0
  53. package/.docs/organized/code-examples/server-app-access.md +342 -0
  54. package/.docs/organized/code-examples/server-express-adapter.md +87 -0
  55. package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
  56. package/.docs/raw/agents/agent-approval.mdx +189 -0
  57. package/.docs/raw/agents/guardrails.mdx +13 -9
  58. package/.docs/raw/agents/networks.mdx +1 -0
  59. package/.docs/raw/agents/overview.mdx +8 -152
  60. package/.docs/raw/agents/processors.mdx +279 -0
  61. package/.docs/raw/agents/structured-output.mdx +224 -0
  62. package/.docs/raw/deployment/cloud-providers/index.mdx +19 -26
  63. package/.docs/raw/deployment/cloud-providers/netlify-deployer.mdx +44 -13
  64. package/.docs/raw/evals/running-in-ci.mdx +0 -2
  65. package/.docs/raw/{guides/getting-started → getting-started}/manual-install.mdx +2 -2
  66. package/.docs/raw/getting-started/start.mdx +1 -1
  67. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +8 -0
  68. package/.docs/raw/guides/getting-started/quickstart.mdx +1 -1
  69. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
  70. package/.docs/raw/guides/index.mdx +3 -35
  71. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +11 -0
  72. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +37 -0
  73. package/.docs/raw/index.mdx +1 -1
  74. package/.docs/raw/memory/memory-processors.mdx +265 -79
  75. package/.docs/raw/memory/working-memory.mdx +11 -2
  76. package/.docs/raw/observability/overview.mdx +0 -1
  77. package/.docs/raw/observability/tracing/bridges/otel.mdx +200 -0
  78. package/.docs/raw/observability/tracing/exporters/arize.mdx +36 -0
  79. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +19 -0
  80. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +83 -0
  81. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +12 -0
  82. package/.docs/raw/observability/tracing/exporters/otel.mdx +34 -22
  83. package/.docs/raw/observability/tracing/exporters/posthog.mdx +20 -0
  84. package/.docs/raw/observability/tracing/overview.mdx +76 -6
  85. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +0 -1
  86. package/.docs/raw/rag/retrieval.mdx +23 -6
  87. package/.docs/raw/rag/vector-databases.mdx +93 -2
  88. package/.docs/raw/reference/agents/generate.mdx +55 -6
  89. package/.docs/raw/reference/agents/network.mdx +44 -0
  90. package/.docs/raw/reference/client-js/memory.mdx +43 -0
  91. package/.docs/raw/reference/client-js/workflows.mdx +92 -63
  92. package/.docs/raw/reference/deployer/netlify.mdx +1 -2
  93. package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
  94. package/.docs/raw/reference/index.mdx +1 -0
  95. package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +177 -0
  96. package/.docs/raw/reference/observability/tracing/configuration.mdx +0 -4
  97. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +29 -0
  98. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +43 -0
  99. package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +17 -1
  100. package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +33 -43
  101. package/.docs/raw/reference/observability/tracing/instances.mdx +0 -4
  102. package/.docs/raw/reference/observability/tracing/interfaces.mdx +29 -4
  103. package/.docs/raw/reference/observability/tracing/spans.mdx +0 -4
  104. package/.docs/raw/reference/processors/language-detector.mdx +9 -2
  105. package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
  106. package/.docs/raw/reference/processors/moderation-processor.mdx +10 -3
  107. package/.docs/raw/reference/processors/pii-detector.mdx +10 -3
  108. package/.docs/raw/reference/processors/processor-interface.mdx +502 -0
  109. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +9 -2
  110. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
  111. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
  112. package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
  113. package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
  114. package/.docs/raw/reference/server/create-route.mdx +314 -0
  115. package/.docs/raw/reference/server/express-adapter.mdx +193 -0
  116. package/.docs/raw/reference/server/hono-adapter.mdx +174 -0
  117. package/.docs/raw/reference/server/mastra-server.mdx +316 -0
  118. package/.docs/raw/reference/server/routes.mdx +250 -0
  119. package/.docs/raw/reference/storage/cloudflare-d1.mdx +37 -0
  120. package/.docs/raw/reference/storage/convex.mdx +164 -0
  121. package/.docs/raw/reference/storage/lance.mdx +33 -0
  122. package/.docs/raw/reference/storage/libsql.mdx +37 -0
  123. package/.docs/raw/reference/storage/mongodb.mdx +39 -0
  124. package/.docs/raw/reference/storage/mssql.mdx +37 -0
  125. package/.docs/raw/reference/storage/postgresql.mdx +37 -0
  126. package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
  127. package/.docs/raw/reference/streaming/agents/stream.mdx +56 -1
  128. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +7 -9
  129. package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
  130. package/.docs/raw/reference/streaming/workflows/stream.mdx +83 -24
  131. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +170 -0
  132. package/.docs/raw/reference/tools/mcp-client.mdx +128 -18
  133. package/.docs/raw/reference/vectors/convex.mdx +429 -0
  134. package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
  135. package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
  136. package/.docs/raw/reference/voice/google.mdx +159 -20
  137. package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
  138. package/.docs/raw/reference/workflows/run-methods/resume.mdx +44 -0
  139. package/.docs/raw/reference/workflows/run-methods/start.mdx +44 -0
  140. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +310 -0
  141. package/.docs/raw/reference/workflows/run.mdx +27 -5
  142. package/.docs/raw/reference/workflows/step.mdx +13 -0
  143. package/.docs/raw/reference/workflows/workflow.mdx +19 -0
  144. package/.docs/raw/server-db/custom-adapters.mdx +380 -0
  145. package/.docs/raw/server-db/mastra-server.mdx +16 -8
  146. package/.docs/raw/server-db/request-context.mdx +0 -1
  147. package/.docs/raw/server-db/server-adapters.mdx +286 -0
  148. package/.docs/raw/server-db/storage.mdx +11 -0
  149. package/.docs/raw/streaming/overview.mdx +6 -6
  150. package/.docs/raw/streaming/tool-streaming.mdx +2 -2
  151. package/.docs/raw/streaming/workflow-streaming.mdx +5 -11
  152. package/.docs/raw/workflows/error-handling.mdx +1 -0
  153. package/.docs/raw/workflows/human-in-the-loop.mdx +4 -4
  154. package/.docs/raw/workflows/overview.mdx +56 -44
  155. package/.docs/raw/workflows/snapshots.mdx +1 -0
  156. package/.docs/raw/workflows/suspend-and-resume.mdx +85 -16
  157. package/.docs/raw/workflows/time-travel.mdx +313 -0
  158. package/.docs/raw/workflows/workflow-state.mdx +191 -0
  159. package/CHANGELOG.md +16 -0
  160. package/package.json +4 -4
  161. package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +0 -91
  162. package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
  163. package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
@@ -124,12 +124,6 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
124
124
  },
125
125
  ],
126
126
  },
127
- {
128
- name: "tracingContext",
129
- type: "TracingContext",
130
- isOptional: true,
131
- description: "Tracing context for span hierarchy and metadata.",
132
- },
133
127
  {
134
128
  name: "returnScorerData",
135
129
  type: "boolean",
@@ -253,6 +247,17 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
253
247
  },
254
248
  ],
255
249
  },
250
+ {
251
+ parameters: [
252
+ {
253
+ name: "providerOptions",
254
+ type: "ProviderOptions",
255
+ isOptional: true,
256
+ description:
257
+ "Provider-specific options passed to the internal structuring agent. Use this to control model behavior like reasoning effort for thinking models (e.g., `{ openai: { reasoningEffort: 'low' } }`).",
258
+ },
259
+ ],
260
+ },
256
261
  ],
257
262
  },
258
263
  {
@@ -576,6 +581,50 @@ const limitedResult = await agent.generate("Write a short poem about coding", {
576
581
  },
577
582
  ],
578
583
  },
584
+ {
585
+ parameters: [
586
+ {
587
+ name: "requestContextKeys",
588
+ type: "string[]",
589
+ isOptional: true,
590
+ description:
591
+ "Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
592
+ },
593
+ ],
594
+ },
595
+ {
596
+ parameters: [
597
+ {
598
+ name: "traceId",
599
+ type: "string",
600
+ isOptional: true,
601
+ description:
602
+ "Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
603
+ },
604
+ ],
605
+ },
606
+ {
607
+ parameters: [
608
+ {
609
+ name: "parentSpanId",
610
+ type: "string",
611
+ isOptional: true,
612
+ description:
613
+ "Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
614
+ },
615
+ ],
616
+ },
617
+ {
618
+ parameters: [
619
+ {
620
+ name: "tags",
621
+ type: "string[]",
622
+ isOptional: true,
623
+ description:
624
+ "Tags to apply to this trace. String labels for categorizing and filtering traces.",
625
+ },
626
+ ],
627
+ },
579
628
  ],
580
629
  },
581
630
  ]}
@@ -154,6 +154,50 @@ await agent.network(`
154
154
  },
155
155
  ],
156
156
  },
157
+ {
158
+ parameters: [
159
+ {
160
+ name: "requestContextKeys",
161
+ type: "string[]",
162
+ isOptional: true,
163
+ description:
164
+ "Additional RequestContext keys to extract as metadata for this trace. Supports dot notation for nested values (e.g., 'user.id').",
165
+ },
166
+ ],
167
+ },
168
+ {
169
+ parameters: [
170
+ {
171
+ name: "traceId",
172
+ type: "string",
173
+ isOptional: true,
174
+ description:
175
+ "Trace ID to use for this execution (1-32 hexadecimal characters). If provided, this trace will be part of the specified trace.",
176
+ },
177
+ ],
178
+ },
179
+ {
180
+ parameters: [
181
+ {
182
+ name: "parentSpanId",
183
+ type: "string",
184
+ isOptional: true,
185
+ description:
186
+ "Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.",
187
+ },
188
+ ],
189
+ },
190
+ {
191
+ parameters: [
192
+ {
193
+ name: "tags",
194
+ type: "string[]",
195
+ isOptional: true,
196
+ description:
197
+ "Tags to apply to this trace. String labels for categorizing and filtering traces.",
198
+ },
199
+ ],
200
+ },
157
201
  ],
158
202
  },
159
203
  {
@@ -133,6 +133,49 @@ const result = await thread.deleteMessages([
133
133
  // Returns: { success: true, message: "Message deleted successfully" }
134
134
  ```
135
135
 
136
+ ## Working Memory
137
+
138
+ Working memory allows agents to maintain persistent information about users across interactions. It can be scoped to either a specific thread or across all threads for a resource (user).
139
+
140
+ ### Get Working Memory
141
+
142
+ Retrieve the current working memory for a thread:
143
+
144
+ ```typescript
145
+ const workingMemory = await mastraClient.getWorkingMemory({
146
+ agentId: "agent-1",
147
+ threadId: "thread-1",
148
+ resourceId: "user-123", // Optional, required for resource-scoped memory
149
+ });
150
+ ```
151
+
152
+ The response includes:
153
+ - `workingMemory`: The current working memory content (string or null)
154
+ - `source`: Whether the memory is from `"thread"` or `"resource"` scope
155
+ - `workingMemoryTemplate`: The template used for working memory (if configured)
156
+ - `threadExists`: Whether the thread exists
157
+
158
+ ### Update Working Memory
159
+
160
+ Update the working memory content for a thread:
161
+
162
+ ```typescript
163
+ await mastraClient.updateWorkingMemory({
164
+ agentId: "agent-1",
165
+ threadId: "thread-1",
166
+ workingMemory: `# User Profile
167
+ - Name: John Doe
168
+ - Location: New York
169
+ - Preferences: Prefers formal communication
170
+ `,
171
+ resourceId: "user-123", // Optional, required for resource-scoped memory
172
+ });
173
+
174
+ // Returns: { success: true }
175
+ ```
176
+
177
+ **Note:** For resource-scoped working memory, you must provide the `resourceId` parameter. This allows the memory to persist across all conversation threads for that user.
178
+
136
179
  ### Get Memory Status
137
180
 
138
181
  Check the status of the memory system:
@@ -17,7 +17,7 @@ const workflows = await mastraClient.listWorkflows();
17
17
 
18
18
  ## Working with a Specific Workflow
19
19
 
20
- Get an instance of a specific workflow as defined by the const name:
20
+ Get an instance of a specific workflow by its ID:
21
21
 
22
22
  ```typescript title="src/mastra/workflows/test-workflow.ts"
23
23
  export const testWorkflow = createWorkflow({
@@ -26,12 +26,12 @@ export const testWorkflow = createWorkflow({
26
26
  ```
27
27
 
28
28
  ```typescript
29
- const workflow = mastraClient.getWorkflow("testWorkflow");
29
+ const workflow = mastraClient.getWorkflow("city-workflow");
30
30
  ```
31
31
 
32
32
  ## Workflow Methods
33
33
 
34
- ### Get Workflow Details
34
+ ### details()
35
35
 
36
36
  Retrieve detailed information about a workflow:
37
37
 
@@ -39,109 +39,138 @@ Retrieve detailed information about a workflow:
39
39
  const details = await workflow.details();
40
40
  ```
41
41
 
42
- ### Start workflow run asynchronously
42
+ ### createRun()
43
43
 
44
- Start a workflow run with inputData and await full run results:
44
+ Create a new workflow run instance:
45
45
 
46
46
  ```typescript
47
47
  const run = await workflow.createRun();
48
48
 
49
+ // Or with an existing runId
50
+ const run = await workflow.createRun({ runId: "existing-run-id" });
51
+ ```
52
+
53
+ ### startAsync()
54
+
55
+ Start a workflow run and await the full result:
56
+
57
+ ```typescript
58
+ const run = await workflow.createRun();
59
+
60
+ const result = await run.startAsync({
61
+ inputData: {
62
+ city: "New York",
63
+ },
64
+ });
65
+ ```
66
+
67
+ You can also pass `initialState` to set the starting values for the workflow's state:
68
+
69
+ ```typescript
49
70
  const result = await run.startAsync({
50
71
  inputData: {
51
72
  city: "New York",
52
73
  },
74
+ initialState: {
75
+ count: 0,
76
+ items: [],
77
+ },
53
78
  });
54
79
  ```
55
80
 
56
- ### Resume Workflow run asynchronously
81
+ The `initialState` object should match the structure defined in the workflow's `stateSchema`. See [Workflow State](/docs/v1/workflows/workflow-state) for more details.
57
82
 
58
- Resume a suspended workflow step and await full run result:
83
+ ### start()
84
+
85
+ Start a workflow run without waiting for completion:
59
86
 
60
87
  ```typescript
61
88
  const run = await workflow.createRun();
62
89
 
90
+ await run.start({
91
+ inputData: {
92
+ city: "New York",
93
+ },
94
+ });
95
+
96
+ // Poll for results later
97
+ const result = await workflow.runExecutionResult(run.runId);
98
+ ```
99
+
100
+ This is useful for long-running workflows where you want to start execution and check results later.
101
+
102
+ ### resumeAsync()
103
+
104
+ Resume a suspended workflow step and await the full result:
105
+
106
+ ```typescript
107
+ const run = await workflow.createRun({ runId: prevRunId });
108
+
63
109
  const result = await run.resumeAsync({
64
110
  step: "step-id",
65
111
  resumeData: { key: "value" },
66
112
  });
67
113
  ```
68
114
 
69
- ### Resume Workflow
115
+ ### resume()
70
116
 
71
- Resume workflow run:
117
+ Resume a suspended workflow step without waiting for completion:
72
118
 
73
119
  ```typescript
74
- try {
75
- const workflow = mastraClient.getWorkflow("testWorkflow");
120
+ const run = await workflow.createRun({ runId: prevRunId });
76
121
 
77
- const run = await workflow.createRun({ runId: prevRunId });
78
-
79
- run.resume({
80
- step: "step-id",
81
- resumeData: { key: "value" },
82
- });
83
- } catch (e) {
84
- console.error(e);
85
- }
122
+ await run.resume({
123
+ step: "step-id",
124
+ resumeData: { key: "value" },
125
+ });
86
126
  ```
87
127
 
88
- ### Stream Workflow
128
+ ### stream()
89
129
 
90
130
  Stream workflow execution for real-time updates:
91
131
 
92
132
  ```typescript
93
- try {
94
- const workflow = mastraClient.getWorkflow("testWorkflow");
95
-
96
- const run = await workflow.createRun();
133
+ const run = await workflow.createRun();
97
134
 
98
- const stream = await run.stream({
99
- inputData: {
100
- city: "New York",
101
- },
102
- });
135
+ const stream = await run.stream({
136
+ inputData: {
137
+ city: "New York",
138
+ },
139
+ });
103
140
 
104
- for await (const chunk of stream) {
105
- console.log(JSON.stringify(chunk, null, 2));
106
- }
107
- } catch (e) {
108
- console.error("Workflow error:", e);
141
+ for await (const chunk of stream) {
142
+ console.log(JSON.stringify(chunk, null, 2));
109
143
  }
110
144
  ```
111
145
 
112
- ### Get Workflow Run result
146
+ ### runExecutionResult()
113
147
 
114
- Get the result of a workflow run:
148
+ Get the execution result for a workflow run:
115
149
 
116
150
  ```typescript
117
- try {
118
- const workflow = mastraClient.getWorkflow("testWorkflow");
119
-
120
- const run = await workflow.createRun();
121
-
122
- // start the workflow run
123
- const startResult = await run.start({
124
- inputData: {
125
- city: "New York",
126
- },
127
- });
128
-
129
- const result = await workflow.runExecutionResult(run.runId);
130
-
131
- console.log(result);
132
- } catch (e) {
133
- console.error(e);
134
- }
151
+ const result = await workflow.runExecutionResult(runId);
135
152
  ```
136
153
 
137
- This is useful when dealing with long running workflows. You can use this to poll the result of the workflow run.
138
-
139
- ### Workflow run result
154
+ <h3>Run result format</h3>
140
155
 
141
156
  A workflow run result yields the following:
142
157
 
143
- | Field | Type | Description |
144
- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
145
- | `payload` | `{currentStep?: {id: string, status: string, output?: Record<string, any>, payload?: Record<string, any>}, workflowState: {status: string, steps: Record<string, {status: string, output?: Record<string, any>, payload?: Record<string, any>}>}}` | The current step and workflow state of the run |
146
- | `eventTimestamp` | `Date` | The timestamp of the event |
147
- | `runId` | `string` | Unique identifier for this workflow run instance |
158
+ <PropertiesTable
159
+ content={[
160
+ {
161
+ name: "runId",
162
+ type: "string",
163
+ description: "Unique identifier for this workflow run instance",
164
+ },
165
+ {
166
+ name: "eventTimestamp",
167
+ type: "Date",
168
+ description: "The timestamp of the event",
169
+ },
170
+ {
171
+ name: "payload",
172
+ type: "object",
173
+ description: "Contains currentStep (id, status, output, payload) and workflowState (status, steps record)",
174
+ },
175
+ ]}
176
+ />
@@ -9,12 +9,11 @@ The `NetlifyDeployer` class handles deployment of standalone Mastra applications
9
9
 
10
10
  ## Usage example
11
11
 
12
- ```typescript title="src/mastra/index.ts" showLineNumbers copy
12
+ ```typescript title="src/mastra/index.ts" copy
13
13
  import { Mastra } from "@mastra/core";
14
14
  import { NetlifyDeployer } from "@mastra/deployer-netlify";
15
15
 
16
16
  export const mastra = new Mastra({
17
- // ...
18
17
  deployer: new NetlifyDeployer(),
19
18
  });
20
19
  ```