2025-10-08
Workflows now support global state, you can now read state in each of your defined steps and set it withsetState. This makes it easier to manage state over multiple steps nstead of passing it through input/output variables.
const firstStep = createStep({
id: "first-step",
execute({ setState }) {
setState({
myValue: "a value",
});
},
});
const secondStep = createStep({
id: "second-step",
execute({ state }) {
console.log(state.myValue);
},
});
createWorkflow({
id: "my-worfklow",
stateSchema: z.object({
myValue: z.string(),
}),
}).then(myStep);
Working memory can be stored using thread metadata. It allows you to set the initial wokring memory directly.
const thread = await memory.createThread({
threadId: "thread-123",
resourceId: "user-456",
title: "Medical Consultation",
metadata: {
workingMemory: `# Patient Profile
- Name: John Doe
- Blood Type: O+
- Allergies: Penicillin
- Current Medications: None
- Medical History: Hypertension (controlled)`,
},
});
Improved useChat support from ai-sdk if you're using agents in your tools. You get a custom UI message called data-tool-agent with all relevant information.
// in src/mastra.ts
export const mastra = new Mastra({
server: {
apiRoutes: [
chatRoute({
path: "/chat",
agent: "my-agent",
}),
],
},
});
// in my useChat file
const { error, status, sendMessage, messages, regenerate, stop } =
useChat<MyMessage>({
transport: new DefaultChatTransport({
api: 'http://localhost:4111/chat',
body: {
}
}),
});
return (
<div className="flex flex-col pt-24 mx-auto w-full max-w-4xl h-screen">
<div className="flex flex-row mx-auto w-full overflow-y-auto gap-4">
<div className="flex-1">
{messages.map(message => {
return (
<div key={message.id} className="whitespace-pre-wrap">
{message.role === 'user' ? 'User: ' : 'AI: '}{' '}
{message.parts
.filter(part => part.type === 'data-tool-agent')
.map((part) => {
return <CustomWidget key={part.id} {...part.data} />
})}
{message.parts
.filter(part => part.type === 'text')
.map((part, index) => {
if (part.type === 'text') {
return <div key={index}>{part.text}</div>;
}
})
}
)
}}
</div>
</div>
</div>
)
Fix TypeScript errors with provider-defined tools by updating ai-v5 and openai-v5 to matching provider-utils versions. This ensures npm deduplicates to a single provider-utils instance, resolving type incompatibility issues when passing provider tools to Agent.
Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import. (#8584)
chromadb@^3.0.17 ↗︎ (from ^3.0.15, in dependencies) (#8554)workflow run thread more visible (#8539)
Add iterationCount to loop condition params (#8579)
Mutable shared workflow run state (#8545)
avoid refetching memory threads and messages on window focus (#8519)
add tripwire reason in playground (#8568)
Add validation for index creation (#8552)
Save waiting step status in snapshot (#8576)
Added AI SDK provider packages to model router for anthropic/google/openai/openrouter/xai (#8559)
type fixes and missing changeset (#8545)
Convert WorkflowWatchResult to WorkflowResult in workflow graph (#8541)
add new deploy to cloud button (#8549)
remove icons in entity lists (#8520)
add client search to all entities (#8523)
Improve JSDoc documentation for Agent (#8389)
Properly fix cloudflare randomUUID in global scope issue (#8450)
Marked OTEL based telemetry as deprecated. (#8586)
Add support for streaming nested agent tools (#8580)
Fix TypeScript errors with provider-defined tools by updating ai-v5 and openai-v5 to matching provider-utils versions. This ensures npm deduplicates to a single provider-utils instance, resolving type incompatibility issues when passing provider tools to Agent.
Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import. (#8584)
UX for the agents page (#8517)
add icons into playground titles + a link to the entity doc (#8518)
fix: custom API routes now properly respect authentication requirements
Fixed a critical bug where custom routes were bypassing authentication when they should have been protected by default. The issue was in the isProtectedPath function which only checked pattern-based protection but ignored custom route configurations.
requiresAuth: trueCustom routes properly inherit protection from parent patterns (like /api/*)
Routes with explicit requiresAuth: false continue to work as public endpoints
Enhanced isProtectedPath to consider both pattern matching and custom route auth config
This fixes issue #8421 where custom routes were not being properly protected by the authentication system. (#8469)
Correctly handle errors in streams. Errors (e.g. rate limiting) before the stream begins are now returned with their code. Mid-stream errors are passed as a chunk (with type: 'error') to the stream. (#8567)
Mutable shared workflow run state (#8545)
Fix bug when lodash dependencies where used in subdependencies (#8537)
@aws-sdk/client-dynamodb@^3.902.0 ↗︎ (from ^3.896.0, in dependencies)@aws-sdk/lib-dynamodb@^3.902.0 ↗︎ (from ^3.896.0, in dependencies) (#8436)langsmith@>=0.3.72 ↗︎ (from >=0.3.71, in dependencies) (#8560)Ensure working memory can be updated througb createThread and updateThread (#8513)
Fix TypeScript errors with provider-defined tools by updating ai-v5 and openai-v5 to matching provider-utils versions. This ensures npm deduplicates to a single provider-utils instance, resolving type incompatibility issues when passing provider tools to Agent.
Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import. (#8584)
@aws-sdk/client-s3vectors@^3.901.0 ↗︎ (from ^3.896.0, in dependencies) (#8436)Mutable shared workflow run state (#8545)
Fix TypeScript errors with provider-defined tools by updating ai-v5 and openai-v5 to matching provider-utils versions. This ensures npm deduplicates to a single provider-utils instance, resolving type incompatibility issues when passing provider tools to Agent.
Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import. (#8584)
Fetched April 7, 2026