conductor-oss/conductor · error · NotFoundException

Execution not found: ${executionId}

Error message

Execution not found: ${executionId}

What it means

Thrown by AgentDagService.injectTask when the execution referenced by executionId does not exist in the ExecutionDAO store. The service loads the workflow via executionDAO.getWorkflow(executionId, true) (includeTasks=true) and a null return means no workflow with that ID is persisted. NotFoundException maps to HTTP 404 at the REST layer. This is a runtime tracking-workflow operation for the agent DAG view.

Source

Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentDagService.java:48

import com.netflix.conductor.common.metadata.workflow.WorkflowDef;
import com.netflix.conductor.common.metadata.workflow.WorkflowTask;
import com.netflix.conductor.core.exception.NotFoundException;
import com.netflix.conductor.dao.ExecutionDAO;
import com.netflix.conductor.model.TaskModel;
import com.netflix.conductor.model.WorkflowModel;

import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
public class AgentDagService {

    private final ExecutionDAO executionDAO;

    public InjectTaskResponse injectTask(String executionId, InjectTaskRequest req) {
        WorkflowModel workflow = executionDAO.getWorkflow(executionId, true);
        if (workflow == null) {
            throw new NotFoundException("Execution not found: " + executionId);
        }

        boolean isSubWorkflow =
                "SUB_WORKFLOW".equals(req.getType()) && req.getSubWorkflowParam() != null;

        // Build inputData — for SUB_WORKFLOW, include the standard Conductor fields
        Map<String, Object> inputData;
        if (isSubWorkflow) {
            inputData = new LinkedHashMap<>();
            inputData.put("subWorkflowName", req.getSubWorkflowParam().getName());
            inputData.put("subWorkflowVersion", req.getSubWorkflowParam().getVersion());
            // workflowInput is what was passed to the sub-workflow
            inputData.put(
                    "workflowInput", req.getInputData() != null ? req.getInputData() : Map.of());
        } else {
            inputData = req.getInputData() != null ? req.getInputData() : Collections.emptyMap();
        }

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Verify the execution ID exists before calling injectTask by querying executionDAO.getWorkflow or the GET /api/agent/{id} endpoint.
  2. Ensure createTrackingWorkflow was called and returned a non-null workflow ID before attempting to inject tasks into that ID.
  3. Check that the AgentDagService and the caller share the same persistence backend (same ExecutionDAO bean / same DB).
  4. If the ID comes from an external source, validate its format and existence before dispatching the inject call.

Example fix

// before
agentDagService.injectTask(unknownId, req);

// after
WorkflowModel wf = executionDAO.getWorkflow(unknownId, false);
if (wf == null) {
    return ResponseEntity.notFound().build();
}
agentDagService.injectTask(unknownId, req);
Defensive patterns

Strategy: validation

Validate before calling

// Validate execution exists before injecting a task
WorkflowModel wf = executionDAO.getWorkflow(executionId, false);
if (wf == null) {
    return ResponseEntity.status(HttpStatus.NOT_FOUND)
        .body("Execution " + executionId + " does not exist");
}
agentDagService.injectTask(executionId, req);

Try / catch

try {
    agentDagService.injectTask(executionId, req);
} catch (NotFoundException e) {
    // execution does not exist — return 404 to caller
    return ResponseEntity.notFound().build();
}

Prevention

When it happens

Trigger: Calling injectTask with a stale, mistyped, or already-deleted execution ID; calling injectTask before the tracking workflow has been created via createTrackingWorkflow; using an execution ID from a different cluster/persistence store than the one the AgentDagService is wired to.

Common situations: Frontend DAG UI tries to inject a task into an execution whose record was pruned by pruneExecutions; SDK passes a parent execution ID that was never persisted because createTrackingWorkflow failed upstream; cross-environment ID leakage (e.g. staging ID used against production DAO).

Related errors


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