Related: How can I make an engagement with a high-level monster fun for my party?
For clarification; by "fun" I mean make the encounter challenging, yet not deadly, and not feel like a "rinse-and-repeat" of the same actions for an extended period of time.
As a player, I have been in a few games that involved a "gauntlet-like" fight - an encounter that consisted of fighting for a long period of time (upward of 7 rounds). These fights were fun, because they required the use of almost our entire arsenal of abilities, and health.
I want to design a similar fight for my game, where the players need to make their way through an area, while having to fight their way through multiple encounters. The issue is that if I were to simply keep replacing low-level enemies as they move forward, it would get pretty boring, pretty quick, but if I use too few, they won't even appear to be any kind of threat, and the party can just continue on, with the enemies nipping at their heels, providing no real threat.
In this particular fight I was in, there were also terrain challenges: climbing, the threat of falling, as the option to interact with the terrain to cut off the enemies. This provided some variation to the encounter, which really drew me into the whole event.
What things do I need to take into account when constructing an engagement that is intended to endure for a long duration (7-10 rounds), against an (apparent) ongoing horde of enemies, with the intention of not killing the party*?
*As a standard example, a party of four x fifth level characters