class Workflow:
    def __init__(self):
        self.connections = []

    def connect(self, out_node, out_port, in_node, in_port):
        self.connections.append((out_node, out_port, in_node, in_port))

    def get_connection(self, in_node, in_port):
        for o_node, o_port, i_node, i_port in self.connections:
            if i_node == in_node and i_port == in_port:
                return o_node, o_port
        raise RuntimeError("Missing connection")
