{"record":{"id":"d71f6223c336376f","repo":"flowable/flowable-engine","slug":"no-deployed-event-definition-found-with-id-even","errorCode":null,"errorMessage":"no deployed event definition found with id '${eventDefinitionId}'","messagePattern":"no deployed event definition found with id '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java","lineNumber":81,"sourceCode":"    public void deploy(EventDeploymentEntity deployment) {\n        for (Deployer deployer : deployers) {\n            deployer.deploy(deployment);\n        }\n    }\n\n    public EventDefinitionEntity findDeployedEventDefinitionById(String eventDefinitionId) {\n        if (eventDefinitionId == null) {\n            throw new FlowableException(\"Invalid event definition id : null\");\n        }\n\n        // first try the cache\n        EventDefinitionCacheEntry cacheEntry = eventDefinitionCache.get(eventDefinitionId);\n        EventDefinitionEntity eventDefinition = cacheEntry != null ? cacheEntry.getEventDefinitionEntity() : null;\n\n        if (eventDefinition == null) {\n            eventDefinition = engineConfig.getEventDefinitionEntityManager().findById(eventDefinitionId);\n            if (eventDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed event definition found with id '\" + eventDefinitionId + \"'\");\n            }\n            eventDefinition = resolveEventDefinition(eventDefinition).getEventDefinitionEntity();\n        }\n        return eventDefinition;\n    }\n    \n    public ChannelDefinitionEntity findDeployedChannelDefinitionById(String channelDefinitionId) {\n        if (channelDefinitionId == null) {\n            throw new FlowableException(\"Invalid channel definition id : null\");\n        }\n\n        // first try the cache\n        ChannelDefinitionCacheEntry cacheEntry = channelDefinitionCache.get(channelDefinitionId);\n        ChannelDefinitionEntity channelDefinition = cacheEntry != null ? cacheEntry.getChannelDefinitionEntity() : null;\n\n        if (channelDefinition == null) {\n            channelDefinition = engineConfig.getChannelDefinitionEntityManager().findById(channelDefinitionId);\n            if (channelDefinition == null) {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java#L63-L99","documentation":"After checking cache and database, findDeployedEventDefinitionById throws FlowableObjectNotFoundException when no event definition exists with the given id. The id format was valid and non-null, but nothing is deployed under it.","triggerScenarios":"Calling findDeployedEventDefinitionById with an id that was never deployed, an id from a different engine/database, or an id from a deployment that was deleted or not yet committed.","commonSituations":"Stale references in configuration after redeployment; cross-environment lookups (test id used in prod); querying before the deployment transaction commits; typo in the definition id.","solutions":["Verify the event definition id exists: check ACT_DE_EVENT_DEFINITION (or Flowable event-registry tables) for the id","Redeploy the event definition if it was deleted or never deployed","Point the engine configuration at the correct database where the definition is deployed","Catch FlowableObjectNotFoundException if the id is optional in your flow"],"exampleFix":"// before\ndef = deploymentManager.findDeployedEventDefinitionById(definitionId);\n// after\ntry {\n    def = deploymentManager.findDeployedEventDefinitionById(definitionId);\n} catch (FlowableObjectNotFoundException e) {\n    def = deploymentManager.findDeployedLatestEventDefinitionByKey(keyFromRequest); // fallback by key\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    def = deploymentManager.findDeployedEventDefinitionById(id);\n} catch (org.flowable.common.engine.api.FlowableObjectNotFoundException e) {\n    // handle missing definition: fallback by key or fail with context\n    def = null;\n}","preventionTips":["Keep event-registry deployments in sync across environments","Look up by key (findDeployedLatestEventDefinitionByKey) when ids are not stable across deployments","Never hardcode ids from one environment into another"],"tags":["java","event-registry","not-found"],"backgroundTag":"record-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"}