How do I know a process instance was migrated or not

Hello,

I need to perform some actions on a process instance only if this process instance was migrated from a process definition to another, sometime in history. Is there any flag on that process instance to let me know that this instance was migrated?

Is there any migration history available?

Thank you in advance.

You might be able to infer based on the activity history for an instance. For example, if you query the activity instance history API by process instance id, you could take a look at the process definition id for each of the activities. If an instance was migrated at some point during execution, I would expect the process definition id of the the start event, for example, to differ from the current (or last) activity executed in most cases.

1 Like

You gave me a really good idea. So what Iā€™m going to do is I will get the processDefinitionId of the start event and compare it to the processDefinitionId of the process instance. This way, the start event processDefinitionId will never change because this event is executed just once. So if the process instance was migrated will have a different processDefinitionId than the start event.

Thank you!

1 Like