def run_matrix(self, matrix_definition, document):
        """
        Running pipeline via a matrix.

        Args:
            matrix_definition (dict): one concrete matrix item.
            document (dict): spline document (complete) as loaded from yaml file.
        """
        matrix = Matrix(matrix_definition, 'matrix(parallel)' in document)

        process_data = MatrixProcessData()
        process_data.options = self.options
        process_data.pipeline = document['pipeline']
        process_data.model = {} if 'model' not in document else document['model']
        process_data.hooks = Hooks(document)

        return matrix.process(process_data)