Action Order is decided by using AT(Action Time) gauge.
AGI(Agility) is the status of calculating AT gauge.
Here is the formula of the calculation of AGI and AT gauge
Added AT gauge Amount ＝（100＋AGI）
Unit with more than 1000 AT gauge takes action at that time
When AT gauges of more than two units become more than 1000, the higher one will take action in first place.
If the AT gauge is the exactly same, the unit that the sum of status is higher will be move first. (status will be current status at the beginning of an action including buffs and debuffs, except HP will be calculated as 1/3 of Max HP).If they also the exactly same, the unit that has more HP ratio will move first. If they also the exactly same, random unit will move first.
When a unit take action, it will use either Sphere skill, action skill or BB. Skills will be activated in order. BB will activate when their required condition is met.