mastra-ai/mastra · error · HTTPException
Processor does not support input phase
Error message
Processor does not support input phase
What it means
The processor test/exec endpoint dispatches to a phase method on the target processor. When the requested phase is 'input' but the processor class does not implement processInput, the server rejects with HTTP 400 instead of calling an undefined method. It signals a phase/processor capability mismatch, not a runtime failure inside the processor.
Source
Thrown at packages/server/src/server/handlers/processors.ts:408
};
// Build the context based on phase
const baseContext = {
abort,
retryCount: 0,
messages: messageList.get.all.db(),
messageList,
state: {},
};
try {
let result: any;
// Execute the specific phase method on the individual processor
switch (phase) {
case 'input':
if (!processor.processInput) {
throw new HTTPException(400, { message: 'Processor does not support input phase' });
}
result = await processor.processInput({
...baseContext,
systemMessages: [],
});
break;
case 'inputStep':
if (!processor.processInputStep) {
throw new HTTPException(400, { message: 'Processor does not support inputStep phase' });
}
result = await processor.processInputStep({
...baseContext,
systemMessages: [],
stepNumber: 0,
steps: [],
// Pass empty/default values for all inputStep fields
model: '' as any,View on GitHub (pinned to 75dd419e61)
Solutions
- Request a phase the processor actually implements; check the processor class for processInput/processInputStep/processOutput/processOutputStep/processOutputResult.
- Implement processInput on the processor if input-phase behavior is intended.
- Update the calling UI/tool to introspect supported phases before invoking the execute endpoint.
Example fix
// before
await fetch(`/api/processors/${id}/execute`, { method: 'POST', body: JSON.stringify({ phase: 'input', messages }) });
// after
const phases = processorSupportsInput(id) ? ['input'] : ['output'];
await fetch(`/api/processors/${id}/execute`, { method: 'POST', body: JSON.stringify({ phase: phases[0], messages }) }); Defensive patterns
Strategy: validation
Validate before calling
const INPUT_PHASE_PROCS = new Set(['MyInputProc']); // or introspect class methods
if (!INPUT_PHASE_PROCS.has(processorName)) throw new Error(`${processorName} does not implement processInput`); Type guard
function supportsInput(p: any): p is { processInput: Function } {
return typeof p?.processInput === 'function';
} Try / catch
try {
await exec(id, 'input', ctx);
} catch (e) {
if (e instanceof HTTPException && e.status === 400 && /does not support input phase/.test(e.message)) {
return exec(id, 'output', ctx); // fall back to an implemented phase
}
throw e;
} Prevention
- Derive the phase selector UI from the processor's implemented methods, not a static list.
- Check Mastra processor docs for which lifecycle hooks your processor class implements.
- Cover phase capability in unit tests for custom processors.
When it happens
Trigger: POST to the processor execute endpoint with body/query phase='input' for a registered processor whose class lacks a processInput method (e.g. an output-only processor like a OutputProcessor subclass).
Common situations: Developers testing an output-only processor against the input phase from the playground; generic tooling that iterates all phases for every processor; processors migrated from older APIs where a single method handled all phases.
Related errors
- Processor does not support inputStep phase
- Processor does not support outputResult phase
- Processor does not support outputStep phase
- outputStream phase cannot be executed directly. Use streamin
- Unknown phase: ${phase}
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/6f24572b6b2e57c8.
Report an issue: GitHub.