{"record":{"id":"4414f76cb003170f","repo":"flowable/flowable-engine","slug":"execution-executionid-doesn-t-exist-4414f7","errorCode":null,"errorMessage":"execution ${executionId} doesn't exist","messagePattern":"execution (.+?) doesn't exist","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDataObjectsCmd.java","lineNumber":77,"sourceCode":"        this.executionId = executionId;\n        this.dataObjectNames = dataObjectNames;\n        this.isLocal = isLocal;\n        this.locale = locale;\n        this.withLocalizationFallback = withLocalizationFallback;\n    }\n\n    @Override\n    public Map<String, DataObject> execute(CommandContext commandContext) {\n\n        // Verify existence of execution\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n\n        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);\n\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        Map<String, VariableInstance> variables = null;\n\n        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {\n            Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();\n            variables = compatibilityHandler.getExecutionVariableInstances(executionId, dataObjectNames, isLocal);\n\n        } else {\n\n            if (dataObjectNames == null || dataObjectNames.isEmpty()) {\n                // Fetch all\n                if (isLocal) {\n                    variables = execution.getVariableInstancesLocal();\n                } else {\n                    variables = execution.getVariableInstances();\n                }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDataObjectsCmd.java#L59-L95","documentation":"GetDataObjectsCmd loads the ExecutionEntity for the given id and throws FlowableObjectNotFoundException 'execution <id> doesn't exist' when the lookup returns null. The command can therefore validate arguments but not reference integrity: the execution must exist at call time.","triggerScenarios":"runtimeService.getDataObjects(executionId) with an id whose process instance already ended and was removed from runtime tables; ids from another Flowable deployment/database; history-only identifiers used against the runtime API.","commonSituations":"After a batch migration completes and old instances are deleted; cleanup jobs purging instances while consumers still cache ids; miswired multi-engine environments.","solutions":["Query execution existence before reading data objects and handle absence gracefully","Stop persisting execution ids across process completion; use history service for finished instances","Confirm the correct engine/datasource for the id","Refresh cached ids frequently instead of storing them indefinitely"],"exampleFix":"// before\nMap<String, DataObject> all = runtimeService.getDataObjects(oldExecutionId);\n// after\nif (runtimeService.createExecutionQuery().executionId(oldExecutionId).count() > 0) {\n    Map<String, DataObject> all = runtimeService.getDataObjects(oldExecutionId);\n} else {\n    // fall back to historyService.createHistoricVariableInstanceQuery()\n}","handlingStrategy":"try-catch","validationCode":"long n = runtimeService.createExecutionQuery().executionId(executionId).count();\nif (n == 0) return Collections.emptyMap();","typeGuard":null,"tryCatchPattern":"try {\n    Map<String, DataObject> all = runtimeService.getDataObjects(executionId);\n} catch (FlowableObjectNotFoundException e) {\n    // instance completed/purged; use historyService instead\n}","preventionTips":["Treat runtime execution ids as ephemeral; do not persist them long-term","Switch to HistoricVariableInstanceQuery once the instance ends","Check engine/datasource consistency in multi-engine setups"],"tags":["flowable","execution","not-found"],"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-14T11:17:12.474Z"}