Flows on Metric Graphs with General Boundary Conditions