conductor-oss/conductor · warning · NotFoundException

No agent execution found: ${executionId}

Error message

No agent execution found: ${executionId}

What it means

Thrown by AgentService.stopAgent when executionDAO.getWorkflow(executionId, false) returns null. stopAgent sets the _stop_requested workflow variable so the agent's DoWhile loop exits gracefully after the current iteration. A null workflow means no execution exists with that ID. NotFoundException maps to HTTP 404.

Source

Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java:685

                // After deletion, restart from 0 since the result set shifts
            }
        }
        return deleted;
    }

    /**
     * Gracefully stop an agent execution by setting the _stop_requested flag.
     *
     * <p>The loop exits after the current iteration completes and the workflow reaches COMPLETED
     * status with the last LLM output as the result. Also sends a WMQ message to unblock agents
     * waiting on PULL_WORKFLOW_MESSAGES.
     */
    public void stopAgent(String executionId) {
        // Set the stop flag — the DoWhile loop condition checks this variable.
        // Get the workflow model, update its variables map, and persist.
        WorkflowModel workflow = executionDAO.getWorkflow(executionId, false);
        if (workflow == null) {
            throw new NotFoundException("No agent execution found: " + executionId);
        }
        workflow.getVariables().put("_stop_requested", true);
        executionDAO.updateWorkflow(workflow);
        // Note: the SDK also sends a WMQ unblock message via the Conductor client
        // to wake agents blocked on PULL_WORKFLOW_MESSAGES.
    }

    /**
     * Inject a persistent signal into a running agent's context.
     *
     * <p>Sets the {@code _signal_injection} workflow variable. The context injection script reads
     * this on each iteration and prepends it to the LLM's user message as {@code
     * [SIGNALS]...[/SIGNALS]}.
     */
    public void signalAgent(String executionId, String message) {
        WorkflowModel workflow = executionDAO.getWorkflow(executionId, false);
        if (workflow == null) {
            throw new NotFoundException("No agent execution found: " + executionId);

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Check getStatus(executionId) before calling stopAgent — if the workflow is terminal or absent, no stop is needed.
  2. Catch NotFoundException and treat it as success (the execution is already stopped/gone).
  3. Ensure the execution ID is current (not from a stale cache).

Example fix

// before
agentService.stopAgent(executionId);

// after
try {
    agentService.stopAgent(executionId);
} catch (NotFoundException e) {
    log.info("Execution {} already absent, nothing to stop", executionId);
}
Defensive patterns

Strategy: try-catch

Validate before calling

WorkflowModel wf = executionDAO.getWorkflow(executionId, false);
if (wf == null) {
    log.info("Execution {} not found, nothing to stop", executionId);
    return;
}

Try / catch

try {
    agentService.stopAgent(executionId);
} catch (NotFoundException e) {
    // Already gone — treat as stopped
    log.info("Execution {} already absent", executionId);
}

Prevention

When it happens

Trigger: Calling stopAgent with a non-existent or already-deleted execution ID; the execution finished and was pruned before the stop call arrived; typo in the execution ID.

Common situations: User clicks stop in the UI after the agent already completed and its record was removed; SDK retries a stop call after the execution was terminated by another path; stale execution ID from a cached UI state.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/ac6e203cfb820f14. Report an issue: GitHub.