{"record":{"id":"d5eeac2e6de5d789","repo":"flowable/flowable-engine","slug":"no-execution-could-be-found-for-id-executionid-d5eeac","errorCode":null,"errorMessage":"No execution could be found for id \" + executionId","messagePattern":"No execution could be found for id \" \\+ executionId","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/HandleCaseTaskErrorCmd.java","lineNumber":58,"sourceCode":"    protected BusinessError error;\n\n    public HandleCaseTaskErrorCmd(String executionId, BusinessError error) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        if (error == null) {\n            throw new FlowableIllegalArgumentException(\"error is null\");\n        }\n        this.executionId = executionId;\n        this.error = error;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        ExecutionEntity execution = (ExecutionEntity) processEngineConfiguration.getExecutionEntityManager().findById(executionId);\n        if (execution == null) {\n            throw new FlowableException(\"No execution could be found for id \" + executionId);\n        }\n\n        ErrorPropagation.propagateError(error, execution);\n        return null;\n    }\n}\n","sourceCodeStart":40,"sourceCodeEnd":65,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/HandleCaseTaskErrorCmd.java#L40-L65","documentation":"In execute(), after findById(executionId) returns null, HandleCaseTaskErrorCmd throws FlowableException(\"No execution could be found for id <executionId>\"). Unlike null-argument checks, this signals the id was syntactically valid but no matching execution exists in the runtime persistence.","triggerScenarios":"Executing HandleCaseTaskErrorCmd with an executionId for an execution that was deleted, already ended, belongs to another engine/database, or was never created (stale or wrong id).","commonSituations":"Race where the case instance terminated before error propagation ran; environment mismatch (test id used against prod DB); id stored and reused after process cleanup; tenant/database misconfiguration.","solutions":["Verify the execution still exists (runtimeService.createExecutionQuery().executionId(id)) before propagating the error.","Re-resolve the executionId from the current task/plan item instead of caching a stale one.","Confirm the command runs against the same engine configuration/database that owns the execution.","Catch FlowableException here and treat it as an idempotent no-op if the instance is already gone."],"exampleFix":"// before\nmanagementService.executeCommand(new HandleCaseTaskErrorCmd(executionId, error)); // throws if gone\n// after\nExecution e = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (e != null) {\n    managementService.executeCommand(new HandleCaseTaskErrorCmd(executionId, error));\n}","handlingStrategy":"try-catch","validationCode":"Execution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (exec == null) { /* skip or handle missing execution */ }","typeGuard":null,"tryCatchPattern":"try {\n    managementService.executeCommand(new HandleCaseTaskErrorCmd(executionId, error));\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"No execution could be found\")) {\n        log.warn(\"Execution {} already gone; skipping error propagation\", executionId);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Check execution existence before propagating errors into ended instances","Treat missing executions as idempotent no-ops in error pipelines","Re-resolve ids from live queries instead of persisting them across steps"],"tags":["flowable","cmmn","execution-not-found","error-propagation"],"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"}