In order to solve the problems of security threats on workflow scheduling in cloud computing environments, the security of tasks and virtual machine resources are quantified using a cloud model, and the users’ satisfaction degree with the security of tasks assigned to the virtual resources is measured through the similarity of the security cloud. On this basis, combined with security, completion time and cost constraints, an optimized cloud workflow scheduling algorithm is proposed using a discrete particle swarm. The particle in the particle swarm indicates a different cloud workflow scheduling scheme. The particle changes its velocity and position using the evolution equation of the standard particle swarm algorithm, which ensures that it is a feasible solution through the feasible solution adjustment strategies. The simulation experiment results show that the algorithm has better comprehensive performance with respect to the security utility, completion time, cost and load balance compared to other similar algorithms.