{"record":{"id":"07b611ef28c44780","repo":"ruvnet/ruflo","slug":"task-step-step-stepid-requires-config-agentid-o","errorCode":null,"errorMessage":"task step ${step.stepId} requires config.agentId or workflow.variables.defaultAgentId","messagePattern":"task step (.+?) requires config\\.agentId or workflow\\.variables\\.defaultAgentId","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/workflow-tools.ts","lineNumber":355,"sourceCode":"          workflow.status = 'failed';\n          saveWorkflowStore(store);\n          break;\n        }\n\n        const step = workflow.steps[i];\n        step.status = 'running';\n        step.startedAt = new Date().toISOString();\n        const stepStart = Date.now();\n        saveWorkflowStore(store);\n\n        let stepEntry: typeof stepResults[number] = { stepId: step.stepId, type: step.type, status: 'running' };\n\n        try {\n          if (step.type === 'task') {\n            const cfg = step.config as Record<string, unknown>;\n            const agentId = (cfg.agentId as string) || (workflow.variables.defaultAgentId as string);\n            const promptTpl = (cfg.prompt as string) || step.name;\n            if (!agentId) throw new Error(`task step ${step.stepId} requires config.agentId or workflow.variables.defaultAgentId`);\n            const prompt = interp(promptTpl);\n            const result = await executeAgentTask({\n              agentId,\n              prompt,\n              systemPrompt: cfg.systemPrompt ? interp(String(cfg.systemPrompt)) : undefined,\n              maxTokens: cfg.maxTokens as number | undefined,\n              temperature: cfg.temperature as number | undefined,\n              timeoutMs: cfg.timeoutMs as number | undefined,\n            });\n            if (!result.success) throw new Error(result.error || 'agent_execute failed');\n            step.result = result;\n            workflow.variables[`${step.stepId}.output`] = result.output;\n            workflow.variables.lastStepOutput = result.output;\n            stepEntry = { stepId: step.stepId, type: 'task', status: 'completed', durationMs: result.durationMs, output: result.output };\n          } else if (step.type === 'wait') {\n            const cfg = step.config as Record<string, unknown>;\n            const ms = Math.min(Math.max(0, (cfg.ms as number) || 0), 60000);\n            await new Promise(r => setTimeout(r, ms));","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/mcp-tools/workflow-tools.ts#L337-L373","documentation":"Error \"task step ${step.stepId} requires config.agentId or workflow.variables.defaultAgentId\" thrown in ruvnet/ruflo.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/mcp-tools/workflow-tools.ts:355 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}