{"record":{"id":"df34ddc31b7b921c","repo":"conductor-oss/conductor","slug":"agent-requires-prompt","errorCode":null,"errorMessage":"AGENT requires 'prompt'","messagePattern":"AGENT requires 'prompt'","errorType":"validation","errorClass":"NonRetryableException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/agent/ConductorAgentDelegate.java","lineNumber":123,"sourceCode":"    }\n\n    private ConductorAgentExecution startOrResume(Task task, ConductorAgentRequest request) {\n        String executionId = StringUtils.trimToNull(request.getExecutionId());\n        if (executionId != null) {\n            if (StringUtils.isBlank(request.getPrompt())) {\n                throw new NonRetryableException(\n                        \"AGENT (conductor) requires 'prompt' when resuming an execution\");\n            }\n            conductorAgentClient.respond(\n                    ConductorAgentRespondRequest.builder()\n                            .executionId(executionId)\n                            .body(Map.of(\"result\", request.getPrompt()))\n                            .build());\n            return fromStatus(conductorAgentClient.getAgentStatus(executionId), null);\n        }\n\n        if (StringUtils.isBlank(request.getPrompt())) {\n            throw new NonRetryableException(\"AGENT requires 'prompt'\");\n        }\n        request.setIdempotencyKey(\n                StringUtils.firstNonBlank(request.getIdempotencyKey(), idempotencyKey(task)));\n        ConductorAgentStartResponse response = conductorAgentClient.startAgent(request);\n        return ConductorAgentExecution.builder()\n                .executionId(response.getExecutionId())\n                .agentName(response.getAgentName())\n                .state(ConductorAgentState.RUNNING)\n                .build();\n    }\n\n    private TaskResult handlePollFailure(\n            TaskResult result, ConductorAgentRequest request, String executionId, Exception error) {\n        int failures =\n                (int) asLong(result.getOutputData().get(ConductorAgentResults.KEY_POLL_FAILURES), 0)\n                        + 1;\n        result.getOutputData().put(ConductorAgentResults.KEY_POLL_FAILURES, failures);\n        int maxFailures = maxPollFailures(request);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/agent/ConductorAgentDelegate.java#L105-L141","documentation":"Thrown by ConductorAgentDelegate.startOrResume when starting a brand-new agent execution: executionId is null/blank AND the 'prompt' field is also blank. A new run has nothing to do without an initial prompt, so the call is rejected before it reaches conductorAgentClient.startAgent. It is a NonRetryableException, so the task fails terminally (FAILED_WITH_TERMINAL_ERROR) with no retry.","triggerScenarios":"An AGENT task (agentType=conductor) is invoked with task input that has no 'prompt' key at all, or whose prompt is an empty string / whitespace. This is the first-invoce 'start' path — executionId is absent.","commonSituations":"Workflow definition references a variable for the prompt that resolves to null; the prompt was intended to come from a previous task whose output key name is misspelled; a template that conditionally omits the prompt when it should always be present.","solutions":["Always supply a non-empty 'prompt' in the AGENT task input — it is mandatory for starting a run.","Verify the JSONPath/variable binding for prompt resolves to real text and not null or \"\".","If the prompt is genuinely optional in your flow, gate the AGENT task behind a decision/switch so it is only reached when text exists."],"exampleFix":"// before\n{ \"name\": \"my-agent\", \"model\": \"gpt-4o\" }\n// after\n{ \"name\": \"my-agent\", \"model\": \"gpt-4o\", \"prompt\": \"${summarize.output.text}\" }","handlingStrategy":"validation","validationCode":"// Validate the AGENT start input before execution\nString prompt = (String) taskInput.get(\"prompt\");\nif (prompt == null || prompt.isBlank()) {\n    throw new IllegalStateException(\"AGENT task requires a non-blank 'prompt' input\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    delegate.execute(task);\n} catch (NonRetryableException e) {\n    // terminal — do not retry; surface to workflow as a failed task\n    log.error(\"AGENT start rejected: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Treat 'prompt' as a required field in every AGENT task definition.","Add a JSON-schema/precondition check on the workflow input that produces the prompt.","Fail fast in the producing task (clear message) rather than letting the AGENT task fail terminally."],"tags":["conductor","ai-agent","validation","non-retryable","task-input"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}