Hi You can minimize all the highlight steps.

Use conditional compose action to create and take details from "Generate Document using Templates"

if(greater("NumberPutInCondition",12),outputs('Compose_2'),outputs('Compose'))

This needs three details, you need to create three conditional compose and then use them in following activities.
If it helps ,accept my reply as solution 🙂
My YouTube channel : Botaverse