December 10, 2025
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Fix type safety for message ordering - restrict orderBy to only accept 'createdAt' field (#11069)
Messages don't have an updatedAt field, but the previous type allowed ordering by it, which would return empty results. This change adds compile-time type safety by making StorageOrderBy generic and restricting StorageListMessagesInput.orderBy to only accept 'createdAt'. The API validation schemas have also been updated to reject invalid orderBy values at runtime.
Loosen tools types in processInputStep / prepareStep. (#11071)
Added the ability to provide a base path for Mastra Studio. (#10441)
import { Mastra } from '@mastra/core';
export const mastra = new Mastra({
server: {
studioBase: '/my-mastra-studio',
},
});
This will make Mastra Studio available at http://localhost:4111/my-mastra-studio.
Expand processInputStep processor method and integrate prepareStep as a processor (#10774)
New Features:
prepareStep callback now runs through the standard processInputStep pipelinemodel, tools, toolChoice, activeTools, messages, systemMessages, providerOptions, modelSettings, and structuredOutputBreaking Change:
prepareStep messages format changed from AI SDK v5 model messages to MastraDBMessage formatmessageList.get.all.aiV5.model() if you need the old formatMultiple Processor improvements including: (#10947)
processOutputStep added which runs after every step.What's new:
1. Retry mechanism with LLM feedback - Processors can now request retries with feedback that gets sent back to the LLM:
processOutputStep: async ({ text, abort, retryCount }) => {
if (isLowQuality(text)) {
abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
}
return [];
};
Configure with maxProcessorRetries (default: 3). Rejected steps are preserved in result.steps[n].tripwire. Retries are only available in processOutputStep and processInputStep. It will replay the step with additional context added.
2. Workflow orchestration for processors - Processors can now be composed using workflow primitives:
import { createStep, createWorkflow } from '@mastra/core/workflows';
import {
ProcessorStepSchema,
} from '@mastra/core/processors';
const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
.then(createStep(new lengthValidator({...})))
.parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
.commit();
const agent = new Agent({ inputProcessors: [moderationWorkflow] });
Every processor array that gets passed to an agent gets added as a workflow <img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
3. Extended tripwire API - abort() now accepts options for retry control and typed metadata:
abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
4. New processOutputStep method - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
5. Workflow tripwire status - Workflows now have a 'tripwire' status distinct from 'failed', properly bubbling up processor rejections.
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Fix type safety for message ordering - restrict orderBy to only accept 'createdAt' field (#11069)
Messages don't have an updatedAt field, but the previous type allowed ordering by it, which would return empty results. This change adds compile-time type safety by making StorageOrderBy generic and restricting StorageListMessagesInput.orderBy to only accept 'createdAt'. The API validation schemas have also been updated to reject invalid orderBy values at runtime.
Support new Workflow tripwire run status. Tripwires that are thrown from within a workflow will now bubble up and return a graceful state with information about tripwires. (#10947)
When a workflow contains an agent step that triggers a tripwire, the workflow returns with status: 'tripwire' and includes tripwire details:
const run = await workflow.createRun();
const result = await run.start({ inputData: { message: 'Hello' } });
if (result.status === 'tripwire') {
console.log('Workflow terminated by tripwire:', result.tripwire?.reason);
console.log('Processor ID:', result.tripwire?.processorId);
console.log('Retry requested:', result.tripwire?.retry);
}
Adds new UI state for tripwire in agent chat and workflow UI.
This is distinct from status: 'failed' which indicates an unexpected error. A tripwire status means a processor intentionally stopped execution (e.g., for content moderation).
Allow to run mastra studio from anywhere in the file system, and not necessarily inside a mastra project (#11067)
Make sure to verify that a mastra instance is running on server.port OR 4111 by default (#11066)
Internal changes to enable a custom base path for Mastra Studio (#10441)
Fetched April 7, 2026