flowable/flowable-engine · error · FlowableException

No execution could be found for id {executionId}

Error message

No execution could be found for id {executionId}

What it means

Thrown by DefaultProcessInstanceService.getOutputParametersOfCaseTask when the BPMN execution id used to look up the calling case task does not exist. The engine needs the execution to read the CaseServiceTask flow element and copy output parameters back into the case; without the execution it cannot proceed.

Source

Thrown at modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/process/DefaultProcessInstanceService.java:125

        return processInstance.getId();
    }
    

    @Override
    public void triggerCaseTask(String executionId, Map<String, Object> variables) {
        processEngineConfiguration.getCommandExecutor().execute(new TriggerCaseTaskCmd(executionId, variables));
    }

    @Override
    public void handleCaseTaskError(String executionId, BusinessError error) {
        processEngineConfiguration.getCommandExecutor().execute(new HandleCaseTaskErrorCmd(executionId, error));
    }
    
    @Override
    public List<IOParameter> getOutputParametersOfCaseTask(String executionId) {
        ExecutionEntity execution = (ExecutionEntity) processEngineConfiguration.getExecutionEntityManager().findById(executionId);
        if (execution == null) {
            throw new FlowableException("No execution could be found for id " + executionId);
        }
        
        FlowElement flowElement = execution.getCurrentFlowElement();
        if (!(flowElement instanceof CaseServiceTask caseServiceTask)) {
            // The execution already processed this stage, there is no need to copy parameters anymore.
            // One possible reason for this is that the case task was terminated by a boundary event.
            return Collections.emptyList();
        }
        
        List<IOParameter> cmmnParameters = new ArrayList<>();

        List<org.flowable.bpmn.model.IOParameter> parameters = caseServiceTask.getOutParameters();
        for (org.flowable.bpmn.model.IOParameter ioParameter : parameters) {
            IOParameter parameter = new IOParameter();
            parameter.setSource(ioParameter.getSource());
            parameter.setSourceExpression(ioParameter.getSourceExpression());
            parameter.setSourceType(ioParameter.getSourceType());
            parameter.setTarget(ioParameter.getTarget());

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the executionId is the live id of the execution currently sitting on the case task (ExecutionQuery) before resolving output parameters
  2. Avoid deleting the process instance while its case task completion callback is still pending
  3. Catch FlowableException and skip output-parameter copying when the execution is gone (the surrounding code already skips when the flow element is no longer a CaseServiceTask)
  4. Restore consistency between CMMN and BPMN runtime tables if ids drifted (re-run repair/consistency checks)

Example fix

// before
List<IOParameter> params = processInstanceService.getOutputParametersOfCaseTask(executionId);

// after
Execution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
List<IOParameter> params = exec != null
    ? processInstanceService.getOutputParametersOfCaseTask(executionId)
    : Collections.emptyList();
Defensive patterns

Strategy: validation

Validate before calling

Execution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
if (exec == null) { /* skip output-parameter copy */ }

Try / catch

try {
    params = processInstanceService.getOutputParametersOfCaseTask(executionId);
} catch (FlowableException e) {
    if (e.getMessage().startsWith("No execution could be found")) {
        params = Collections.emptyList();
    } else { throw e; }
}

Prevention

When it happens

Trigger: The case task completion callback queries ExecutionEntityManager.findById(executionId) and gets null — the execution id passed in is stale, wrong, or the process instance was deleted before case-task completion was processed.

Common situations: Calling deleteProcessInstance on a process that contains an active case task, then the case finishes the task; corrupted/mismatched ids when moving data between databases; custom code invoking getOutputParametersOfCaseTask with a fabricated id.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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