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

  1. Verify the execution id exists via GET /runtime/process-instances or the execution query
  2. Use the correct execution id (e.g. the process instance's id is also its root execution id in Flowable)
  3. 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

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


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)