flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find an execution with id '" + executionId + "'.

Error message

Could not find an execution with id '" + executionId + "'.

What it means

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.

Solutions

  1. Query GET /runtime/executions/{id} to confirm the execution exists before variable operations
  2. If the process already completed, use the history REST API (/history/historic-process-instances, /history/historic-variable-instances) instead
  3. Correct the execution id in the client — fetch fresh ids rather than reusing stored ones

Example fix

// before
executionId = oldInstanceIdFromCache; // ended process -> not found
// after
ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(bk).singleResult();
GET /runtime/executions/" + pi.getId() + "/variables/...
Defensive patterns

Strategy: validation

Validate before calling

Execution e = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
if (e == null) throw new IllegalArgumentException("No running execution with id " + executionId);

Type guard

null

Try / catch

try { client.callExecutionEndpoint(executionId); } catch (HttpClientErrorException.NotFound e) { /* refresh id or use history API */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/56b74699046dfbff. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java:335

            variableFound = true;
        }

        if (!variableFound) {
            throw new FlowableObjectNotFoundException("Execution '" + execution.getId() + "' does not have a variable with name: '" + variableName + "'.", VariableInstanceEntity.class);
        } else {
            return constructRestVariable(variableName, value, variableScope, execution.getId(), includeBinary);
        }
    }

    protected RestVariable constructRestVariable(String variableName, Object value, RestVariableScope variableScope, String executionId, boolean includeBinary) {

        return restResponseFactory.createRestVariable(variableName, value, variableScope, executionId, variableType, includeBinary);
    }

    protected Execution getExecutionFromRequestWithoutAccessCheck(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);
        }
        
        return execution;
    }

    protected String getExecutionIdParameter() {
        return "executionId";
    }

    protected boolean allowProcessInstanceUrl() {
        return false;
    }
}

View on GitHub (pinned to d6d39ce1c6)