Dear all:
I'm happy you could sort out most of the obstacles already. Let me give you a summary on what's happing in the background if you merge two branches with ambiguous variables. There is a magic rule: The top-most input defines the value of ambigious variables. We had longer discussion on how to resolve these conflicts and that is the decision we made. The main reason for the top most input is that (a) it's simple and (b) it makes sure that a variable connection (these optional mickey mouse ears) allow you to overrule any other value assignment from an input. If, for instance, you had a Joiner node and wanted the second input to define the value of a variable that's also defined at the first input, you could define an additional red variable connection from the upstream node at the second input to the variable input of the Joiner and hence make sure its value precedes any other input.
Why are there duplicate variables in the output even if there are no side branches in the workflow? We are definining and keeping variables by using a stack of variables (and loop information) in each node. So what's visible in the "Flow Variables" tab in the output view is the stack. If a node overwrites a variable it puts a new copy of that variable with a new value onto the stack. Downstream nodes will then just see that new value when they access that variable. From a programming point this concept is useful because it allows us to "clean" the stack if it's modified in a loop (we need to restore the state of the variables after the loop end as the variables defined during the loop are only valid for the current loop iteration).
There are (almost) always two copies of a variable on the stack because (most) of the nodes define a variable during configuration (without a valid value) and during execution (with the final assignment). Since the variable from the execution phase is put on top, it defines the value that's seen by downstream nodes.
I think (and please disagree if necessary) it's confusing that you see multiple occurrence of a variable in the output view. I will open a bug report that duplicates need to be filtered; the end user should really only see the currently active value of a variable.
Regards,
Bernd