When adding operations to an action, they are sorted by type as defined in include/defines.inc.php starting on line 485 and onwards. This ordering is not only visual - it is also the order in which they are inserted into the database.
Due to this, you cannot, for example, add a discovered host and execute a remote command on it, because at that point, the host doesn't exist. The operations are not executed in any particular order on the server either.
This should be fixed or documented.
Specification available at https://www.zabbix.org/wiki/Docs/specs/ZBX-8800