What do you mean by follow a line?
If you mean it should move like a vehicle on a road, that is what paths are for. The Godot step by steps touches on this.
If you want to make a complex shape like a Z then you need to use more than one collision box.
The reason is that the 3 Area2D objects will resolve collisions faster than a polygon shaped as a Z. In games lots of collision shapes are mixed to create a rough form; to save on math calculations.
If you want a very long collision box then splitting it into smaller ones is also better. A path that spawns the colliders would work for this.
Can you elaborate on what you are trying.