John 18:4

Knowing all the things that were coming upon him (eidw panta ta ercomena ep auton). Mentioned already in John 13:1 . He was not taken by surprise. The surrender and death of Jesus were voluntary acts, though the guilt of Judas and the rest remains.