mastra-ai/mastra · error · MastraError

PROCESSOR_MISSING_MESSAGE_LIST

PROCESSOR_MISSING_MESSAGE_LIST

Error message

Processor ${processor.id} requires messageList or messages for processInput phase

What it means

A processor implementing processInput was attached to a workflow step, but no MessageList was available in the pass-through context. processInput operates on the conversation's messages, so the workflow requires a messageList (or messages) to hand to the processor. Missing it means the processor has nothing to process, so the library fails fast with a USER-category MastraError.

Source

Thrown at packages/core/src/workflows/workflow.ts:1077

          return result;
        } catch (error) {
          // TripWire errors should end span but bubble up to halt the workflow
          if (error instanceof TripWire) {
            processorSpan?.end({ output: { tripwire: error.message } });
          } else {
            processorSpan?.error({ error: error as Error, endSpan: true });
          }
          throw error;
        }
      };

      // Execute the phase with span lifecycle management
      return executePhaseWithSpan(async () => {
        switch (phase) {
          case 'input': {
            if (processor.processInput) {
              if (!passThrough.messageList) {
                throw new MastraError({
                  category: ErrorCategory.USER,
                  domain: ErrorDomain.MASTRA_WORKFLOW,
                  id: 'PROCESSOR_MISSING_MESSAGE_LIST',
                  text: `Processor ${processor.id} requires messageList or messages for processInput phase`,
                });
              }

              // Extract messageList after null check for proper type narrowing
              const checkedMessageList = passThrough.messageList;

              // Create source checker before processing to preserve message sources
              const idsBeforeProcessing = (messages as MastraDBMessage[]).map(m => m.id);
              const check = checkedMessageList.makeMessageSourceChecker();

              const result = await processor.processInput({
                ...baseContext,
                messages: messages as MastraDBMessage[],
                messageList: checkedMessageList,

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Provide a messageList (or messages array) in the step/resume input.
  2. Only attach processInput-capable processors to steps that carry message context.
  3. Use processOutputResult/processInputStep only in phases with messages, or drop the phase from the processor.
  4. Pass raw messages; the library wraps them into a MessageList.

Example fix

// before
await step.run({ someData: 1 });
// after
await step.run({ messages: [{ role: 'user', content: 'hello' }] });
Defensive patterns

Strategy: validation

Validate before calling

if (processor.processInput && !input.messageList && !input.messages) {
  throw new Error('Step with processInput processor requires messages or messageList');
}

Type guard

function hasMessageContext(i: unknown): i is { messageList?: MessageList; messages?: unknown[] } {
  return typeof i === 'object' && i !== null && ('messageList' in i || 'messages' in i);
}

Try / catch

try {
  await step.run(input);
} catch (e) {
  if (e instanceof MastraError && e.id === 'PROCESSOR_MISSING_MESSAGE_LIST') {
    await step.run({ ...input, messages: [{ role: 'user', content: String(input) }] });
  } else throw e;
}

Prevention

When it happens

Trigger: Using workflow.createStepFromProcessor / step() with a processor that defines processInput, while the step input contains neither messageList nor messages (e.g. resuming a step with arbitrary data instead of message context).

Common situations: Wiring an agent-style message processor into a plain data-transformation workflow; resuming a workflow with resumeData that lacks message context; version changes where messages are no longer auto-converted into a MessageList.

Related errors


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