Execution logic

Hi everyone,
I would like to understand the execution logic of these two functions .....

function 1405

const output = [null, null, null, null, null];

output[0] = { payload: 0, topic: "Test" }
output[1] = { payload: 1, topic: "Test" }
output[2] = { payload: 2, topic: "Test" }
output[3] = { payload: 3, topic: "Test" }
output[4] = { payload: 4, topic: "Test" }

return output;

function 1406

const output = [null, null, null, null, null];

output[0] = { payload: 5, topic: "Test" }
output[1] = { payload: 6, topic: "Test" }
output[2] = { payload: 7, topic: "Test" }
output[3] = { payload: 8, topic: "Test" }
output[4] = { payload: 9, topic: "Test" }

return output;

If I create and save (deploy) the functions together I have an output with a certain order, if I delete the link and save (deploy) first one then the other the order the order changes.

I have the opportunity to know which is the first function which will be performed and possibly change the order?

The nodes are generally in the order they are saved in the flow json, so if you delete the first or alter the wires i would be added after the other.
Why not have one function with all, or use a trigger node set to output second output to a separate output, then you could control which is executed first.

So wires have an index ..... ?
and in this case is performed first the lowest index .... ?

edit:
ok, It depends on when is connected the wire, this is the order of execution of the function ...
changing the order change the order of execution ...

The node the wires are saved in has a index in the flow.json. Any node modified would be added to the end of the flow json.

You could also deploy the modified flow rather than the modified nodes, which may help with keeping order, but not guaranteed.

Ok, thank you ....