{"record":{"id":"af2b4bb90d58cb45","repo":"flowable/flowable-engine","slug":"cannot-find-execution-with-id-executionid-af2b4b","errorCode":null,"errorMessage":"Cannot find execution with id '<executionId>'","messagePattern":"Cannot find execution with id '<executionId>'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SignalEventReceivedCmd.java","lineNumber":78,"sourceCode":"        this.async = async;\r\n        this.payload = null;\r\n        this.tenantId = tenantId;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        List<SignalEventSubscriptionEntity> signalEvents = null;\r\n\r\n        if (executionId == null) {\r\n            signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByEventName(eventName, tenantId);\r\n\r\n        } else {\r\n\r\n            ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId);\r\n\r\n            if (execution == null) {\r\n                throw new ActivitiObjectNotFoundException(\"Cannot find execution with id '\" + executionId + \"'\", Execution.class);\r\n            }\r\n\r\n            if (execution.isSuspended()) {\r\n                throw new ActivitiException(\"Cannot throw signal event '\" + eventName\r\n                        + \"' because execution '\" + executionId + \"' is suspended\");\r\n            }\r\n\r\n            signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByNameAndExecution(eventName, executionId);\r\n\r\n            if (signalEvents.isEmpty()) {\r\n                throw new ActivitiException(\"Execution '\" + executionId + \"' has not subscribed to a signal event with name '\" + eventName + \"'.\");\r\n            }\r\n        }\r\n\r\n        for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) {\r\n            // We only throw the event to globally scoped signals.\r\n            // Process instance scoped signals must be thrown within the process itself\r\n            if (signalEventSubscriptionEntity.isGlobalScoped()) {\r","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SignalEventReceivedCmd.java#L60-L96","documentation":"SignalEventReceivedCmd throws ActivitiObjectNotFoundException when no execution entity matches the supplied executionId while delivering a signal to a specific execution. Without a live execution the engine cannot inject the signal event, so it aborts with Execution.class as the missing type.","triggerScenarios":"Calling runtimeService.signalEventReceived(signalName, executionId) with an executionId that no longer exists in ACT_RU_EXECUTION (consumed, scope destroyed, or instance finished).","commonSituations":"Execution already continued past the signal-catching state; process instance finished before the signal arrived; ID captured earlier and reused after an async boundary completed.","solutions":["Re-query before signaling: runtimeService.createExecutionQuery().executionId(id).list() and only signal when non-empty.","Handle ActivitiObjectNotFoundException and treat it as 'signal no longer applicable' rather than a failure.","Signal the process instance via correlation or signalEventReceived(name) without execution targeting if scope tracking is unreliable."],"exampleFix":"// before\nruntimeService.signalEventReceived(\"order-approved\", executionId);\n// after\nExecution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (exec != null) {\n    runtimeService.signalEventReceived(\"order-approved\", executionId);\n}","handlingStrategy":"validation","validationCode":"boolean live = runtimeService.createExecutionQuery().executionId(executionId).count() > 0;\nif (live) runtimeService.signalEventReceived(eventName, executionId);","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.signalEventReceived(eventName, executionId);\n} catch (ActivitiObjectNotFoundException e) {\n    logger.info(\"Execution {} gone; signal {} discarded as stale\", executionId, eventName);\n}","preventionTips":["Re-fetch the execution immediately before signaling; async continuations can consume it in between.","Design event handlers to treat missing executions as benign no-ops.","Avoid caching execution IDs across long intervals."],"tags":["signal-event","execution-not-found","workflow"],"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"}