{"record":{"id":"3758246a4cbf1780","repo":"flowable/flowable-engine","slug":"execution-executionid-doesn-t-exist-375824","errorCode":null,"errorMessage":"execution \" + executionId + \" doesn't exist","messagePattern":"execution \" \\+ executionId \\+ \" doesn't exist","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java","lineNumber":49,"sourceCode":"\n    protected String executionId;\n\n    public NeedsActiveExecutionCmd(String executionId) {\n        this.executionId = executionId;\n    }\n\n    @Override\n    public T execute(CommandContext commandContext) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"executionId is null\");\n        }\n\n        ExecutionEntity execution = commandContext\n                .getExecutionEntityManager()\n                .findExecutionById(executionId);\n\n        if (execution == null) {\n            throw new ActivitiObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        if (execution.isSuspended()) {\n            throw new ActivitiException(getSuspendedExceptionMessage());\n        }\n\n        return execute(commandContext, execution);\n    }\n\n    /**\n     * Subclasses should implement this method. The provided {@link ExecutionEntity} is guaranteed to be active (ie. not suspended).\n     */\n    protected abstract T execute(CommandContext commandContext, ExecutionEntity execution);\n\n    /**\n     * Subclasses can override this to provide a more detailed exception message that will be thrown when the execution is suspended.\n     */\n    protected String getSuspendedExceptionMessage() {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java#L31-L67","documentation":"Thrown by NeedsActiveExecutionCmd.execute() when no execution entity exists for the given executionId. The engine looks up the execution via findExecutionById and, since Activiti/Flowable cannot operate on a non-existent execution, it raises ActivitiObjectNotFoundException carrying the expected Execution class. It is a lookup failure, not a state or permission problem.","triggerScenarios":"Calling any command extending NeedsActiveExecutionCmd (e.g. signal, message event reception, execution-related runtime operations) with an executionId that has been deleted, was never created, is from a different engine/process instance, or contains a typo.","commonSituations":"Holding an executionId after the process instance ended and its executions were removed; pointing at an executionId from another process engine or database schema; reusing stale ids cached in application code after a DB cleanup/redeploy of the app.","solutions":["Verify the executionId exists before invoking: create an ExecutionQuery via runtimeService.createExecutionQuery().executionId(id).singleResult() and check for null.","Confirm you are connected to the same process engine/database where the execution lives (check database schema and engine configuration).","Check whether the process instance already completed or was deleted; fetch a fresh executionId from the current process instance instead of a cached one.","Log/correct the source of the id (message correlation, signal payload) to rule out typo or truncation."],"exampleFix":"// before\nruntimeService.signal(executionId);\n\n// after\nExecution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (execution != null) {\n    runtimeService.signal(executionId);\n}","handlingStrategy":"validation","validationCode":"Execution e = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (e == null) throw new IllegalArgumentException(\"execution not found: \" + executionId);","typeGuard":"boolean executionExists(String id) {\n    return id != null && runtimeService.createExecutionQuery().executionId(id).singleResult() != null;\n}","tryCatchPattern":"try {\n    runtimeService.signal(executionId);\n} catch (ActivitiObjectNotFoundException e) {\n    // execution gone; treat as already finished\n}","preventionTips":["Query execution existence before operating on it","Never cache executionIds across transactions that may complete the instance","Confirm engine/datasource configuration points at the right database"],"tags":["activiti","flowable","execution-not-found","runtime"],"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"}