{"record":{"id":"dbbe77713640aa89","repo":"mastra-ai/mastra","slug":"forecast-data-not-found","errorCode":null,"errorMessage":"Forecast data not found","messagePattern":"Forecast data not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent-builder/src/defaults.ts","lineNumber":341,"sourceCode":"    };\n\n    return forecast;\n  },\n});\n\nconst planActivities = createStep({\n  id: 'plan-activities',\n  description: 'Suggests activities based on weather conditions',\n  inputSchema: forecastSchema,\n  outputSchema: z.object({\n    activities: z.string(),\n  }),\n  execute: async (inputData, context) => {\n    const mastra = context?.mastra;\n    const forecast = inputData;\n\n    if (!forecast) {\n      throw new Error('Forecast data not found');\n    }\n\n    const agent = mastra?.getAgent('weatherAgent');\n    if (!agent) {\n      throw new Error('Weather agent not found');\n    }\n\n    const prompt = \\${weatherWorkflowPrompt}\n\n    const response = await agent.stream([\n      {\n        role: 'user',\n        content: prompt,\n      },\n    ]);\n\n    let activitiesText = '';\n","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/agent-builder/src/defaults.ts#L323-L359","documentation":"The default workflow step that consumes the forecast (and hands it to the weather agent) throws 'Forecast data not found' when its inputData is falsy. The step expects the previous weather step's output (forecastSchema) to be delivered as inputData; a missing input means the upstream step did not run or its output was not mapped.","triggerScenarios":"Running the second workflow step when the preceding weather tool step was skipped/failed without stopping the workflow, the step input mapping is broken, or the workflow is started with an empty trigger so the forecast-producing step produced no output for this step.","commonSituations":"Editing the default weather workflow and rewiring step variables incorrectly; a weather step error swallowed upstream so the downstream step receives undefined; replaying/inspecting steps in Studio out of order.","solutions":["Ensure the forecast-producing step runs successfully before this step (check its status/output in Studio or run logs)","Fix the step's variable mapping so it reads the previous step's output (context.getStepResult(...))","Make the upstream step's failure fail the workflow instead of continuing to this step","Pass the forecast explicitly if invoking this step's execute in tests: execute({ inputData: forecast, context })"],"exampleFix":"// before\nconst forecast = context.getStepResult<{ summary: string }>('missingStepName');\n\n// after\nconst forecast = context.getStepResult<WeatherForecast>(forecastStepId);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"const run = await mastra.getWorkflow('weatherWorkflow').start({ triggerData: { city } });\ntry {\n  // ... observe downstream steps\n} catch (e) {\n  if (e instanceof Error && e.message === 'Forecast data not found') {\n    // check the upstream forecast step's status/output before retrying\n  } else throw e;\n}","preventionTips":["Map downstream step inputs from the correct upstream step id","Configure upstream failures to abort the workflow so steps don't run with undefined inputs","Inspect step output in Studio when editing the default weather workflow"],"tags":["workflow","input-validation","data-mapping"],"backgroundTag":"missing-required-input","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}