MastraM
Mastra•18h ago
tinchoz49

Workflow error using .map after .foreach

The .map step throws a zod validation error if use it after a .foreach

dependencies
"@mastra/core": "1.0.0-beta.13",
"@mastra/evals": "1.0.0-beta.2",
"@mastra/loggers": "1.0.0-beta.3",
"@mastra/memory": "1.0.0-beta.6",
"@mastra/observability": "1.0.0-beta.4",
"@mastra/pg": "1.0.0-beta.8",
"@mastra/server": "1.0.0-beta.11"
"mastra": "^1.0.0-beta.9"


{
  "message": "Step input validation failed: \n- : Invalid input: expected object, received array",
  "domain": "MASTRA_WORKFLOW",
  "category": "USER",
  "code": "WORKFLOW_STEP_INPUT_VALIDATION_FAILED",
  "details": {},
  "cause": {
    "message": "[\n  {\n    \"expected\": \"object\",\n    \"code\": \"invalid_type\",\n    \"path\": [],\n    \"message\": \"Invalid input: expected object, received array\"\n  }\n]",
    "name": "ZodError"
  }
}
Was this page helpful?