async def _create_and_run_sync_internal(
        self,
        sync_in: schemas.SyncCreate,
        current_user: schemas.User,
        uow: UnitOfWork,
    ) -> tuple[schemas.Sync, Optional[schemas.SyncJob]]:
        """Internal helper method for creating and running a sync.

        Args:
        ----
            sync_in (schemas.SyncCreate): The sync to create.
            current_user (schemas.User): The current user.
            uow (UnitOfWork): The unit of work to use.

        Returns:
        -------
            tuple[schemas.Sync, Optional[schemas.SyncJob]]: The created sync and job if run.
        """
        sync = await self.create(
            db=uow.session, sync=sync_in.to_base(), current_user=current_user, uow=uow
        )
        await uow.session.flush()
        sync_schema = schemas.Sync.model_validate(sync)

        sync_job = None
        if sync_in.run_immediately:
            sync_job_create = schemas.SyncJobCreate(sync_id=sync_schema.id)
            sync_job = await crud.sync_job.create(
                db=uow.session, obj_in=sync_job_create, current_user=current_user, uow=uow
            )
            await uow.session.flush()
            await uow.session.refresh(sync_job)
            sync_job = schemas.SyncJob.model_validate(sync_job)

        return sync_schema, sync_job
Internal helper method for creating and running a sync.

        Args:
        ----
            sync_in (schemas.SyncCreate): The sync to create.
            current_user (schemas.User): The current user.
            uow (UnitOfWork): The unit of work to use.

        Returns:
        -------
            tuple[schemas.Sync, Optional[schemas.SyncJob]]: The created sync and job if run.
        
backend/airweave/core/sync_service.py