{"record":{"id":"9c0faffa74efca10","repo":"flowable/flowable-engine","slug":"could-not-find-an-execution-with-id-executionid","errorCode":null,"errorMessage":"Could not find an execution with id '${executionId}'.","messagePattern":"Could not find an execution with id '(.+?)'\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java","lineNumber":201,"sourceCode":"                    if (process) {\n                        processInstanceQuery.processVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                    } else {\n                        processInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);\n                    }\n                } else {\n                    throw new FlowableIllegalArgumentException(\"Only string variable values are supported when ignoring casing, but was: \" + actualValue.getClass().getName());\n                }\n                break;\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n\n    protected Execution getExecutionFromRequest(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        if (restApiInterceptor != null) {\n            restApiInterceptor.accessExecutionInfoById(execution);\n        }\n        \n        return execution;\n    }\n\n    protected Map<String, Object> getVariablesToSet(List<RestVariable> restVariables) {\n        Map<String, Object> variablesToSet = new HashMap<>();\n        for (RestVariable var : restVariables) {\n            if (var.getName() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable name is required\");\n            }\n\n            Object actualVariableValue = restResponseFactory.getVariableValue(var);\n","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java#L183-L219","documentation":"FlowableObjectNotFoundException thrown when no execution exists with the given id. The REST helper resolves the executionId path variable via runtimeService.createExecutionQuery().executionId(id).singleResult(); null triggers a 404 with Execution.class as the missing type.","triggerScenarios":"Any endpoint delegating to getExecutionFromRequest (e.g. GET /runtime/executions/{executionId}, its variables/activities sub-resources) with an id of a never-created, completed, or deleted process execution.","commonSituations":"Process instance already ended (executions are removed on completion); using a processDefinitionId or taskId where an executionId is expected; stale bookmarked URLs; querying the wrong database/tenant.","solutions":["Verify the id exists: GET /runtime/process-instances/{processInstanceId} and use one of its executions' ids.","Remember executions disappear when the process completes — for history use /history/historic-process-instances instead.","Check you are pointing at the correct Flowable database/tenant configuration.","Catch FlowableObjectNotFoundException (HTTP 404) client-side and treat it as 'process finished or unknown id'."],"exampleFix":"// before\nGET /runtime/executions/definitely-not-an-execution\n// after\nconst inst = await fetch(`/runtime/process-instances/${pid}`);\nif (!inst.ok) throw new Error('process not found or completed');\nconst execId = (await inst.json()).id;\nawait fetch(`/runtime/executions/${execId}`);","handlingStrategy":"try-catch","validationCode":"const inst = await fetch(`/runtime/process-instances/${pid}`);\nif (!inst.ok) throw new Error('Execution/process not found or already completed');","typeGuard":null,"tryCatchPattern":"try { /* execution request */ } catch (e) {\n  if (e.status === 404) { /* check process instance / history; treat as completed */ } else throw e;\n}","preventionTips":["Expect executions to disappear on process completion — use history endpoints for ended instances","Validate ids come from a prior execution/process-instance response, not manual input","Handle 404 on execution endpoints as a normal outcome in long-running workflows"],"tags":["rest-api","execution","not-found","flowable"],"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"}