The novel paradigm of collaborative automation, with machines and industrial robots that synergically share the same workspace with human workers, requires to rethink how activities are prioritized in order to account for possible variabilities in their durations. This article proposes a scheduling method for collaborative assembly tasks that allows to optimally plan assembly activities based on the knowledge acquired during runtime and so adapts to variations along the life cycle of a manufacturing process. The scheduler is based on time Petri nets and the output plan is optimized by minimizing the idle time of each agent. The experimental validation carried out on a realistic industrial use-case consisting of a small assembly line with two robots and a human operator confirms the effectiveness of the approach. Note to Practitioners —The optimization of manufacturing execution is a long standing problem in production engineering. Modern engineering tools are available to monitor and help decision-makers to reduce waste and schedule resources to optimize the efficiency of a manufacturing process. This article proposes a scheduling algorithm that continuously collects data from the manufacturing process and iteratively plans an optimal resource allocation strategy, trying to reduce the idle time of each agent. The approach is demonstrated on a realistic case study, where two robots and a human worker cooperate to assemble a USB/microSD adapter.