{"record":{"id":"aaeea640df193adf","repo":"flowable/flowable-engine","slug":"could-not-find-a-form-data-with-id-id","errorCode":null,"errorMessage":"Could not find a form data with id '\" + id + \"'.","messagePattern":"Could not find a form data with id '\" \\+ id \\+ \"'\\.","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java","lineNumber":87,"sourceCode":"            throw new FlowableIllegalArgumentException(\"The taskId or processDefinitionId parameter has to be provided\");\n        }\n\n        if (taskId != null && processDefinitionId != null) {\n            throw new FlowableIllegalArgumentException(\"Not both a taskId and a processDefinitionId parameter can be provided\");\n        }\n\n        FormData formData = null;\n        String id = null;\n        if (taskId != null) {\n            formData = formService.getTaskFormData(taskId);\n            id = taskId;\n        } else {\n            formData = formService.getStartFormData(processDefinitionId);\n            id = processDefinitionId;\n        }\n\n        if (formData == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a form data with id '\" + id + \"'.\", FormData.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessFormData(formData);\n        }\n\n        return restResponseFactory.createFormDataResponse(formData);\n    }\n\n    @ApiOperation(value = \"Submit task form data\", tags = { \"Forms\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates request was successful and the form data was submitted\"),\n            @ApiResponse(code = 204, message = \"If TaskId has been provided, Indicates request was successful and the form data was submitted. Returns empty\"),\n            @ApiResponse(code = 400, message = \"Indicates an parameter was passed in the wrong format. The status-message contains additional information.\") })\n    @PostMapping(value = \"/form/form-data\", produces = \"application/json\")\n    public ProcessInstanceResponse submitForm(@RequestBody SubmitFormRequest submitRequest, HttpServletResponse response) {\n\n        if (submitRequest == null) {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java#L69-L105","documentation":"Flowable's REST form-data endpoint throws FlowableObjectNotFoundException when neither the taskId nor the processDefinitionId resolves to actual form metadata. After looking up start-form or task-form data, the service checks whether the FormData object is null and throws, embedding the id that failed to resolve. It means the referenced form (or the task/process definition owning it) does not exist or has no form attached.","triggerScenarios":"GET /form/form-data with a taskId that has no associated task form, or a processDefinitionId that has no start form defined; nonexistent taskId/processDefinitionId values; deleted process definitions.","commonSituations":"Client passes a stale processDefinitionId after redeploying a new version; process has no <startEvent ... flowable:formKey> yet endpoint is queried; typo in taskId.","solutions":["Verify the taskId or processDefinitionId exists via the task/process-definition REST endpoints before requesting form data","Ensure the process definition actually declares a form (formKey on the start event or task) before querying form data","Catch FlowableObjectNotFoundException (HTTP 404) and surface a user-friendly 'form not found' message","Re-fetch the current process definition id after a redeploy instead of caching the old one"],"exampleFix":"// before\ncurl http://localhost:8080/flowable-rest/form/form-data?processDefinitionId=oldDefId:1:4\n\n// after\n// redeploy lookup: get latest definition first\ncurl \"http://localhost:8080/flowable-rest/repository/process-definitions?key=myProcess&latest=true\"\n// then use the returned id:\ncurl \"http://localhost:8080/flowable-rest/form/form-data?processDefinitionId=<latestId>\"","handlingStrategy":"validation","validationCode":"const exists = await fetch(`${BASE}/repository/process-definitions/${processDefinitionId}`).then(r => r.ok);\nif (!exists) throw new Error(`Process definition ${processDefinitionId} not found`);","typeGuard":"function hasFormTarget(req) { return typeof req.taskId === 'string' && req.taskId.length > 0 || typeof req.processDefinitionId === 'string' && req.processDefinitionId.length > 0; }","tryCatchPattern":"try { const form = await getFormData(taskId); } catch (e) { if (e.status === 404) showFormNotFound(e); else throw e; }","preventionTips":["Verify task/definition existence before requesting form data","Ensure the BPMN declares formKey where you expect a form","Refresh cached definition ids after redeployment"],"tags":["rest-api","flowable","not-found","form-data"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}