{"record":{"id":"56b74699046dfbff","repo":"flowable/flowable-engine","slug":"could-not-find-an-execution-with-id-execution","errorCode":null,"errorMessage":"Could not find an execution with id '\" + executionId + \"'.","messagePattern":"Could not find an execution with id '\" \\+ executionId \\+ \"'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java","lineNumber":335,"sourceCode":"            variableFound = true;\n        }\n\n        if (!variableFound) {\n            throw new FlowableObjectNotFoundException(\"Execution '\" + execution.getId() + \"' does not have a variable with name: '\" + variableName + \"'.\", VariableInstanceEntity.class);\n        } else {\n            return constructRestVariable(variableName, value, variableScope, execution.getId(), includeBinary);\n        }\n    }\n\n    protected RestVariable constructRestVariable(String variableName, Object value, RestVariableScope variableScope, String executionId, boolean includeBinary) {\n\n        return restResponseFactory.createRestVariable(variableName, value, variableScope, executionId, variableType, includeBinary);\n    }\n\n    protected Execution getExecutionFromRequestWithoutAccessCheck(String executionId) {\n        Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an execution with id '\" + executionId + \"'.\", Execution.class);\n        }\n        \n        return execution;\n    }\n\n    protected String getExecutionIdParameter() {\n        return \"executionId\";\n    }\n\n    protected boolean allowProcessInstanceUrl() {\n        return false;\n    }\n}\n","sourceCodeStart":317,"sourceCodeEnd":349,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java#L317-L349","documentation":"Lookup failure in BaseExecutionVariableResource.getExecutionFromRequestWithoutAccessCheck: no runtime execution exists with the given executionId (finished, deleted, or invalid), so the request cannot be served; typically a 404.","triggerScenarios":"Any resource path that resolves an execution from a request parameter while bypassing the interceptor access check, when the id is invalid, mistyped, or the execution has already ended.","commonSituations":"Client caches execution ids from a previous run; process finished so the runtime row is gone (check history instead); id confusion between process instance id and execution id in cluster/history tables.","solutions":["Query GET /runtime/executions/{id} to confirm the execution exists before variable operations","If the process already completed, use the history REST API (/history/historic-process-instances, /history/historic-variable-instances) instead","Correct the execution id in the client — fetch fresh ids rather than reusing stored ones"],"exampleFix":"// before\nexecutionId = oldInstanceIdFromCache; // ended process -> not found\n// after\nProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(bk).singleResult();\nGET /runtime/executions/\" + pi.getId() + \"/variables/...","handlingStrategy":"validation","validationCode":"Execution e = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (e == null) throw new IllegalArgumentException(\"No running execution with id \" + executionId);","typeGuard":"null","tryCatchPattern":"try { client.callExecutionEndpoint(executionId); } catch (HttpClientErrorException.NotFound e) { /* refresh id or use history API */ }","preventionTips":["Fetch execution ids fresh from the runtime API, never cache across runs","Route completed-process lookups to the history API","Validate ids early in client code"],"tags":["rest","execution","not-found"],"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"}