{"record":{"id":"82bab350085ba6f2","repo":"flowable/flowable-engine","slug":"could-not-find-matching-flowelement-for-activityid","errorCode":null,"errorMessage":"Could not find matching FlowElement for activityId \" + activityId + \" in \" + processDefinitionEntity","messagePattern":"Could not find matching FlowElement for activityId \" \\+ activityId \\+ \" in \" \\+ processDefinitionEntity","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/jobexecutor/TimerStartEventJobHandler.java","lineNumber":68,"sourceCode":"            throw new FlowableException(\"Could not find process definition needed for timer start event for job \" + job);\n        }\n\n        try {\n            if (!processDefinitionEntity.isSuspended()) {\n                ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n                FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();\n                if (eventDispatcher != null && eventDispatcher.isEnabled()) {\n                    eventDispatcher.dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.TIMER_FIRED, job),\n                            processEngineConfiguration.getEngineCfgKey());\n                }\n\n                // Find initial flow element matching the signal start event\n                org.flowable.bpmn.model.Process process = ProcessDefinitionUtil.getProcess(job.getProcessDefinitionId());\n                String activityId = TimerEventHandler.getActivityIdFromConfiguration(configuration);\n                if (activityId != null) {\n                    FlowElement flowElement = process.getFlowElement(activityId, true);\n                    if (flowElement == null) {\n                        throw new FlowableException(\"Could not find matching FlowElement for activityId \" + activityId + \" in \" + processDefinitionEntity);\n                    }\n                    ProcessInstanceHelper processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper();\n                    processInstanceHelper.createAndStartProcessInstanceWithInitialFlowElement(processDefinitionEntity, null, null, null, flowElement, process\n                            , null, null, null, null, true);\n                } else {\n                    new StartProcessInstanceCmd(processDefinitionEntity.getKey(), null, null, null, job.getTenantId()).execute(commandContext);\n                }\n\n            } else {\n                LOGGER.debug(\"ignoring timer of suspended process definition {}\", processDefinitionEntity.getId());\n            }\n        } catch (RuntimeException e) {\n            LOGGER.error(\"exception during timer execution for {}\", job, e);\n            throw e;\n        } catch (Exception e) {\n            LOGGER.error(\"exception during timer execution for {}\", job, e);\n            throw new FlowableException(\"exception during timer execution for \" + job, e);\n        }","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/jobexecutor/TimerStartEventJobHandler.java#L50-L86","documentation":"Thrown by TimerStartEventJobHandler.execute when the activityId encoded in the timer job's configuration does not resolve to a FlowElement in the process model. Used for signal/multiple start events, the handler locates the specific initial flow element to start the instance with.","triggerScenarios":"A timer start job with configuration containing an activityId absent from the parsed process (e.g. model redeployed/changed so the element was removed or renamed while the old job remained).","commonSituations":"Redeploying a changed BPMN while old timer jobs persisted, hand-editing job configuration, or version-skew between the job's process definition and the resolved model.","solutions":["Ensure the activityId in the job configuration matches a flow element id in the deployed model","Redeploy the process definition / recreate the timer job so configuration and model agree","Remove stale timer jobs from ACT_RU_JOB after model changes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify configured activityId exists before firing: process.getFlowElement(activityId, true) != null","typeGuard":null,"tryCatchPattern":"try { /* timer fires */ } catch (FlowableException e) { if (e.getMessage().startsWith(\"Could not find matching FlowElement\")) { /* recreate job / redeploy model */ } else throw e; }","preventionTips":["Keep start-event ids stable across redeployments","Clean stale timer jobs after model changes"],"tags":["flowable","timer","bpmn","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}