{"record":{"id":"f386477180463bb3","repo":"flowable/flowable-engine","slug":"no-process-definition-found-for-id-processdefin","errorCode":null,"errorMessage":"No process definition found for id '${processDefinitionId}'","messagePattern":"No process definition found for id '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/StartProcessInstanceByMessageCmd.java","lineNumber":104,"sourceCode":"\r\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\r\n        MessageEventSubscriptionEntity messageEventSubscription = processEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService()\r\n                .findMessageStartEventSubscriptionByName(messageName, tenantId);\r\n\r\n        if (messageEventSubscription == null) {\r\n            throw new FlowableObjectNotFoundException(\"Cannot start process instance by message: no subscription to message with name '\" + messageName + \"' found.\", MessageEventSubscriptionEntity.class);\r\n        }\r\n\r\n        String processDefinitionId = messageEventSubscription.getConfiguration();\r\n        if (processDefinitionId == null) {\r\n            throw new FlowableException(\"Cannot start process instance by message: subscription to message with name '\" + messageName + \"' is not a message start event.\");\r\n        }\r\n\r\n        DeploymentManager deploymentCache = processEngineConfiguration.getDeploymentManager();\r\n\r\n        ProcessDefinition processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);\r\n        if (processDefinition == null) {\r\n            throw new FlowableObjectNotFoundException(\"No process definition found for id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\r\n        }\r\n\r\n        ProcessInstanceHelper processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper();\r\n        ProcessInstance processInstance = processInstanceHelper.createAndStartProcessInstanceByMessage(processDefinition,\r\n                messageName, businessKey, businessStatus, processVariables, transientVariables, callbackId, callbackType, referenceId, referenceType,\r\n                ownerId, assigneeId);\r\n\r\n        return processInstance;\r\n    }\r\n\r\n}\r\n","sourceCodeStart":86,"sourceCodeEnd":116,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/StartProcessInstanceByMessageCmd.java#L86-L116","documentation":"The message event subscription pointed to a processDefinitionId, but no deployed process definition with that id exists in the deployment cache. This typically means the definition was deleted or the deployment cache is stale relative to the subscription's stored configuration.","triggerScenarios":"Calling RuntimeService.startProcessInstanceByMessage when the subscription's configuration references a process definition id that findDeployedProcessDefinitionById cannot resolve (definition undeployed, database purged, or cascade deletion left orphaned subscriptions).","commonSituations":"Old deployments were deleted without cleaning message event subscriptions; running against a different database than where the process was deployed; cluster node with stale/partial deployment cache.","solutions":["Re-deploy the process definition so the id resolves in the deployment cache","Delete the stale message event subscription (or redeploy/restart the app so subscriptions rebuild)","Verify you are connected to the same Flowable database the process was deployed to","Check ACT_RE_PROCDEF for the processDefinitionId referenced by the subscription's CONFIGURATION_ column"],"exampleFix":"// before: undeployed definition, subscription orphaned\nrepositoryService.deleteDeployment(deploymentId);\nruntimeService.startProcessInstanceByMessage(\"orderMsg\");\n// after: redeploy before starting\nrepositoryService.createDeployment().addClasspathResource(\"order.bpmn20.xml\").deploy();\nruntimeService.startProcessInstanceByMessage(\"orderMsg\");","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult();\nif (pd == null) throw new IllegalStateException(\"deploy the process before starting by message\");","typeGuard":"boolean isDeployed(RepositoryService rs, String procDefId) {\n    return rs.createProcessDefinitionQuery().processDefinitionId(procDefId).count() > 0;\n}","tryCatchPattern":"try {\n    runtimeService.startProcessInstanceByMessage(\"orderMsg\");\n} catch (FlowableObjectNotFoundException e) {\n    // redeploy or resolve id from ProcessDefinitionQuery, then retry once\n}","preventionTips":["Re-deploy the BPMN before relying on message subscriptions","Avoid deleting deployments that still have live message subscriptions","Confirm DB connection targets the intended environment"],"tags":["bpmn","process-definition","deployment","stale-state"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}