def METHOD_NAME():
    should_skip = skip_restore()
    latest_snapshot = get_latest_prod_snapshot()
    should_skip >> latest_snapshot
    ensure_snapshot_ready = RdsSnapshotExistenceSensor(
        task_id="ensure_snapshot_ready",
        db_type="instance",
        db_snapshot_identifier=latest_snapshot,
        aws_conn_id=AWS_RDS_CONN_ID,
        mode="reschedule",
        timeout=60 * 60 * 4,  # 4 hours
    )
    staging_details = get_staging_db_details()
    should_skip >> staging_details
    restore_snapshot = restore_staging_from_snapshot(latest_snapshot, staging_details)
    ensure_snapshot_ready >> restore_snapshot
    await_staging_creation = make_rds_sensor(
        task_id="await_staging_creation",
        db_identifier=constants.TEMP_IDENTIFIER,
    )
    restore_snapshot >> await_staging_creation
    notify_outage = notify_slack.override(task_id="notify_outage")(
        ":warning: Staging database is being restored, staging will "
        "be down for the duration."
    )
    rename_staging_to_old = make_rename_task_group(
        constants.STAGING_IDENTIFIER, constants.OLD_IDENTIFIER
    )
    await_staging_creation >> [notify_outage, rename_staging_to_old]
    rename_temp_to_staging = make_rename_task_group(
        constants.TEMP_IDENTIFIER, constants.STAGING_IDENTIFIER
    )
    rename_staging_to_old >> rename_temp_to_staging
    # Only run this if the secondary rename failed
    rename_old_to_staging = make_rename_task_group(
        constants.OLD_IDENTIFIER,
        constants.STAGING_IDENTIFIER,
        trigger_rule=TriggerRule.ALL_FAILED,
    )
    notify_failed_but_back = notify_slack.override(task_id="notify_failed_but_back")(
        ":warning: Staging database rename failed, but staging should "
        "now be available. Please investigate the cause of the failure."
    )
    rename_temp_to_staging >> rename_old_to_staging >> notify_failed_but_back
    delete_old = RdsDeleteDbInstanceOperator(
        task_id="delete_old",
        db_instance_identifier=constants.OLD_IDENTIFIER,
        rds_kwargs={"SkipFinalSnapshot": True, "DeleteAutomatedBackups": False},
        aws_conn_id=AWS_RDS_CONN_ID,
        wait_for_completion=True,
    )
    rename_temp_to_staging >> delete_old
    notify_complete = notify_slack.override(task_id="notify_complete")(
        ":info: Staging database restore complete, staging should now be available.",
    )
    # Truncate the oauth tables, the cascade ensures all related tables are truncated
    truncate_tables = PGExecuteQueryOperator(
        task_id="truncate_oauth_tables",
        sql=d(
            """
            TRUNCATE TABLE api_throttledapplication RESTART IDENTITY CASCADE;
            TRUNCATE TABLE api_oauth2registration RESTART IDENTITY CASCADE;
            """
        ),
        postgres_conn_id=POSTGRES_API_STAGING_CONN_ID,
        execution_timeout=timedelta(minutes=5),
    )
    # Deploy the latest API package to staging
    execute_deploy = deploy_staging()
    rename_temp_to_staging >> [truncate_tables, execute_deploy] >> notify_complete