Unfortunately, it iteration order of an indexed variable ends up being a consequence of the Dictionary in which we store the variables and values. It’s a bit to take in, but you can see the workings in Octostache which is our open source engine that does the variable evaluations. It’s a generic library, so it knows nothing of Action orderings.
Admittedly, it’s not perfect that the ordering in an email like this isn’t correct. If it’s enough of an issue for you, you’re welcome to add a suggestion to our uservoice site and we’ll take it into consideration.
Ordering of actions worked fine in previous versions of Octopus (Before 4.0). I am not telling this is a bug of Octostache, just telling it is a change of behaviour and thus, it is not the expected behaviour for us.
I’ve been digging into this some more and we might have changed something (on Octopus, rather than OctoStache) that was giving us a stable ordering just as a consequence of the order we add the variables - would at least be nice to get the old behaviour back.
Can you provide a screen shot of step ordering and mail output order? (Feel free to mark the conversation as private if you need) And let me know the last version it was giving the right order for you. I’ll dig into it further and see what’s changed.