For cluster tools with residency time constraints in semiconductor manufacturing, the online scheduling problem is addressed when temporary wafer arrives. On the basis of the statement domain of scheduling problem, mathematical formulations of the scheduling problems are presented. The two-layer method is proposed. The outer-layer algorithm denotes to solve the processing order of temporary wafer by particle swarm optimization, while the inner-layer one determines the start time of each station based on the given order by using the two-stage recursion method. The feasibility of the inner algorithm is proved theoretically. The simulation results show that the proposed method is effective for solving the large- scale scheduling problem of temporary wafer.