Can not startBeforeActivity at an activity defined in a subprocess

I have a parent process where a subprocess is started with “callActivity”. The subprocess contains two tasks, task1 and task2. When I try to start the parentProcess at “task2”, I get a NotValidException:

org.camunda.bpm.engine.exception.NotValidException: Element 'task2' does not exist in process parentProcess:1:324: targetElement is null
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(
    at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(
    at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(
    at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.determineFirstActivity(
    at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.execute(
    at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.execute(
    at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(
    at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(
    at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(
    at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(
    at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.executeWithVariablesInReturn(
    at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(
    at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(

Here is how I try to start the process at “task2”.


parentProcess.bpmn (2.2 KB)

subProcess.bpmn (2.7 KB)

To contextualize a little: we need to migrate old process instances into new definition, so we need to be able to start at any user task in the process.

Am I missing something ?

Hi @Hugo_Gerard,

task1 doesn’t exist in parentProcess. It is an activity of subProcess. So try the following invoke


Hi, I actually need an instance of the parentProcess. In the real process, there are other activities following the callActivity(subProcess) in the parentProcess.

Something like this:


So I would need this instance tree:


So when task1 and task2 are complete, the parent process continue.
Thanks for your time.!

Then … Did you try to start before the callActivity “callSubProcess” instead of task1


Yes, but that would not work if I need to start before “task2”. This need is part of a bigger migration process where I would need to start at any task in the workflow. I reformulate my topic.

Hugo, did you ever find a resolution for this? I have the same scenario, I want to Start a process, containing called sub-processes at an activity within the sub-process.

I suspect it may be a two-step solution, first Starting the parent a the sub-process and then Modifying the sub-process to place the token in the right position.

There is not out of the box way to do that with “call activity”.

Ryan Johnston on stackoverflow suggested to create the subprocess in a service task but you loose the parent/subprocess link, unless I missed something.

Your two-step solution might be the one to go. How do you modify the subprocess instance ?

Depending on the circumstances of the subprocess I will either Complete Tasks or send the appropriate Messages and/or Variables to get me where I want. My case is fairly simple, but I could see that being problematic if you don’t want intermediate tasks to fire within the subprocess.