{"record":{"id":"d673c24ad9ed78f6","repo":"conductor-oss/conductor","slug":"markdown-input-is-required-for-generate-pdf-task","errorCode":null,"errorMessage":"markdown input is required for GENERATE_PDF task","messagePattern":"markdown input is required for GENERATE_PDF task","errorType":"validation","errorClass":"NonRetryableException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/tasks/worker/DocumentGenWorkers.java","lineNumber":65,"sourceCode":"    private final String payloadStoreLocation;\n\n    public DocumentGenWorkers(\n            MarkdownToPdfConverter pdfConverter,\n            List<DocumentLoader> documentLoaders,\n            Environment env) {\n        this.pdfConverter = pdfConverter;\n        this.documentLoaders = documentLoaders;\n        this.payloadStoreLocation =\n                env.getProperty(\n                        \"conductor.file-storage.parentDir\",\n                        System.getProperty(\"user.home\") + \"/worker-payload/\");\n        log.info(\"Document Workers initialized\");\n    }\n\n    @WorkerTask(\"GENERATE_PDF\")\n    public LLMResponse generatePdf(MarkdownToPdfRequest input) {\n        if (isBlank(input.getMarkdown())) {\n            throw new NonRetryableException(\"markdown input is required for GENERATE_PDF task\");\n        }\n\n        Task task = TaskContext.get().getTask();\n\n        // Convert markdown to PDF bytes\n        byte[] pdfBytes = pdfConverter.convert(input);\n\n        // Determine output location\n        String outputLocation = input.getOutputLocation();\n        if (isBlank(outputLocation)) {\n            outputLocation =\n                    payloadStoreLocation\n                            + task.getWorkflowInstanceId()\n                            + \"/\"\n                            + task.getTaskId()\n                            + \"/\"\n                            + UUID.randomUUID()\n                            + \".pdf\";","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/tasks/worker/DocumentGenWorkers.java#L47-L83","documentation":"Thrown as NonRetryableException by the GENERATE_PDF worker when input.getMarkdown() is blank. The PDF converter needs markdown source content to render; an empty input cannot produce a document, so it fails terminally.","triggerScenarios":"Running a GENERATE_PDF task whose MarkdownToPdfRequest.markdown is null, empty, or whitespace; an upstream LLM_GENERATE or text task that produced no output being mapped into markdown.","commonSituations":"Upstream task returned empty result so the template variable resolved to blank; workflow author mapped the wrong output field into markdown; programmatic caller constructed MarkdownToPdfRequest without setting markdown; markdown sourced from a file that was empty/missing.","solutions":["Provide non-blank markdown content in the GENERATE_PDF input 'markdown' field.","Verify the upstream task variable referenced by the markdown template actually produced content.","Add a guard/branch before GENERATE_PDF to skip or fail gracefully when source text is empty.","Check for mapping typos (the worker reads input.getMarkdown() exactly)."],"exampleFix":"// before\n{ \"markdown\": \"${task.generate.output}\" }  // upstream returned null\n// after\n{ \"markdown\": \"${task.generate.output.result}\" }","handlingStrategy":"validation","validationCode":"// Validate markdown before invoking GENERATE_PDF\nif (StringUtils.isBlank(input.getMarkdown())) {\n    throw new IllegalArgumentException(\"markdown must be non-blank\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Branch workflows to skip GENERATE_PDF when source text is empty.","Map the correct upstream output field into 'markdown'.","Unit-test the markdown template variable resolution."],"tags":["document-gen","pdf","input-validation","non-retryable"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}