{"record":{"id":"ecaa5b79b29bf5fe","repo":"flowable/flowable-engine","slug":"no-execution-found-for-id-executionid-ecaa5b","errorCode":null,"errorMessage":"No execution found for id '${executionId}'","messagePattern":"No execution found for id '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetEnabledActivitiesForAdhocSubProcessCmd.java","lineNumber":46,"sourceCode":"import org.flowable.engine.impl.util.CommandContextUtil;\n\n/**\n * @author Tijs Rademakers\n */\npublic class GetEnabledActivitiesForAdhocSubProcessCmd implements Command<List<FlowNode>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String executionId;\n\n    public GetEnabledActivitiesForAdhocSubProcessCmd(String executionId) {\n        this.executionId = executionId;\n    }\n\n    @Override\n    public List<FlowNode> execute(CommandContext commandContext) {\n        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"No execution found for id '\" + executionId + \"'\", ExecutionEntity.class);\n        }\n\n        if (!(execution.getCurrentFlowElement() instanceof AdhocSubProcess adhocSubProcess)) {\n            throw new FlowableException(\"The current flow element of the requested \" + execution + \" is not an ad-hoc sub process\");\n        }\n\n        List<FlowNode> enabledFlowNodes = new ArrayList<>();\n\n        // if sequential ordering, only one child execution can be active, so no enabled activities\n        if (adhocSubProcess.hasSequentialOrdering()) {\n            if (execution.getExecutions().size() > 0) {\n                return enabledFlowNodes;\n            }\n        }\n\n        for (FlowElement flowElement : adhocSubProcess.getFlowElements()) {\n            if (flowElement instanceof FlowNode flowNode) {\n                if (flowNode.getIncomingFlows().size() == 0) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetEnabledActivitiesForAdhocSubProcessCmd.java#L28-L64","documentation":"Thrown by GetEnabledActivitiesForAdhocSubProcessCmd.execute() when no ExecutionEntity exists for the supplied executionId. Flowable looks up the execution via the ExecutionEntityManager and raises FlowableObjectNotFoundException if findById returns null, i.e. the execution was never created, has completed, or the id is wrong.","triggerScenarios":"Calling RuntimeService.getEnabledActivitiesForAdhocSubProcess(executionId) (or executing this command directly) with an execution id that does not exist in ACT_RU_EXECUTION.","commonSituations":"Using a stale id after the ad-hoc subprocess execution ended; copying a processInstanceId instead of an executionId; typo'd id from external storage; querying on a different engine/datasource than the one that ran the process.","solutions":["Verify the executionId exists: query RuntimeService.createExecutionQuery().executionId(id).singleResult() before calling.","Ensure you pass the executionId of the execution whose current flow element is the ad-hoc subprocess, not the process instance id unless that is the ad-hoc execution.","Re-fetch the id after any process progression; ids become invalid once the execution finishes.","Confirm you are connected to the same database the process ran on (correct datasource/schema in flowable config)."],"exampleFix":"// before\nruntimeService.getEnabledActivitiesForAdhocSubProcess(\"untrusted-id\");\n// after\nExecution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (exec != null) {\n    runtimeService.getEnabledActivitiesForAdhocSubProcess(executionId);\n}","handlingStrategy":"validation","validationCode":"if (executionId == null || runtimeService.createExecutionQuery().executionId(executionId).count() == 0) {\n    throw new IllegalArgumentException(\"execution does not exist: \" + executionId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.getEnabledActivitiesForAdhocSubProcess(executionId);\n} catch (FlowableObjectNotFoundException e) {\n    // refresh execution id from RuntimeService or treat as finished\n}","preventionTips":["Always obtain the id from a fresh ExecutionQuery result","Distinguish executionId from processInstanceId","Re-resolve ids after any wait-state or completion","Confirm single-engine/datasource setup"],"tags":["flowable","not-found","execution","runtime-service"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}