{"record":{"id":"55ba9f4c2edbd4da","repo":"mastra-ai/mastra","slug":"error-executing-processor-workflow-error-messag","errorCode":null,"errorMessage":"Error executing processor workflow: ${error.message}","messagePattern":"Error executing processor workflow: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/processors.ts","lineNumber":373,"sourceCode":"            } else if ('messageList' in output && output.messageList instanceof MessageList) {\n              outputMessages = output.messageList.get.all.db();\n            }\n          }\n\n          return {\n            success: true,\n            phase,\n            messages: outputMessages,\n            messageList: {\n              messages: outputMessages,\n            },\n          };\n        } catch (error: any) {\n          // Re-throw HTTP exceptions\n          if (error instanceof HTTPException) {\n            throw error;\n          }\n          throw new HTTPException(500, {\n            message: `Error executing processor workflow: ${error.message}`,\n          });\n        }\n      }\n\n      // Handle individual processor execution\n      // Create the abort function for tripwire support\n      let tripwireTriggered = false;\n      let tripwireReason: string | undefined;\n      let tripwireMetadata: unknown;\n\n      const abort = (reason?: string, options?: { retry?: boolean; metadata?: unknown }) => {\n        tripwireTriggered = true;\n        tripwireReason = reason;\n        tripwireMetadata = options?.metadata;\n        throw new Error(`TRIPWIRE:${reason || 'Processor aborted'}`);\n      };\n","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/processors.ts#L355-L391","documentation":"This HTTP 500 wraps any unexpected exception thrown while starting/running a workflow processor's run inside the execute endpoint. HTTPExceptions are re-thrown as-is; everything else is converted, so the original error text appears after the 'Error executing processor workflow:' prefix.","triggerScenarios":"POST /processors/:id/execute on a workflow processor where `processor.createRun()` or `run.start({ inputData })` throws — e.g. invalid inputData shape rejected by a step's schema, a bug in a step function, or an unhandled rejection in processor setup.","commonSituations":"Processor step assumes fields the execute endpoint's synthetic context leaves empty (model: '', steps: []); zod validation failure in a step's inputSchema; async network call inside a step failing; type errors from passing a MessageList where a plain array is expected.","solutions":["Read the wrapped `error.message` in the response to identify the original failure.","Add try/catch inside the processor's step and log/normalize errors before they bubble up.","Make the step tolerant of the minimal inputData the execute endpoint constructs (empty model, empty steps).","Test the processor step directly with a unit test using the same phase-specific inputData shape."],"exampleFix":"// before\nconst result = await processor.processInput({ messages });\n// after\ntry {\n  const result = await processor.processInput({ messages });\n} catch (err) {\n  logger.error('processor step failed', err);\n  throw new Tripwire('processing unavailable');\n}","handlingStrategy":"try-catch","validationCode":"const detail = await fetch(`/api/processors/${processorId}`).then(r => r.json());\nif (!detail.isWorkflow) {\n  throw new Error('This endpoint executes workflow processors via createRun; confirm the processor type');\n}","typeGuard":"function isHttpWrappedError(msg: string): boolean {\n  return msg.startsWith('Error executing processor workflow:');\n}","tryCatchPattern":"try {\n  const res = await fetch(url, options);\n  if (!res.ok) {\n    const { message } = await res.json();\n    if (isHttpWrappedError(message)) {\n      const original = message.replace('Error executing processor workflow: ', '');\n      console.error('Underlying processor error:', original);\n    }\n    throw new Error(message);\n  }\n  return await res.json();\n} catch (e) {\n  console.error(e);\n  throw e;\n}","preventionTips":["Add try/catch and logging inside processor step functions so failures are diagnosable.","Test steps in isolation against the synthetic context (empty model, empty steps) the execute endpoint builds.","Validate step input/output schemas with zod to fail fast with clear messages.","Keep processor dependencies (network, models) mocked or resilient in server-side execution."],"tags":["mastra-server","workflow","processor","http-500","unhandled-exception"],"backgroundTag":"workflow-execution-failed","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}