conductor-oss/conductor · warning · IllegalStateException
No pending HUMAN task found in execution {executionId}
Error message
No pending HUMAN task found in execution {executionId} What it means
Thrown by AgentService.respond when no HUMAN-type task in IN_PROGRESS status is found in the execution. respond() is the human-in-the-loop (HITL) response endpoint — it searches the workflow's task list for a pending HUMAN task to complete with the human's output. If none exists, the execution is not currently waiting for human input. IllegalStateException maps to HTTP 409/422 depending on the controller mapping — it indicates a state precondition failure.
Source
Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java:1257
return streamRegistry.register(executionId, lastEventId);
}
/** Respond to a pending HITL task in an agent execution. */
public void respond(String executionId, Map<String, Object> output) {
log.info("Responding to execution {}: {}", executionId, output);
// Find the pending task (HUMAN type, IN_PROGRESS status)
Workflow workflow = workflowService.getExecutionStatus(executionId, true);
Task pendingTask = null;
for (Task task : workflow.getTasks()) {
if ("HUMAN".equals(task.getTaskType()) && task.getStatus() == Task.Status.IN_PROGRESS) {
pendingTask = task;
break;
}
}
if (pendingTask == null) {
throw new IllegalStateException(
"No pending HUMAN task found in execution " + executionId);
}
// Update the task with the human's response
TaskResult taskResult = new TaskResult();
taskResult.setTaskId(pendingTask.getTaskId());
taskResult.setWorkflowInstanceId(executionId);
taskResult.setStatus(TaskResult.Status.COMPLETED);
Map<String, Object> outputData =
new LinkedHashMap<>(
pendingTask.getOutputData() != null
? pendingTask.getOutputData()
: Map.of());
outputData.putAll(output);
taskResult.setOutputData(outputData);
taskService.updateTask(taskResult);
log.info(
"Completed HUMAN task {} in execution {}",View on GitHub (pinned to cf7c3e4a8a)
Solutions
- Check getStatus() and verify there is a pending HUMAN task before calling respond().
- Guard against double-submit in the UI (disable the submit button after first click).
- Catch IllegalStateException and treat it as a no-op if the HITL task was already completed.
- Confirm the pending tool type via getStatus().pendingTool before responding.
Example fix
// before
agentService.respond(executionId, Map.of("answer", "yes"));
// after
AgentStatusResponse status = agentService.getStatus(executionId);
if (status.isWaiting() && "HUMAN".equals(status.getPendingToolType())) {
agentService.respond(executionId, Map.of("answer", "yes"));
} else {
log.info("No pending HITL task for {}, skipping respond", executionId);
} Defensive patterns
Strategy: validation
Validate before calling
AgentStatusResponse status = agentService.getStatus(executionId);
if (!status.isWaiting()
|| !"HUMAN".equals(status.getPendingToolType())) {
return ResponseEntity.status(409)
.body("No pending HITL task in execution " + executionId);
}
agentService.respond(executionId, output); Try / catch
try {
agentService.respond(executionId, output);
} catch (IllegalStateException e) {
if (e.getMessage().contains("No pending HUMAN task")) {
// HITL task already completed or not yet scheduled
log.info("No pending HITL task for {}", executionId);
return ResponseEntity.noContent().build();
}
throw e;
} Prevention
- Check getStatus() for a pending HUMAN task before calling respond().
- Disable the submit button in the UI after the first click to prevent double-submit.
- Treat 'no pending HUMAN task' as a benign no-op if the response was already submitted.
When it happens
Trigger: Calling respond() on an execution that has no active HITL task (the agent is mid-LLM-call or between tool calls); the HUMAN task was already completed by a prior respond call; calling respond on a terminal execution; the pending task is PULL_WORKFLOW_MESSAGES (not HUMAN) but the caller assumed HITL.
Common situations: Double-submit of a HITL response (user clicks twice); UI polls and submits before the HUMAN task is actually scheduled; the agent moved past the HITL point due to a timeout; caller confuses a PULL_WORKFLOW_MESSAGES wait with a HUMAN task wait.
Related errors
- Registered agent definition is missing metadata.agentDef: ${
- ${e.message}
- Skill registry is not available
- Invalid / Unsupported sink specified: %s
- Error loading queue: %s, for task: %s, error: %s
AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14).
Data as JSON: /api/errors/b1a3b2cdfc63a65a.
Report an issue: GitHub.