How to sequentially loop tasks for certain condition over a set of objects to process for ETL, at the same time if condition not matched then it should run concurrently

I have different CRM from where I need to fetch the records for different entity. Say crm1, crm2, crm3, crm4 and entities are contact, company, leads, accounts.
The list of tasks are import_data, create_csv, upload_casv, loda_data_from_csv. This task should be done for all entities.
One more thing create_csv need to wait for import_data similarly upload_casv need to wait for create_csv and so on.
There will be only one flow. Currently I am looping over the crms then looping over the entities then submit the task, this will process the task in concurrent manner. So for 4 crm there are 16 job gets submitted, I don’t want to create another flow here. What I want for crm3 I want that first we complete the entity1(contact) and then entity2(company), entity 3(leads) and so on. But for other crm current implementation seems good, don’t want sequential for them.
Please help me on this how to achieve this??