Insert parent and child records using 1 table

My preference would be to use only action framework if possible.

The table below shows the scenario I described. The idea would be to create the Enterprise records ‘Enterprise 1’, ‘Enterprise 2’ and ‘Enterprise 3’ and the Year records related to each enterprise (for example 2017 and 2018 for Enterprise 1).

Since we have multiple parents in the same table, I wondered how to retrieve the right Id to use it when creating the child records.

Thanks!