The lastInternalId is used to track creation of exchanges. To identify an exchange within a process definite, it needs to get a unique id (like refIds in other elements). To avoid huge database sizes for system processes databases, openLCA is using a numerical counter that is unique within its owning process. To stay unique, even when deleting exchanges and creating new ones, the owning process stores the last assigned internal id in this field. In case you are creating new processes, you can just start with 1 for the first exchange and n for the last exchange and then set n as lastInternalId on the process (where n is the number of exchanges within the process)