{"record":{"id":"668bd7c3f77cd9f5","repo":"ruvnet/ruflo","slug":"nested-workflow-failed","errorCode":null,"errorMessage":"Nested workflow failed","messagePattern":"Nested workflow failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/src/task-execution/application/WorkflowEngine.ts","lineNumber":397,"sourceCode":"      // Check if paused\n      while (execution.state.status === 'paused') {\n        await new Promise(resolve => setTimeout(resolve, 100));\n      }\n\n      if (execution.state.status === 'cancelled') {\n        break;\n      }\n\n      execution.state.currentTask = task.id;\n\n      const startTime = Date.now();\n\n      try {\n        // Handle nested workflows\n        if (task.isWorkflow() && task.workflow) {\n          const nestedResult = await this.executeWorkflow(task.workflow);\n          if (nestedResult.status === 'failed') {\n            throw new Error(`Nested workflow failed`);\n          }\n        } else {\n          // Get assigned agent or distribute\n          let agentId = task.assignedTo;\n          if (!agentId) {\n            const agents = await this.coordinator.listAgents();\n            const suitable = agents.find(a => a.canExecute(task.type));\n            agentId = suitable?.id;\n          }\n\n          if (!agentId) {\n            throw new Error(`No agent available for task ${task.id}`);\n          }\n\n          const result = await this.executeTask(task, agentId);\n          if (result.status === 'failed') {\n            throw new Error(result.error || 'Task execution failed');\n          }","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/src/task-execution/application/WorkflowEngine.ts#L379-L415","documentation":"During runWorkflow, a task that wraps a nested workflow was executed and executeWorkflow() returned status 'failed'. The parent task propagates the child workflow's failure as its own error; the root cause lives in the nested workflow's execution (its own event log holds the detail).","triggerScenarios":"Thrown at v3/src/task-execution/application/WorkflowEngine.ts:397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the nested workflow's error for the root cause; fix the child workflow definition or inputs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}