ruvnet/ruflo · error · Error

No agent available for task ${task.id}

Error message

No agent available for task ${task.id}

What it means

runWorkflow reached a task that has no assignedTo agent and the coordinator's listAgents() yielded no agent able to execute the task type. The task cannot be dispatched to anyone, so the workflow aborts at that task — a scheduling/capacity failure, not a task-logic failure.

Source

Thrown at v3/src/task-execution/application/WorkflowEngine.ts:409

      try {
        // Handle nested workflows
        if (task.isWorkflow() && task.workflow) {
          const nestedResult = await this.executeWorkflow(task.workflow);
          if (nestedResult.status === 'failed') {
            throw new Error(`Nested workflow failed`);
          }
        } else {
          // Get assigned agent or distribute
          let agentId = task.assignedTo;
          if (!agentId) {
            const agents = await this.coordinator.listAgents();
            const suitable = agents.find(a => a.canExecute(task.type));
            agentId = suitable?.id;
          }

          if (!agentId) {
            throw new Error(`No agent available for task ${task.id}`);
          }

          const result = await this.executeTask(task, agentId);
          if (result.status === 'failed') {
            throw new Error(result.error || 'Task execution failed');
          }
        }

        const endTime = Date.now();
        execution.taskTimings[task.id] = {
          start: startTime,
          end: endTime,
          duration: endTime - startTime
        };

        completedTasks.add(task.id);
        execution.state.completedTasks.push(task.id);
        execution.executionOrder.push(task.id);

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Spawn or register an agent with the capabilities required by the task before scheduling it.
  2. Relax the task's capability requirements or queue it until a matching agent becomes available.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at v3/src/task-execution/application/WorkflowEngine.ts:409 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/cb35cbc587180856. Report an issue: GitHub.