Update merging function for flowgraph API