flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find an execution
Error message
Could not find an execution
What it means
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.
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
Example fix
// before GET /runtime/executions/99999/variables/status // execution 99999 does not exist // after GET /runtime/executions/<valid-execution-id>/variables/status // after verifying via /runtime/process-instances/<id>
Defensive patterns
Strategy: validation
Validate before calling
if (!rest.getRestTemplate().getForEntity(base + "/runtime/executions/" + executionId, String.class).getStatusCode().is2xxSuccessful()) throw new IllegalArgumentException("Execution " + executionId + " does not exist"); Type guard
null
Try / catch
try { client.getExecutionVariable(executionId, name); } catch (HttpClientErrorException.NotFound e) { /* execution gone: fall back to history endpoints */ } Prevention
- Verify the execution exists before variable calls
- Distinguish process-instance id vs execution id
- Use history API for completed processes
When it happens
Trigger: GET /runtime/executions/{executionId}/variables/{variableName} where the execution resolved from the request path is null (execution id doesn't exist).
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Could not find an execution with id '" + executionId + "'.
- Attachment with id ' ' does not have content associated…
- Cannot associate execution by id: no execution with id '
- Cannot find execution with id
- Cannot find process instance with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/25171e1502579644.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java:276
boolean variableFound = false;
if (scope == RestVariableScope.GLOBAL) {
if (execution.getParentId() != null && runtimeService.hasVariable(execution.getParentId(), variableName)) {
variableFound = true;
}
} else if (scope == RestVariableScope.LOCAL) {
if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
variableFound = true;
}
}
return variableFound;
}
public RestVariable getVariableFromRequest(Execution execution, String variableName, String scope, boolean includeBinary) {
if (execution == null) {
throw new FlowableObjectNotFoundException("Could not find an execution", Execution.class);
}
RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
if (restApiInterceptor != null) {
restApiInterceptor.accessExecutionVariable(execution, variableName, scope);
}
return getVariableFromRequestWithoutAccessCheck(execution, variableName, variableScope, includeBinary);
}
public RestVariable getVariableFromRequestWithoutAccessCheck(Execution execution, String variableName, RestVariableScope variableScope, boolean includeBinary) {
boolean variableFound = false;
Object value = null;
if (variableScope == null) {
// First, check local variables (which have precedence when no scope
// is supplied)View on GitHub (pinned to d6d39ce1c6)