Future smart factories feature flexible systems that can dynamically reconFigure manufacturing systems via near real-time system monitoring and learning-based self-optimization. Automated guided vehicles (AGVs), as a critical method of transporting goods and material within a factory, is vital for flexible automation in a smart factory. However, there is an urgent gap in the ability to dynamically schedule and assign tasks for AGVs in a dynamic environment. In this research, we propose a decentralized AGV fleet architecture and task allocation method to enable dynamic allocation/reallocation of tasks in an AGV fleet. The developed algorithm can also reconFigure AGV task allocations to adapt to system changes, such as AGV failure and new AGVs joining the system. The system modeling, setup and algorithms are presented with a case study in a lab environment that demonstrates flexible collaboration between an AGV fleet and a robotic assembly cell. © 2020 IEEE.