{"record":{"id":"649a2a23920645f4","repo":"conductor-oss/conductor","slug":"workflowid-is-required","errorCode":null,"errorMessage":"workflowId is required","messagePattern":"workflowId is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"core/src/main/java/org/conductoross/conductor/core/storage/FileStorageServiceImpl.java","lineNumber":65,"sourceCode":"    private final FileMetadataDAO fileMetadataDAO;\n    private final FileStorageProperties properties;\n    private final WorkflowFamilyResolver workflowFamilyResolver;\n\n    public FileStorageServiceImpl(\n            FileStorage fileStorage,\n            FileMetadataDAO fileMetadataDAO,\n            FileStorageProperties properties,\n            WorkflowFamilyResolver workflowFamilyResolver) {\n        this.fileStorage = fileStorage;\n        this.fileMetadataDAO = fileMetadataDAO;\n        this.properties = properties;\n        this.workflowFamilyResolver = workflowFamilyResolver;\n    }\n\n    @Override\n    public FileUploadResponse createFile(FileUploadRequest request) {\n        if (request.getWorkflowId() == null || request.getWorkflowId().isBlank()) {\n            throw new IllegalArgumentException(\"workflowId is required\");\n        }\n\n        String fileId = UUID.randomUUID().toString();\n        String storagePath = STORAGE_PATH.formatted(request.getWorkflowId(), fileId);\n\n        FileModel model =\n                FileModelConverter.toFileModel(\n                        request, fileId, storagePath, fileStorage.getStorageType());\n        fileMetadataDAO.createFileMetadata(model);\n\n        String uploadUrl =\n                fileStorage.generateUploadUrl(storagePath, properties.getSignedUrlExpiration());\n        long expiresAt = Instant.now().plus(properties.getSignedUrlExpiration()).toEpochMilli();\n\n        return FileModelConverter.toFileUploadResponse(model, uploadUrl, expiresAt);\n    }\n\n    @Override","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/org/conductoross/conductor/core/storage/FileStorageServiceImpl.java#L47-L83","documentation":"Thrown by FileStorageServiceImpl.createFile when the request's workflowId is null or blank. A file is always scoped to a workflow, so a workflowId is mandatory to build the storage path and the metadata record. Raised as IllegalArgumentException (maps to HTTP 400).","triggerScenarios":"POST create-file with a request body whose workflowId field is missing, null, or whitespace. Also if the field is omitted in the JSON payload.","commonSituations":"Client SDK not setting workflowId; misnamed field in the payload (e.g. workflow_id vs workflowId); deserialization dropping the field; calling createFile before a workflow id is known.","solutions":["Set workflowId on the FileUploadRequest to a valid (existing) workflow id.","Validate the request field name matches workflowId exactly.","Create/obtain the workflow id first, then create the file."],"exampleFix":"// before\nFileUploadRequest req = new FileUploadRequest();\nreq.setFileName(\"report.csv\");\n// workflowId not set -> IllegalArgumentException\nfileStorageService.createFile(req);\n\n// after\nreq.setWorkflowId(workflowRunId);\nfileStorageService.createFile(req);","handlingStrategy":"validation","validationCode":"if (request.getWorkflowId() == null || request.getWorkflowId().isBlank()) {\n    // reject before calling the API\n}","typeGuard":null,"tryCatchPattern":"try {\n    fileStorageService.createFile(req);\n} catch (IllegalArgumentException e) {\n    // workflowId missing\n}","preventionTips":["Always set workflowId on FileUploadRequest","Create the workflow run first to obtain its id"],"tags":["file-storage","validation","request","conductor","java"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}