{"record":{"id":"f4e67bc360f9d830","repo":"flowable/flowable-engine","slug":"cannot-trigger-execution-no-current-flow-elem","errorCode":null,"errorMessage":"Cannot trigger ${execution} : no current flow element found. Check the execution id that is being passed (it should not be a process instance execution, but a child execution currently referencing a flow element).","messagePattern":"Cannot trigger (.+?) : no current flow element found\\. Check the execution id that is being passed \\(it should not be a process instance execution, but a child execution currently referencing a flow element\\)\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/agenda/TriggerExecutionOperation.java","lineNumber":79,"sourceCode":"                } else {\n                    ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n                    JobService jobService = processEngineConfiguration.getJobServiceConfiguration().getJobService();\n                    JobEntity job = JobUtil.createJob(execution, currentFlowElement, AsyncTriggerJobHandler.TYPE, processEngineConfiguration);\n\n                    jobService.createAsyncJob(job, true);\n                    jobService.scheduleAsyncJob(job);\n                }\n\n\n            } else {\n                throw new FlowableException(\"Cannot trigger \" + execution\n                    + \" : the activityBehavior \" + activityBehavior.getClass() + \" does not implement the \"\n                    + TriggerableActivityBehavior.class.getName() + \" interface\");\n\n            }\n\n        } else if (currentFlowElement == null) {\n            throw new FlowableException(\"Cannot trigger \" + execution\n                    + \" : no current flow element found. Check the execution id that is being passed \"\n                    + \"(it should not be a process instance execution, but a child execution currently referencing a flow element).\");\n\n        } else {\n            throw new FlowableException(\"Programmatic error: cannot trigger \" + execution + \", invalid flow element type found: \"\n                    + currentFlowElement.getClass().getName() + \".\");\n\n        }\n    }\n\n}\n","sourceCodeStart":61,"sourceCodeEnd":91,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/agenda/TriggerExecutionOperation.java#L61-L91","documentation":"Flowable's TriggerExecutionOperation fires a signal on an execution, but the execution's currentFlowElement is null. This means the trigger was sent to an execution that is not positioned at an activity (e.g. the root process-instance execution, or a concurrent/child execution that has no current flow element). The library throws instead of silently ignoring a trigger on the wrong execution.","triggerScenarios":"Calling RuntimeService.trigger(executionId) (or signal with variables) with the id of the process instance execution instead of a child execution currently sitting in a wait state (e.g. inside a receive task, user task, or event-based gateway).","commonSituations":"Developers fetch the process instance id via RuntimeService.createProcessInstanceQuery() and pass it to trigger(); only executions from createExecutionQuery().activityId(...) should be triggered. Also happens when the target execution already left the wait state (race condition / double trigger), or after engine version refactors of execution trees (concurrent child executions).","solutions":["Query the correct execution: RuntimeService.createExecutionQuery().processInstanceId(pid).activityId(\"theActivityId\").singleResult() and trigger that id.","Verify the execution still exists and is in a wait state before triggering (avoid double triggers).","If you need to signal the whole instance, use the appropriate API (e.g. complete the task via TaskService) instead of triggering the process-instance execution."],"exampleFix":"// before\nruntimeService.trigger(processInstanceId);\n// after\nExecution execution = runtimeService.createExecutionQuery()\n    .processInstanceId(processInstanceId)\n    .activityId(\"receiveTaskId\")\n    .singleResult();\nruntimeService.trigger(execution.getId());","handlingStrategy":"validation","validationCode":"Execution target = runtimeService.createExecutionQuery()\n    .processInstanceId(processInstanceId)\n    .activityId(\"receiveTaskId\")\n    .singleResult();\nif (target == null || target.getId().equals(processInstanceId)) {\n    throw new IllegalStateException(\"No child execution in a wait state for activity; cannot trigger\");\n}\nruntimeService.trigger(target.getId());","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.trigger(executionId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"no current flow element found\")) {\n        // wrong execution id; re-query child execution before retrying\n    } else {\n        throw e;\n    }\n}","preventionTips":["Never pass the process instance id to trigger(); always resolve the child execution via createExecutionQuery().activityId(...)","Check the execution is still active/waiting before triggering to avoid race/double-trigger","Prefer TaskService.complete or domain APIs over raw trigger where possible"],"tags":["workflow","bpmn","invalid-execution-id"],"backgroundTag":"invalid-argument-value","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"}