# Start a process instance in a specific task

**URL:** <https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654>\
**Category:** Flowable Engine\
**Created:** [February 15, 2018, 7:23pm UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654 "2018-02-15T19:23:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![williamassoni](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@williamassoni](https://forum.flowable.org/u/williamassoni)\
**Post date:** [February 15, 2018, 7:23pm UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/1 "2018-02-15T19:23:32Z")

</div>

Hello,

Is There a way to start a process in a different point of the flow? example:

Start --\> fristUserTask --\> secondUserTask --\> thirdUserTask --\> End

If I create a new instance of the Procces above, the active activity will be “fristUserTask”. But if for some reason I want to start a new Instance and in the same way I want to the active activity to be “thirdUserTask”, will flowable engine support this kind of behavior?

I have a lot of legacy process running outside of engine and I’d like to start in different points depending of process.

Thanks.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 16, 2018, 1:10pm UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/2 "2018-02-16T13:10:16Z")

</div>

Yes, this is possible, have a look at [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/RuntimeServiceTest.java#L1806](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/RuntimeServiceTest.java#L1806)

It’s a low level api at the moment, but in that test (and others in the same class) you can get an idea of how it looks currently. But it will get more love in the coming months.

---

<div class="post-metadata">

**Author:** ![Darkvater](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/darkvater/32/1643_2.png) [@Darkvater](https://forum.flowable.org/u/Darkvater)\
**Post date:** [March 12, 2020, 10:20am UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/3 "2020-03-12T10:20:49Z")

</div>

Hi, I just looked at this and do not think it is what the op was looking for. Yes, the change activity builder can change the state of a process to any state that you want. However to do that you need a process instance. And the only way to create a process instance is to start a new instance which will execute your first task and all synchronous tasks following it.  
How do I create a process instance in a non-start state?

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [March 14, 2020, 3:30pm UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/4 "2020-03-14T15:30:14Z")

</div>

> [@Darkvater](#):
>
> How do I create a process instance in a non-start state?

Right now you can’t. At least not through the API. Using a custom Command you could do it, by creating a process instance execution and a child execution in the start event . But not sure how the change activity builder would react to that, would need to verify that.

---

<div class="post-metadata">

**Author:** ![Darkvater](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/darkvater/32/1643_2.png) [@Darkvater](https://forum.flowable.org/u/Darkvater)\
**Post date:** [March 16, 2020, 8:53am UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/5 "2020-03-16T08:53:27Z")

</div>

Hi Joram, thanks for your reply. Would you have an example or more pointers on what to do exactly?

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [March 25, 2020, 7:56am UTC](https://forum.flowable.org/t/start-a-process-instance-in-a-specific-task/1654/6 "2020-03-25T07:56:30Z")

</div>

A custom Command can be used when there’s no out-of-the-box API to do what you want. You execute a command through the managementService#executeCommand method: [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/ManagementService.java#L370](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/ManagementService.java#L370)

In such a Command, you are effectively ‘below’ the API level and have access to all internal services. Simple example: [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/mgmt/JobQueryTest.java#L197](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/mgmt/JobQueryTest.java#L197)

In this particular use case, you’d use the ExecutionEntityManager to create an execution for the process instance and one for the start event, link it with the right process definition and then call the change activity logic.
