{"record":{"id":"25171e1502579644","repo":"flowable/flowable-engine","slug":"could-not-find-an-execution","errorCode":null,"errorMessage":"Could not find an execution","messagePattern":"Could not find an execution","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":276,"sourceCode":"        boolean variableFound = false;\n\n        if (scope == RestVariableScope.GLOBAL) {\n            if (execution.getParentId() != null && runtimeService.hasVariable(execution.getParentId(), variableName)) {\n                variableFound = true;\n            }\n\n        } else if (scope == RestVariableScope.LOCAL) {\n            if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {\n                variableFound = true;\n            }\n        }\n        return variableFound;\n    }\n\n    public RestVariable getVariableFromRequest(Execution execution, String variableName, String scope, boolean includeBinary) {\n\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an execution\", Execution.class);\n        }\n\n        RestVariableScope variableScope = RestVariable.getScopeFromString(scope);\n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessExecutionVariable(execution, variableName, scope);\n        }\n\n        return getVariableFromRequestWithoutAccessCheck(execution, variableName, variableScope, includeBinary);\n    }\n\n    public RestVariable getVariableFromRequestWithoutAccessCheck(Execution execution, String variableName, RestVariableScope variableScope, boolean includeBinary) {\n\n        boolean variableFound = false;\n        Object value = null;\n\n        if (variableScope == null) {\n            // First, check local variables (which have precedence when no scope\n            // is supplied)","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java#L258-L294","documentation":"Lookup failure in BaseExecutionVariableResource.getVariableFromRequest: the execution the variable request refers to could not be found in the runtime data (execution ended or id is wrong), so its variables cannot be accessed.","triggerScenarios":"GET /runtime/executions/{executionId}/variables/{variableName} where the execution resolved from the request path is null (execution id doesn't exist).","commonSituations":"Client uses a process-instance id where an execution id is required; execution already ended and purged; wrong URL path or typo in the id.","solutions":["Verify the execution id exists via GET /runtime/process-instances or the execution query","Use the correct execution id (e.g. the process instance's id is also its root execution id in Flowable)","Re-check whether the process instance has completed; finished instances move to history tables"],"exampleFix":"// before\nGET /runtime/executions/99999/variables/status   // execution 99999 does not exist\n// after\nGET /runtime/executions/<valid-execution-id>/variables/status  // after verifying via /runtime/process-instances/<id>","handlingStrategy":"validation","validationCode":"if (!rest.getRestTemplate().getForEntity(base + \"/runtime/executions/\" + executionId, String.class).getStatusCode().is2xxSuccessful()) throw new IllegalArgumentException(\"Execution \" + executionId + \" does not exist\");","typeGuard":"null","tryCatchPattern":"try { client.getExecutionVariable(executionId, name); } catch (HttpClientErrorException.NotFound e) { /* execution gone: fall back to history endpoints */ }","preventionTips":["Verify the execution exists before variable calls","Distinguish process-instance id vs execution id","Use history API for completed processes"],"tags":["rest","not-found","execution"],"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"}