* Handle IntegrityError specifically when assigning orphaned flows to superuser * Add missing session.add(flow) to ensure flow is added to the session before commit