flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find an execution with id
Error message
Could not find an execution with id '${executionId}'. What it means
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.
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'.
Example fix
// before
GET /runtime/executions/definitely-not-an-execution
// after
const inst = await fetch(`/runtime/process-instances/${pid}`);
if (!inst.ok) throw new Error('process not found or completed');
const execId = (await inst.json()).id;
await fetch(`/runtime/executions/${execId}`); Defensive patterns
Strategy: try-catch
Validate before calling
const inst = await fetch(`/runtime/process-instances/${pid}`);
if (!inst.ok) throw new Error('Execution/process not found or already completed'); Try / catch
try { /* execution request */ } catch (e) {
if (e.status === 404) { /* check process instance / history; treat as completed */ } else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
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
- Batch part with id ' ' does not have a batch part document.
- Batch with id ' ' does not have a batch document.
- 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/9c0faffa74efca10.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java:201
if (process) {
processInstanceQuery.processVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
} else {
processInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
}
} else {
throw new FlowableIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: " + actualValue.getClass().getName());
}
break;
default:
throw new FlowableIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
}
}
}
protected Execution getExecutionFromRequest(String executionId) {
Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
if (execution == null) {
throw new FlowableObjectNotFoundException("Could not find an execution with id '" + executionId + "'.", Execution.class);
}
if (restApiInterceptor != null) {
restApiInterceptor.accessExecutionInfoById(execution);
}
return execution;
}
protected Map<String, Object> getVariablesToSet(List<RestVariable> restVariables) {
Map<String, Object> variablesToSet = new HashMap<>();
for (RestVariable var : restVariables) {
if (var.getName() == null) {
throw new FlowableIllegalArgumentException("Variable name is required");
}
Object actualVariableValue = restResponseFactory.getVariableValue(var);
View on GitHub (pinned to d6d39ce1c6)