Based on the framework of consistent history theory, the quantum entangled history was proposed in 2015 and experimentally verified through temporal Greenberger-Horne-Zeilinger (GHZ) test with 3 time nodes in 2016. In this paper, we extend the temporal GHZ test to arbitrary time nodes and even system dimensions. Then, we define a witness to distinguish between the quantum entangled histories and the classical histories. The minimums of the witness for the classical histories are calculated for arbitrary number of time nodes and the system dimensions 2 and ∞. It is found that the minimums of the witness for the classical histories is always larger than the quantum entangled histories minimum −1. Only when both the number of time nodes and system dimensions approach to infinity, the minimum of the witness for classical and quantum entangled histories are identical.