async def create(
        self,
        db: AsyncSession,
        sync: schemas.SyncCreate,
        current_user: schemas.User,
        uow: UnitOfWork,
    ) -> schemas.Sync:
        """Create a new sync.

        This function creates a new sync and then creates the initial DAG for it. It uses an
        externally scoped unit of work to ensure that the sync and DAG are created in a single
        transaction, with rollback on error.

        Args:
        ----
            db (AsyncSession): The database session.
            sync (schemas.SyncCreate): The sync to create.
            current_user (schemas.User): The current user.
            uow (UnitOfWork): The unit of work.

        Returns:
        -------
            schemas.Sync: The created sync.
        """
        sync = await crud.sync.create(
            db=db,
            obj_in=sync,
            current_user=current_user,
            uow=uow,
        )
        await uow.session.flush()
        await dag_service.create_initial_dag(
            db=db, sync_id=sync.id, current_user=current_user, uow=uow
        )
        return sync
Create a new sync.

        This function creates a new sync and then creates the initial DAG for it. It uses an
        externally scoped unit of work to ensure that the sync and DAG are created in a single
        transaction, with rollback on error.

        Args:
        ----
            db (AsyncSession): The database session.
            sync (schemas.SyncCreate): The sync to create.
            current_user (schemas.User): The current user.
            uow (UnitOfWork): The unit of work.

        Returns:
        -------
            schemas.Sync: The created sync.
        
backend/airweave/core/sync_service.py