An efficient method for direct oxygenation of primary arylamines to nitriles and amides with switchable selectivity was developed using N,O-bidentate Ru3 clusters as catalysts.