{"record":{"id":"323ed34cadbd204c","repo":"flowable/flowable-engine","slug":"execution-executionid-doesn-t-exist-323ed3","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/GetDataObjectCmd.java","lineNumber":74,"sourceCode":"        this.dataObjectName = dataObjectName;\n        this.isLocal = isLocal;\n        this.locale = locale;\n        this.withLocalizationFallback = withLocalizationFallback;\n    }\n\n    @Override\n    public DataObject execute(CommandContext commandContext) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        if (dataObjectName == null) {\n            throw new FlowableIllegalArgumentException(\"dataObjectName 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        DataObject dataObject = null;\n\n        VariableInstance variableEntity = null;\n        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {\n            Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();\n            variableEntity = compatibilityHandler.getExecutionVariableInstance(executionId, dataObjectName, isLocal);\n\n        } else {\n            if (isLocal) {\n                variableEntity = execution.getVariableInstanceLocal(dataObjectName, false);\n            } else {\n                variableEntity = execution.getVariableInstance(dataObjectName, false);\n            }\n        }\n\n        String localizedName = null;","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDataObjectCmd.java#L56-L92","documentation":"After passing argument validation, GetDataObjectCmd loads the ExecutionEntity by id; if no execution with that id exists it throws FlowableObjectNotFoundException with the message 'execution <id> doesn't exist'. The execution was deleted, never existed, or the id is wrong (or from a different engine/history level).","triggerScenarios":"runtimeService.getDataObject(executionId, name) with an id of a completed/removed process instance; typo'd or stale execution ids; using a process-instance id where an execution id is required when they differ.","commonSituations":"Long-running jobs holding an execution id captured before the process ended; multi-tenant setups querying an id that belongs to another engine's datasource; calling data-object APIs from external systems after instance cleanup.","solutions":["Re-fetch the execution first (runtimeService.createExecutionQuery().executionId(id).singleResult()) and only call getDataObject when it exists","Use the current process instance id and derive the execution via a query instead of storing long-lived execution ids","Check for completion before accessing data objects; read data objects during the process lifecycle or via history APIs when ended","Verify the id targets the correct Flowable engine/database"],"exampleFix":"// before\nDataObject d = runtimeService.getDataObject(staleExecutionId, \"name\");\n// after\nExecutionEntity exec = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(staleExecutionId).singleResult();\nif (exec != null) {\n    DataObject d = runtimeService.getDataObject(staleExecutionId, \"name\");\n}","handlingStrategy":"try-catch","validationCode":"Execution e = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (e == null) return null; // execution gone","typeGuard":null,"tryCatchPattern":"try {\n    DataObject d = runtimeService.getDataObject(executionId, name);\n} catch (FlowableObjectNotFoundException e) {\n    // execution no longer exists; fall back to history\n}","preventionTips":["Re-query execution existence instead of trusting stored ids","Use history APIs for finished process instances","Verify the id belongs to the configured engine/tenant"],"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"}