mastra-ai/mastra · error · HTTPException

Processor does not support inputStep phase

Error message

Processor does not support inputStep phase

What it means

Same dispatch pattern as the input phase, but for 'inputStep': if the processor does not implement processInputStep, the server throws HTTP 400. inputStep is an agentic-loop hook (per model step), so most simple processors do not implement it.

Source

Thrown at packages/server/src/server/handlers/processors.ts:418

      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,
              tools: {},
              toolChoice: undefined,
              activeTools: [],
              providerOptions: undefined,
              modelSettings: undefined,
              structuredOutput: undefined,
            });
            break;

          case 'outputResult':

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Execute a phase implemented by this processor (e.g. 'input' or 'output').
  2. Add a processInputStep method to the processor if per-step interception is required.
  3. Gate the phase selector on the processor's declared supported phases.

Example fix

// before
await executeProcessor(id, 'inputStep', context);
// after
if (typeof processor.processInputStep === 'function') {
  await executeProcessor(id, 'inputStep', context);
}
Defensive patterns

Strategy: validation

Validate before calling

if (phase === 'inputStep' && typeof processorRef.processInputStep !== 'function') {
  throw new Error('Processor does not implement processInputStep');
}

Type guard

function supportsInputStep(p: any): p is { processInputStep: Function } {
  return typeof p?.processInputStep === 'function';
}

Try / catch

try {
  await exec(id, 'inputStep', ctx);
} catch (e) {
  if (e instanceof HTTPException && e.status === 400 && e.message.includes('inputStep')) {
    console.warn(`${id} lacks inputStep; skipping`);
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: Executing phase='inputStep' against a processor without a processInputStep method via the processor execute handler in packages/server/src/server/handlers/processors.ts.

Common situations: Testing step-level hooks on plain transformers; UIs that blanket-execute every phase; assuming all Processor classes implement the full step lifecycle.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/6ac7bf979e8c7c15. Report an issue: GitHub.