I'm trying to implement the following use case:

1. I've a sequence of sync tasks
2. Each sync task need to trigger an async task
3. Async tasks cannot run concurrently, so each one wait both for its trigger (2) and the completion of its predecessor.

[![enter image description here](https://i.stack.imgur.com/pMJiV.png)](https://i.stack.imgur.com/pMJiV.png)

My first idea was to convert every task (sync & async) into a promise then create two promise chains.
But I'm struggling finding a way to implement the async tasks chain with double dependency.

How can I achieve this ?