def save(self, status=None):
        """Save object to persistent storage."""
        if self.model is None:
            raise WorkflowsMissingModel()

        with db.session.begin_nested():
            self.model.modified = datetime.now()
            if status is not None:
                self.model.status = status

            if self.model.extra_data is None:
                self.model.extra_data = dict()
            flag_modified(self.model, 'extra_data')
            db.session.merge(self.model)